I am trying to create a script that will enable our automated tool to add certain groups into the localgroups of our servers:
net localgroup dbusers aceina\A&H Support (Accenture) /add
The problem I have is that it doesn't seem to like the "&".
C:\Program Files\IBM\SQLLIB\BIN>net localgroup dbusers 'aceina\A&H Support (Accenture)' /add
The syntax of this command is:
NET LOCALGROUP [groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]
'H' is not recognized as an internal or external command,
operable program or batch file.
I tried single and double quotes without any success. Can anyone suggest a way to get around this please?
EDIT
Tried:
C:\Program Files\IBM\SQLLIB\BIN>net localgroup dbusers "aceina\A^&H Support (Accenture)" /add
The syntax of this command is:
NET LOCALGROUP [groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]
and:
C:\Program Files\IBM\SQLLIB\BIN>net localgroup dbusers 'aceina\A^&H Support (Accenture)' /add
There is no such global user or group: 'aceina\A&H.
System error 1788 has occurred.
The trust relationship between the primary domain and the trusted domain failed.
Thanks