(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

 
malcattAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
What are the values of:

strOUADsPath
strComputerADsPath

~bp
0
malcattAuthor Commented:
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.
0
Bill PrewIT / Software Engineering ConsultantCommented:
I also notice this note:

"However, you cannot do the same with VBScript. This is because VBScript maps vbNullString to an empty string instead of to a null string, as does Visual Basic. You must use the RDN explicitly, as shown in the previous example."

on the following page:

http://msdn.microsoft.com/en-us/library/aa705991(VS.85).aspx

which seems to indicate that in VBSCRIPT you can't specify vbNullString as the second parm (like you can in VB).

~bp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

malcattAuthor Commented:
strComputerADsPath= LDAP://CN=PCN0345,OU=Workstations,DC=tal,DC=dom
0
Bill PrewIT / Software Engineering ConsultantCommented:
The second parm seems to default to NULL if not passed, have you tried:

objTargetOU.Movehere strComputerADsPath

~bp
0
malcattAuthor Commented:
Just did without the vbNullString
objTargetOU.Movehere strComputerADsPath
same result unfortunately
0
x-menIT super heroCommented:
Are there any special char in the OUs name (like "\")?
0
x-menIT super heroCommented:
...or in any other object...
0
malcattAuthor Commented:
Just Double Checked, no extra characters
0
Bill PrewIT / Software Engineering ConsultantCommented:
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
0
malcattAuthor Commented:
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
0
RobSampsonCommented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.