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?
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?