Visual Basic Classic
--
Questions
--
Followers
Top Experts
HTTP§0§1§§§§§§
POP3§0§1§4§ISO-8859-1§0§§§
IMAP4§0§1§4§ISO-8859-1§0§1
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
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
objSettings = objUser.GetEx("protocolSet
The GetEx method documentation can be found here:
http://msdn.microsoft.com/en-us/library/aa746348(VS.85).aspx
Basically, this method makes sure that the correct data type is returned whether there are none, one, or multiple values in the multi-valued attribute, without returning an error, as direct access would if it didn't exist.
It returns a data type (determined by TypeName(objSettings)) of Empty, String, or Array.
Regards,
Rob.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Visual Basic Classic
--
Questions
--
Followers
Top Experts
Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.