New To Scripting and Script does not work 
Author Message
 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



Mon, 01 Aug 2005 11:45:34 GMT  
 New To Scripting and Script does not work
Hi,

Q: What if the OU is two words (like "Domain Accounts").  How would that
look in the LDAP statement?

A: Here is a sample:
LDAP://phoenix-01-svr/OU=Domain Controllers,DC=phoenix2k,DC=com

Q: **** Modified Script that does not work

A: Login name is not necessary the CN for an AD user. It depends on how you
create the user. You can install Windows 2000 support tools from Win2000 CD
and use ADSIEDIT to check the ADsPath of an AD object. You can also check
other AD properties such as CN for the user object using this tool.

http://support.microsoft.com/?id=301423

HTH.

Regards,
Yan Liu
This posting is provided "AS IS" with no warranties, and confers no rights.



Mon, 01 Aug 2005 15:33:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. New To Scripting and Script does not work

2. Script works, script don't work

3. Add new script to window.document.scripts

4. questions on passing text parameter from server script to client script (some new findings)

5. New Scripting Clinic article on Windows Script Components

6. New functionality add to the Script Repository at win32 scripting

7. Valid script does not work with Scripting Object Model

8. Valid script does not work with Scripting Object Model

9. New to scripting - can this be done?

10. 'Remote Scripting Error: Page invoked does not support remote scripting

11. Error: ActiveX Scripting was not able to initialize the script execution engine

12. HELP PLEASE - Why does this script not work?

 

 
Powered by phpBB® Forum Software