Link to home
Start Free TrialLog in
Avatar of malcatt
malcatt

asked on

(null): 0x80005000 what is this telling me

Have a script which reads in two excell spreadsheets then would like to move computers into the correct OU.  Issue is when I try to set objTargetOU it appears to give me a null value.

WScript.Echo "Moving " & strComputerADsPath & " to " & strOUADsPath
'------Note : Echo returns expected response

Set objTargetOU = GetObject(strOUADsPath)
objTargetOU.Movehere strComputerADsPath, vbNullString

Get a (null): 0x80005000 what is this telling me

 
Avatar of Bill Prew
Bill Prew

What are the values of:

strOUADsPath
strComputerADsPath

~bp
Avatar of malcatt

ASKER

strOUADsPath= "LDAP://" & objOUs(objComputers(strComputer)) & "," & strDNSDomain

which equals LDAP://OU=TESTDEST, DC=tal, DC=dom and we echo it to prove it, yet
 
Set objTargetOU = GetObject(strOUADsPath) gives us the null
 Set objTargetOU = GetObject(LDAP://OU=TESTDEST, DC=tal, DC=dom) does what we want it to do which move opject to this OU.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of malcatt

ASKER

strComputerADsPath= LDAP://CN=PCN0345,OU=Workstations,DC=tal,DC=dom
The second parm seems to default to NULL if not passed, have you tried:

objTargetOU.Movehere strComputerADsPath

~bp
Avatar of malcatt

ASKER

Just did without the vbNullString
objTargetOU.Movehere strComputerADsPath
same result unfortunately
Are there any special char in the OUs name (like "\")?
...or in any other object...
Avatar of malcatt

ASKER

Just Double Checked, no extra characters
Any chance that this is a permissions problem?  Have you tried using DSMOVE to do this from the command line just to see if it might toss up any other clues?

~bp
Avatar of malcatt

ASKER

Good thought, unfortunately not this case.  I thought of this also and tested it out.  Moved just fine.  May start over to see if I missed something.  Looked into what you mentioned about vbNullString not being supported, this may have something to do with it.  Thanks for you support
Hi, the GetObject method requires a string.  This would not work

strComputerADsPath= LDAP://CN=PCN0345,OU=Workstations,DC=tal,DC=dom
Set objTargetOU = GetObject(strComputerADsPath

because strComputerADsPath is not a string.

This should work:
Set objTargetOU = GetObject("LDAP://CN=PCN0345,OU=Workstations,DC=tal,DC=dom")

as should this
strComputerADsPath = "LDAP://CN=PCN0345,OU=Workstations,DC=tal,DC=dom"
Set objTargetOU = GetObject(strComputerADsPath)

Is the OU in the same domain that you're running the script on?

Regards,

Rob.