Script: Add/Remove a Domain User to/from Local Administrators Group
Add Domain User from Local Administrator Group
So you need to add a domain user to local administrators group. Besides the fact that you expose the organization, computer, and the various security risks. Here are a few ways to do this.
There are a number of ways to add domain user to local administrator group. I’ll show how to do this with a simple script
===SCRIPT BEGIN=== net localgroup administrators MyDomain.local\%username% /add
===SCRIPT END===
Just copy this script, change the domain name and run through Login Script.
Remove Domain User from Local Administrator Group
As you’ve seen above, the script adds a domain user local administrators group.
You can use the same script to delete the user, just change the Switch to: /del:
===SCRIPT BEGIN=== net localgroup administrators MyDomain.local\%username% /del
===SCRIPT END===
thanks – MSGeek