I'm trying to run the following to add local admins on a freshly imaged machine...
When I take the console output and copy paste that into the Run box in windows, it runs fine. When I run the script, the local admin doesn't get added in. Any ideas what I'm doing wrong here?
[ autoit ]
$test = "username" RunWait(@ComSpec & " /c " & "net localgroup administrators domain\" & $test & " /add", @SW_HIDE) ConsoleWrite(@ComSpec & " /c " & "net localgroup administrators domain\" & $test & " /add")
When I take the console output and copy paste that into the Run box in windows, it runs fine. When I run the script, the local admin doesn't get added in. Any ideas what I'm doing wrong here?