AFAIK it isn't possible under WinRT apps - the link you have provided stays for WP8.1 Silverlight Apps - then I suspect you are trying to develop under WinRT - API Reference.
You can read more from here, also here at SO and at this article.
Following this answer, maybe the code below will help you:
HardwareToken myToken = HardwareIdentification.GetPackageSpecificToken(null);
IBuffer hardwareId = myToken.Id;
There is also a Guidance on using the App Specific Hardware ID (ASHWID) to implement per-device app logic.