简体   繁体   中英

Adding AD users as an Admin

Here's the situation. I'm am completely new to PowerShell so use small words...

I have a new user in Active Directory that I need to add to about 100 computers as efficiently as possible. My hope was that I could make a PowerShell script that would add the user either through a login script or remotely. I need to have a bit of precision control over this deployment because we don't want to push this user to every computer in the company.

Can PowerShell help me with this, and if not do you all have some sage advice that could help?

To add a user to the local administrators group using PowerShell:

([ADSI]"WinNT://./Administrators,group").Add("WinNT://your-domain/new-user,user")

Just replace the your-domain and new-user parts of the command with the appropriate values for your environment.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM