Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Add Domain User to Local Admin Group

$
0
0
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?

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>