Jump to content

Recommended Posts

Posted

I have been using a VBscript login script that grabs the OU the account is in, then does certain things (mounts printers, creates shares etc.)

I dont recal doing anything over the summer, but when I came back to school the script is now failing. It looks like it's not seeing our domain on this line.

Set objUser = GetObject("LDAP://" & strUserName)

 

Here is a compact version of the script I use (the portion that's giving the error).

 

Set objSysInfo = CreateObject("ADSystemInfo")
strUserName = objSysInfo.UserName

Set objUser = GetObject("LDAP://" & strUserName)
strOUName = objUser.Parent

Set objOU = GetObject(strOUName)
Wscript.Echo objOU.distinguishedName

 

Here's an image of the error I get while running the above script now. Any suggestions on how to resolve this would be welcome.

 

error.JPG

Posted (edited)

Does the snippet you posted reference the error? Or was there some before it.

 

*Edit - Try setting it to a LDAP://"domain name" incase it's not registering properly

 

Steve

Edited by Steve21

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...