Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 16 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
I have writen the following code in LDAP way. My goal is to retrieve all computer accounts in contoso.com and pop up their account names. It returns a Type Mismatch error on "If sObject = "Computer"", can anybody help? Thank you.
Set oDomain = GetObject("LDAP://dc=contoso,dc=com")
For Each oObject In oDomain
sObject=oObject.get("objectClass")
If sObject = "Computer" Then
WScript.Echo oObject.get ("sAMAccountName")
End If
Next
This topic is 16 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.