Using Verbs
There are several verbs that can be used with aliases. In simplest terms, the verbs are commands that you can use to work with the aliases.
Verbs (Commands) |
Description |
where where ( property = " value ") wmic alias where ( property = " value ") list full C:\>wmic useraccount where (name = "guest") list full |
Use to filter the output. The value must be enclosed in double quotes. Only valid properties of the alias can be used in a where clause. You can view all valid properties of any alias with the following command: wmic alias list full |
get get property wmic /node: remotecomputer alias get property C:\>wmic /node:win7pcg computersystem get username C:\>wmic /node:win7pcg computersystem get username, domain, totalphysicalmemory C:\>wmic useraccount where (name = "sally") get C:\>wmic useraccount where (name = "sally") get disabled |
You can use the get command to retrieve one or more properties of any alias. If you want to retrieve multiple properties, you separate each with a comma. The first example to the left gets the username of a logged-in user on a remote system of a remote computer. The second example gets the username, the domain, and the amount of physical memory installed on the remote computer. You can also use a where clause to filter the data. In the last two examples, a where clause is used to retrieve properties on a user account named Sally, and then only the value of the disabled property. |
set set property = " value" wmic /node: remotecomputer alias set property = "value" wmic /node: remotecomputer alias set property C:\>wmic /node:win7pcg useraccount where (name = "guest") set disabled = "true" |
The set command allows you to set some alias properties. The example combines the set command with the where clause to disable the guest account on a remote system. The value must be specified in double quotes. |
delete wmic alias where ( property = value ) delete C:\>wmic process where (name = 'notepad.exe') delete |
Deletes an instance. You can use this to terminate processes. The example terminates a running instance of Notepad. |
assoc wmic alias assoc C:\>wmic os assoc wmic alias where ( property = 'value') assoc C:\>wmic group where (name = 'administrators') assoc |
assoc shows the associations with an object. In the first example, it displays information about the operating system alias. The second example shows all WMI objects that are associated with the Administrators group by adding a where clause. |