Thursday, November 30, 2017

How do you find details about the aliases in WMI?

In order to explore with WMI we need to know the alias for the item we want to explore. Let us find out what the 'alias' in WMI is.

Let us get the help on 'alias' first.
Run this command (just type WMIC in search charm in Windows 10[this is where you see the Cortana icon]) and the C:\windows\System32\wbem\wmic.exe will come up as shown.

Now type alias /? at the wmic:root> prompt as shown.
-----------------------------------
wmic:root\cli>alias /?
ALIAS - Access to the aliases available on the local system
HINT: BNF for Alias usage.
( [WMIObject] | [] | [] ) [].

USAGE:
ALIAS ASSOC []
ALIAS CALL []
ALIAS CREATE
ALIAS DELETE
ALIAS GET [] []
ALIAS LIST [] []

wmic:root\cli>
------------------
Now we can get the aliases and what they represent using the Alias List command as shown in the next using the list switch - brief:
------------
wmic:root\cli>Alias List Brief
FriendlyName         PWhere                                  Target
NICConfig               Where Index=#                        Select * from Win32_NetworkAdapterConfiguration
SysDriver                 where Name='#'                       Select * from Win32_SystemDriver
TapeDrive                                                                 Select * from Win32_TapeDrive
NTEventLog           WHERE LogfileName='#'        Select * from Win32_NTEventlogFile
UserAccount                                                             Select * from Win32_UserAccount
Job                          WHERE jobid=#                               Select * from Win32_ScheduledJob
SoftwareElement                                                      Select * from Win32_SoftwareElement
--------------------------------------------------------
The full list is long and above is a clipped list.

Here is picture of the complete list (use a magnifier to see it):


WMicaliaslist.png

No comments: