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
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
ASKER
strOUADsPath= "LDAP://" & objOUs(objComputers(strCom puter)) & "," & 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=TESTDE ST, DC=tal, DC=dom) does what we want it to do which move opject to this OU.
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=TESTDE
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
strComputerADsPath= LDAP://CN=PCN0345,OU=Works tations,DC =tal,DC=do m
The second parm seems to default to NULL if not passed, have you tried:
objTargetOU.Movehere strComputerADsPath
~bp
objTargetOU.Movehere strComputerADsPath
~bp
ASKER
Just did without the vbNullString
objTargetOU.Movehere strComputerADsPath
same result unfortunately
objTargetOU.Movehere strComputerADsPath
same result unfortunately
Are there any special char in the OUs name (like "\")?
...or in any other object...
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
~bp
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=Works tations,DC =tal,DC=do m
Set objTargetOU = GetObject(strComputerADsPa th
because strComputerADsPath is not a string.
This should work:
Set objTargetOU = GetObject("LDAP://CN=PCN03 45,OU=Work stations,D C=tal,DC=d om")
as should this
strComputerADsPath = "LDAP://CN=PCN0345,OU=Work stations,D C=tal,DC=d om"
Set objTargetOU = GetObject(strComputerADsPa th)
Is the OU in the same domain that you're running the script on?
Regards,
Rob.
strComputerADsPath= LDAP://CN=PCN0345,OU=Works
Set objTargetOU = GetObject(strComputerADsPa
because strComputerADsPath is not a string.
This should work:
Set objTargetOU = GetObject("LDAP://CN=PCN03
as should this
strComputerADsPath = "LDAP://CN=PCN0345,OU=Work
Set objTargetOU = GetObject(strComputerADsPa
Is the OU in the same domain that you're running the script on?
Regards,
Rob.
strOUADsPath
strComputerADsPath
~bp