Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible to pass to LDAP arguments?

Status
Not open for further replies.

dkel22

Programmer
Mar 31, 2004
49
US
I am creating a script that will create a group based on a user's direct reports. We want to be able to create a group based on direct reports of 2 different users. Is this possible. For example we call the script now as below
cscript /nologo processReportsToGroups.vbs "CN=TESTGROUP,OU=TEST,OU=Groups,DC=TEST,DC=com" "CN=USER1,OU=Executive Office,OU=Users,OU=TEST,DC=TEST,DC=com" True True "" "" E

The script takes the arguments passed as below
Set oArgs = WScript.Arguments
strGroupName = oArgs.Item(0)
strPersonName = oArgs.Item(1)
boolRecurse = oArgs.Item(2)
boolAddRoot = oArgs.Item(3)
strExceptions = oArgs.Item(4)
strAdditional = oArgs.Item(5)
strRunFlag = oArgs.Item(6)

Then we pull the user from AD by the following call
Set objUser = GetObject("LDAP://" & strPersonName)

Rather than running 2 scripts and trying to make it combine the results into one group is it possible to pass another argument for a 2nd user and then have the LDAP selection for objUser pull either user1 or user2?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top