WMIC kbox script
I'm trying to run this simple statement to rename a machine though KACE:
wmic.exe computersystem where caption='loanerssd7x64' rename ssdloaner7x64
The command works fine when I manually do it, but I can not get it to run through KACE properly. Any ideas on what I can do here?
Community Chosen Answer
You are doing one or two things wrong.
first the syntax is " qoutes around the parameters and ' quotes around the items.
this is becuase you can use multiple operators and then wmi knows the rules.
as an example: where "name like 'Java 6%%' or name like 'Java 7%%' and name != 'Java 7 Update 51'"
so you want to use this in your script:
/c wmic.exe computersystem where "caption='loanerssd7x64'" rename ssdloaner7x64
and the second mistake you may be making is if the machine is in a domain you must use credentials that have domain rights to rename a machine object.