WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

dsDeleteObj Issue

 Keywords: dsDeleteObj Issue Problem Delete Object LDAP 

Question:

I am trying to use DsDeleteObj with my active directory domain. It never seems to work. Are there some special conditions required? I have the object permissions required to do the delete and can do it manually. I am using the ldap address:
LDAP://CN=ComputerName,OU=Computers,OU=MyOU,DC=root,DC=MyDomain,DC=org which works fine for other ADSI commands in winbatch. 
The help file claims that this command always returns 0. That is kind of useless. I saw an example in the tech area of someone using the return to check the delete success, so is it even true that it always returns a 0?

Answer:

No known issues with the function. It is one of the simplest functions in the extender and is basically a cover for an underlying early bind COM interface method. How are you determining that the object was not deleted?

You could give accessing AD via WinBatch COM a try. Post back if you need assistance with this.

As for the return value, don't believe everything you see on the internet {grin}. DsDeleteObj always returns 0. The underlying ADSI client API is supposed to report any errors that occur when the delete fails and the function will echo errors that occur during the process so returning anything other than 0 is not very meaningful. Do you have WinBatch error handling turned off?


Article ID:   W17524
Filename:   dsDeleteObj Issue.txt
File Created: 2012:12:06:08:39:46
Last Updated: 2012:12:06:08:39:46