Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

671 Posts in 206 Topics- by 599 Members - Latest Member: NMTBeheer

February 04, 2012, 10:00:42 PM
RES Software User Group ForumProductsAutomation ManagerCreate bulk AD Groups
Pages: [1]
Print
Author Topic: Create bulk AD Groups  (Read 3237 times)
WTFoX
Newbie
*
Posts: 18



« on: May 21, 2009, 12:03:53 AM »

Hi all,

I was testing today with RES Wisdom 2009 SR1 (which is a great product ofcourse Wink). My goal was (and still is) to create a module which creates a number of Active Directory Global Security Groups in one step. Let's say: i want to add 10 Global Groups, named Group1, Group2, etc etc. There is a possibility with 'dsadd group' command, but probably someone overhere knows a more charming way ...

I like to hear from you guys ...
Logged

Starup
RESUG Forum Moderator
Newbie
***
Posts: 39


Starup


WWW
« Reply #1 on: May 21, 2009, 10:59:28 PM »

Hi Martin,

As promised - here's a hint to the solution:
http://www.computerperformance.co.uk/Logon/WSH_Group.htm

and another example:
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/usersgroups/groups/
« Last Edit: May 21, 2009, 11:02:32 PM by Starup » Logged

Sincerely,

Thomas Starup
WTFoX
Newbie
*
Posts: 18



« Reply #2 on: May 22, 2009, 06:32:06 PM »

Hi there! Thanx for the links Thomas.
So, i've created the following script:

Set objOU = GetObject("LDAP://OU=Groups,OU=GG,DC=DC01,DC=domain,DC=local")
For i = 1 To 10
Set objGroup = objOU.Create("Group", "CN=Groupname" & i)
objGroup.Put "sAMAccountName", "Groupname" & i
objGroup.SetInfo
Next


I've created two RES Wisdom Parameters: $[Groupname] (name of the groups) and $[Number] (number of groups to create). The script looks like this:

Set objOU = GetObject("LDAP://OU=Groups,OU=GG,DC=DC01,DC=domain,DC=local")
For i = 1 To $[Number]
Set objGroup = objOU.Create("Group", "CN=$[Groupname]" & i)
objGroup.Put "sAMAccountName", "$[Groupname]" & i
objGroup.SetInfo
Next


It all works fine! THNX Again
« Last Edit: May 22, 2009, 06:34:02 PM by WTFoX » Logged

Starup
RESUG Forum Moderator
Newbie
***
Posts: 39


Starup


WWW
« Reply #3 on: May 22, 2009, 07:33:06 PM »

Hi,

Looks great Grin

You're more than welcome to write anytime.
Logged

Sincerely,

Thomas Starup
WTFoX
Newbie
*
Posts: 18



« Reply #4 on: May 22, 2009, 11:43:44 PM »

The next step is to create a same script with PowerShell Wink
Logged

Starup
RESUG Forum Moderator
Newbie
***
Posts: 39


Starup


WWW
« Reply #5 on: May 23, 2009, 01:12:21 PM »

The next step is to create a same script with PowerShell Wink

True - try it out Wink

http://www.idera.com/Products/PowerShell/PowerShell-Plus/ looks like a cool editor!

Let us know, what you find out.
Logged

Sincerely,

Thomas Starup
Jeff Wouters
Newbie
*
Posts: 26



WWW
« Reply #6 on: June 02, 2009, 08:34:44 AM »

Know that editor Smiley Love it! Cheesy
My replacement for WebEdit when it comes to PowerShell Smiley
Logged
Eddie
Newbie
*
Posts: 4


« Reply #7 on: June 02, 2009, 05:46:43 PM »

Hello guys,

Am I missing the point here? There is a possiblility to create an AD task within RES Wisdom. The next thing you do is create a parameter for the group name. Now, You can schedule this task and use a CSV file to create as much AD groups as you like(on the parameter tab when scheduling a job!

Here is the Building block attached.....

Hope this one was helpful

greetz, Eddie

(by the way, after 10 years of scripting, I now try to prevent it.....  Grin)
« Last Edit: June 02, 2009, 05:48:52 PM by Eddie » Logged
Starup
RESUG Forum Moderator
Newbie
***
Posts: 39


Starup


WWW
« Reply #8 on: June 02, 2009, 06:59:11 PM »

Hi Eddie,

Welcome to forum!

The point was to create an "easy" way to create from 1->XXX number of groups. Of course, you're right - it can be achived by your BB above.

So again - nice post ;-)
Logged

Sincerely,

Thomas Starup
Airdeca
Newbie
*
Posts: 41



« Reply #9 on: June 03, 2009, 10:25:49 PM »

Just putting some oil on the flames,

I have to agree with Eddie. Why script when you've got RES Wisdom?

Rob
Logged
RESguru
RESUG Forum Moderator
Jr. Member
***
Posts: 69



WWW
« Reply #10 on: June 10, 2009, 02:24:44 PM »

Hello guys,

Am I missing the point here? There is a possiblility to create an AD task within RES Wisdom.

Here is the Building block attached.....


Hi Eddie, No - I don't think you missed the point. In fact I think you hit it spot on. I've taken the liberty to quote your posting on the main sites' Wisdom BB archive: http://www.resug.com/wisdom-buildingblock-archive

Logged

Thanks,
Max Ranzau | Twitter: http://twitter.com/RESguru
Pages: [1]
Print
Jump to: