Jump to content
Sign in to follow this  
chaoticyeshua

Add Domain User to Local Admin Group

Recommended Posts

chaoticyeshua

Hi everyone.

I'm needing some assistance with adding domain users to the local administrator group from the local Administrator account. We currently have a Powershell script that does this and it works just fine, but I have not been able to get this to work in AutoIt. I've tried searching the forums, but have not found a solution that is working.

Here's the code snippet from Powershell:

$domainGroup = [ADSI]("WinNT://domain/user_or_group")
$localGroup = [ADSI]("WinNT://" + $env:COMPUTERNAME + "/Administrators")
$localGroup.PSBase.Invoke("Add",$domainGroup.PSBase.Path)

Can anyone assist with this?

Share this post


Link to post
Share on other sites
chaoticyeshua

Perfect! That worked great. Thank you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×