I need to add AD user to local admins group on multiple servers.
I found this:
” Needed to add a user to the local administrators on 16 citrix servers, below is the code if you need it.
psexec @servers.txt cmd /c “net localgroup Administrators /add domainusername”
this doesnt work with multiple usernames at one time.
get psexec here: http://www.sysinternals.com
servers.txt is a text file containing a list of servers, i.e:
But when run it, I get the error (see below).
When run only “net localgroup Administrators /add domainehpsim” on the same pc, the command executed successfully. Why it complains about “net” command?
I guess no need to translate the error message from French :)
C:addadmin>psexec @servers.txt cmd /c “net localgroup Administrators /add domainehpsim”
PsExec v1.98 – Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals – http://www.sysinternals.com
‘”net’ n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
cmd exited on csssjr00s22666 with error code 1.
You must be logged in to reply to this topic.
Create a free account today to participate in forum conversations, comment on posts and more.