troubleshooting Question

Trouble reading Multi Valued Attributes from AD using VBS

Avatar of Mark Pavlak
Mark PavlakFlag for United States of America asked on
Visual Basic ClassicVB ScriptNetworking
3 Comments1 Solution1154 ViewsLast Modified:
I am currently working on a script which helps read particular AD account info and builds into a spread sheet.  One of the attributes I am trying to read is the protocolsettings attribute.  I know how to decode the results; however when multiple values exist ie

HTTP§0§1§§§§§§
POP3§0§1§4§ISO-8859-1§0§§§
IMAP4§0§1§4§ISO-8859-1§0§1§0§0

I only can get the 1st in the list.  How would I access the second and third.

I am using some the sub below.  note the objuser.protoclSettings call, when this is ran I would only get
HTTP§0§1§§§§§§ as the result I cannot grab the other two.

Sub ProcessOU (strOU)
Dim strNewOU,strObjectLocation
' Section to bind to ANY Active Directory.
Set objRoot = GetObject("LDAP://rootDSE")
Set ObjContainer = GetObject( strOU& _
objRoot.Get("defaultNamingContext")) 
 
For Each objUser In ObjContainer
	If objUser.class ="user" then
		objExcel.Cells(intRow,1)  = objUser.givenName
		objExcel.Cells(intRow,2)  = objUser.sn
		objExcel.Cells(intRow,3)  = objUser.description
		objExcel.Cells(intRow,4)  = objUser.physicalDeliveryOfficeName
		objExcel.Cells(intRow,5)  = objuser.company
		objExcel.Cells(intRow,6)  = objuser.telephonenumber
		objExcel.Cells(intRow,7)  = objuser.title
		objExcel.Cells(intRow,8)  = objuser.mobile
		objExcel.Cells(intRow,9)  = objuser.ipPhone
		objExcel.Cells (intRow,10)= objuser.protocolSettings
		If objuser.msNPAllowDialin = "True" Then
		objExcel.Cells(intRow,14) = "Allow Access"
		Else 
		objExcel.Cells(intRow,14) = "Controll Access through RAS Policy"
		End If
intRow = intRow + 1
Else If objuser.Class = "organizationalUnit" Then
		'Wscript.Echo objUser.Name&" Is an OU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
		'WScript.Echo objUser.distinguishedName &"is the DN"
		strNewOU = Replace(objUser.distinguishedName,",DC=ELIZABETH",",")
		ProcessOU ("LDAP://"&strNewOU)
	End If
	End If
	
Next
End Sub
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros