Jump to content

Recommended Posts

Posted (edited)

Hi there,

is it possible in AutoIt to add a global to a local group in an Active Directory environment?

I'm already using the UDF library "adfunctions.au3" but there's only a function "_ADAddUserToGroup" which will add an user to a group. This function IMHO isn't able to add groups to other groups.

If I use the Active Directory Console it is possible to add global groups to local groups. How can I implement this in AutoIt?

The only useful thing my friend Google found is this: http://www.visualbasicscript.com/m_26817/tm.htm

But unfortunately this example is written in VBS and I'm not very experienced in VBS. Can anybody translate it to AutoIt or help me in another way?

Any help appreciated! TIA!

HeinWupp

Edited by HeinWupp
Posted (edited)

Hi there,

is it possible in AutoIt to add a global to a local group in an Active Directory environment?

I'm already using the UDF library "adfunctions.au3" but there's only a function "_ADAddUserToGroup" which will add an user to a group. This function IMHO isn't able to add groups to other groups.

If I use the Active Directory Console it is possible to add global groups to local groups. How can I implement this in AutoIt?

The only useful thing my friend Google found is this: http://www.visualbasicscript.com/m_26817/tm.htm

But unfortunately this example is written in VBS and I'm not very experienced in VBS. Can anybody translate it to AutoIt or help me in another way?

Any help appreciated! TIA!

HeinWupp

Happy New Year:
Global $sDomain = "Domain_Name"
Global $sGlobalGroup = "Global_Group_Name"
Global $sLocalGroup = "Local_Group_Name"
Global $sComputer = @ComputerName
Global $oDomainGroup = ObjGet("WinNT://" & $sDomain & "/" & $sGlobalGroup & ",group")
Global $oLocalAdmGroup = ObjGet("WinNT://" & $sComputer & "/" & $sLocalGroup & ",group")
$oLocalAdmGroup.Add($oDomainGroup.AdsPath)
$oLocalAdmGroup.SetInfo

:)

Edit: Made it cleaner.

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

Hi Psalty,

hey, that's exactly what I've been searching for! Works fine - also with my trusted Active Directorys!

Many thanks!

Greetings from cold and snowy Germany

HeinWupp

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
×
×
  • Create New...