1.Create a file, with the content. username=WindowsUsername password=WindowsPassword domain=DomainNameOrWorkGroup 2. For security, assign the permission 400. Example mkdir /etc/wmic vi /etc/wmic/Win20008.txt chmod 400 /etc/wmic/Windows2008R2srv.txt cat /etc/wmic/Windows2008R2srv.txt username=zabbixmonitor password=SuperPassword domain=WORKGROUP Usage: wmic -A /etc/wmic/Windows2008R2srv.txt //192.168.123.58 “select * from Win32_ComputerSystem”
WMI quick examples
WMI quick examples: 1. Execute WQL in PowerShell Open PowerShell and use object Get-WmiObject with -Query argument. Examples: PS C:\Users\aurlen-win7-13> Get-WmiObject -Query “select * from Win32_ComputerSystem” Domain : S301M Manufacturer : LENOVO Model : 7034CP2 Name : T7PCAG935 PrimaryOwnerName : Leer más