Adding users, or most often groups from Active Directory to the local administrator group on the server or client is a common task carried out as a system administrator.
Previously, accomplishing this required some scripting, but now it’s possible to use a simple one-liner. Of course, you can also use this one-liner in your scripts.
In this blog post, I cover how to add users and or group from Active Directory to the local administrator group using Powershell.
How to add users or groups to the local administrator group using Powershell
As mentioned in the introduction, previously, you were required to create a custom script for adding users or groups to the local admin group using Powershell.
Open an elevated Powershell window and enter the following command, updated with your scenario:
Add-LocalGroupMember -Group "Administrators" -Member "domain\user or group", "additional users or groups"
That’s it! When I look in the local administrator group from the Computer Management view, I now see my domain user:
Carrying out simple tasks as adding users or groups to the local administrator group can be done via the GUI or Powershell.
How do you add users or groups to the local administrator group? Please leave a comment below!
- Use Powershell to copy content from one text file to another
- Elevate Powershell window to administrator
- Copy a file to a new directory using Powershell
- Powershell script to add users from a file to a group
- How to change the Powershell version for backward compatibility
- Powershell UNC path browsing using PSDrives
Subscribe to newsletter:
If you want to receive the latest news for MEMCM, Windows 10, and Powershell, please subscribe to my monthly newsletter!