Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: 80072032 - An invalid dn syntax has been specified

Status
Not open for further replies.

mattersnotnow

IS-IT--Management
Oct 7, 2010
2
BR
Hello all,

[TAB]As probably implied by the subject, I'm having problems with this error in a script I'm trying to run. More specifically these lines:

Code:
for each objComp in objOU
	...
	
	set objOUmoveTo = GetObject("LDAP://OU=" & strType & ",OU=XX" & strCompSite & strOUmoveTo)
	set objTestBind = GetObject("LDAP://CN=" & objComp.cn & ",CN=Computers,DC=test,DC=com")
	objOUmoveTo.MoveHere "LDAP://CN=" & objComp.cn & ",CN=Computers,DC=test,DC=com", vbNullString

	...
next

[TAB]No GetObject fails. I get the error in the .MoveHere method. If I was failing while binding, I'd be ok, I'd know it was a typo. But the thing is the GetObject works, using the same string as a Distinguished Name as the .MoveHere.

Of notice: I've also tested using "OU=Computers" in the objTestBind line, but it says there's no such object.

I hope someone can help me with this.
Thanks!
 
If you are talking about the default Computers container, there is no OU=Computers, it is CN=Computers.

Use ADSIEdit to view the full distinguished name of the path you are trying to bind to. Compare that to the string you are binding with:

Code:
MsgBox "LDAP://OU=" & strType & ",OU=XX" & strCompSite & strOUmoveTo

Since I can't see the values of the variables I can't say for certain what path it is, however having the strOUmovTo at the end of that string indicates to me you have it wrong since site information is on the far right of an LDAP path.

The format would be like:
LDAP://OU=ZZZ,OU=YYY,OU=XXX,DC=Company,DC=local

I hope that helps.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
'i would add
set objOUmoveTo = GetObject("LDAP://OU=" & strType & ",OU=XX" & strCompSite & strOUmoveTo)
Wscript.Echo "objOUmoveTo.cn=" & objOUmoveTo.cn '?
set objTestBind = GetObject("LDAP://CN=" & objComp.cn & ",CN=Computers,DC=test,DC=com")
Wscript.Echo "objTestBind.cn=" & objTestBind.cn '?

'not that i dont believe your statement that the binds are successful, even though your code has no error checking / trapping after the GetObject calls, so we are all presuming you dont have On Error Resume Next and you are watching the screen for 'runtime' errors to be displayed
'but, at least, if you echo a property of the object you have 'got' then tell us you see it correctly we will eliminate the uncertaintity
 
Silly, silly, me...

I'm sorry for taking your time.
The error was quite simple: While running I was logged as a user with read rights only (to the AD objects that is). Logged as admin everything went fine.

The error message was kinda misleading though... half expected it pop an "Access Denied"

Thanks again to all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top