I'm attempting to gather a large quantity of data from the group objects in our AD using vbScript. So far the script keeps failing on the same group object. In someone's infinite wisdom they've put a "/" character in a group's name which means the group's DN also has the "/". When I pass along the "/" to query AD the script errors out.
Hopefully the below code will show a little more insight.
Now if I use:
The script errors out on this line:
If I use the DN:
I don't get any issues.
I'm 99.99% sure it is b/c of the "/" character. The script runs through 3,100+ groups without an error until it sees this one with the "/" character.
Anyone have any suggestions or workarounds other than just skipping it?
=================
There are 10 kinds of people in this world, those that understand binary and those that do not.
Hopefully the below code will show a little more insight.
Code:
strGroupDN = "CN=DVD/CD,DC=domain,DC=com"
'strGroupDN = "CN=USERS,DC=domain,DC=com"
Set objGroup = GetObject("LDAP://" & strGroupDN)
'RETRIEVE GROUP ATTRIBUTES
strGroupName = objGroup.Name 'Group Name.
strGroupManager = objGroup.managedBy 'Group Manager.
Wscript.echo "Name: " & strGroupName & vbcrlf & "Manager: " & strGroupManager
Now if I use:
Code:
strGroupDN = "CN=DVD/CD,DC=domain,DC=com"
The script errors out on this line:
Code:
Set objGroup = GetObject("LDAP://" & strGroupDN)
If I use the DN:
Code:
strGroupDN = "CN=USERS,DC=domain,DC=com"
I don't get any issues.
I'm 99.99% sure it is b/c of the "/" character. The script runs through 3,100+ groups without an error until it sees this one with the "/" character.
Anyone have any suggestions or workarounds other than just skipping it?
=================
There are 10 kinds of people in this world, those that understand binary and those that do not.