Sign in to follow this  
Followers 0
HeinWupp

Active Directory: how can I add a global to a local group?

3 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



#2 ·  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

Share this post


Link to post
Share on other sites

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

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  
Followers 0