I am trying to create a script that will create new user accounts on new systems that we install and put them in the respective permission groups. I have managed to add users to the 'administrators' group and remove them from the 'users' group but I am having some trouble when it comes to adding users to the 'Power Users' and 'Remote Desktop Users' groups. The script so far is as follows:
net user User1 User1 /add
net user User2 User2 /add
net localgroup administrators User2 /add
net localgroup powerusers User1 /add
net localgroup users Users2 /delete
Every thing bar the 4th line of the script is executing fine I have try'd the following lines to replace the 4th line and had no luck the lines are as follows:
net localgroup power_users user1 /add
net localgroup power%20%users user1 /add
Any help on this matter would be appreciated.
net localgroup
lists the available groups in the machine .. Check if the group exists and then proceed with the addition.
If the group exists and u still have a problem try "Power Users" .
尝试
net localgroup "Power Users" User1 /add
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.