chaoticyeshua Posted March 6, 2013 Posted March 6, 2013 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?
Moderators JLogan3o13 Posted March 6, 2013 Moderators Posted March 6, 2013 Hi, chaoticyeshua. I would do something like this: $oObj = ObjCreate( "WScript.Shell" ) $Group = ObjGet( "WinNT://" & @ComputerName & "/Administrators,group" ) $Group.Add ( "WinNT://<domain>/<groupname>,group" ) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
chaoticyeshua Posted March 6, 2013 Author Posted March 6, 2013 Perfect! That worked great. Thank you!
Moderators JLogan3o13 Posted March 6, 2013 Moderators Posted March 6, 2013 Glad to be of help "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now