wmic output well formed xml on remote queries
- by Mervin
I want to use the WMI command line tool (wmic) to get information about windows computers on the network and output it as valid xml.
However, I can't seem to find the right way to do this as the outputted xml currently contains invalid tokens for which I think I should use the /TRANSLATE:basicxml switch.
The command:
wmic /NODE:"tech-demo" /IMPLEVEL:Impersonate /USER:MyUser /PASSWORD:MyPassword /PRIVILEGES:DISABLE /AUTHLEVEL:Pkt /AUTHORITY:"ntlmdomain:companydomain.local" PATH Win32_LogicalDisk GET * /FORMAT:rawxml
This command runs but returns invalid xml tokens ('<' and '' I think? edit: it appears to fail parsing at ‹)
When I add the translate switch I get the message:
Can not use credentials for local connections
a bit strange that it tries to query the local pc when I add the switch..
Help would be greatly appreciated.