I am trying to automate the rollout of PC's ar my location. I have sysprepped a machine and imaged it with all that we need and after we deploy a machine we use a corporate provided script to join it to the domain. Post domain add I have another script that we run that firther sets up the machine. One of the tasks I am trying to accomplish is adding our local it security group to the PC's local administrators group. I have the following line in cmd file:
net localgroup administrators domain/local security group /add
This does not work and it appears to be because of the spaces in the group name (which is controlled by corporate and cannot be changed to something without spaces). I have tried encapsulating the group name in quotes, the domain plus the groupname in quotes and defining the while string as a variable and passing the variable to the command, but it always fails.
This is on Windows 7 enterprise x64. If I try to add the group via the gui (computer management) it works great so I know it is possible. Any help would be much appreciated.