
New To Scripting and Script does not work
I am a
VBScript newbie and am having trouble getting going. I am
trying to run a script against my Windows 2000 (win2k) domain. Even
the sample scripts I try don't work! I copied one below that I got
from Microsoft's Script Center. I modified the username and domain to
what I thought would be correct but no luck.
I get the pop-up boxes, but they contain no information. The account
contains information since I put it there to test.
Another question, what if the OU is two words (like "Domain
Accounts"). How would that look in the LDAP statement?
Any help would be appreciated.
**** Original Script from System Administration Scripting Guide Script
Repository Version 1.1, August 2002
On Error Resume Next
Set objUser = GetObject _
("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")
objUser.GetInfo
strTitle = objUser.Get("title")
strDepartment = objUser.Get("department")
strCompany = objUser.Get("company")
strManager = objUser.Get("manager")
strDirectReports = _
objUser.GetEx("directReports")
WScript.echo "title: " & strTitle
WScript.echo "department: " & strDepartment
WScript.echo "company: " & strCompany
WScript.echo "manager: " & strManager
For Each strValue in strDirectReports
WScript.echo "directReports: " & strValue
Next
**** Modified Script that does not work
**** Name is Arthur Dent, user login name is ADent, user is in a
nested OU (one below the other) of KY\Users, Domain is City.net (was
City_KY)
**** note the Domain was an upgrade from NT 4.0 to Windows 2000
On Error Resume Next
Set objUser = GetObject _
("LDAP://cn=adent,ou=users,ou=ky,dc=city,dc=net")
objUser.GetInfo
strTitle = objUser.Get("title")
strDepartment = objUser.Get("department")
strCompany = objUser.Get("company")
strManager = objUser.Get("manager")
strDirectReports = _
objUser.GetEx("directReports")
WScript.echo "title: " & strTitle
WScript.echo "department: " & strDepartment
WScript.echo "company: " & strCompany
WScript.echo "manager: " & strManager
For Each strValue in strDirectReports
WScript.echo "directReports: " & strValue
Next