The "\" character is a special character in LDAP query strings and must be
escaped. The basic escape character in LDAP is, you guessed it, the "\"
character. (There is another way to escape UTF-8 characters in LDAP, but we
won't go there right now. For details, see:
<http://theessentialexchange.com/blogs/michael/archive/2007/11/13/working-wi
th-binary-data-guids-in-vbscript.aspx>.

 

So, a single "\" becomes "\\". The doubled character becomes "\\\\".

 

There is an LDAP RFC that covers this (and Active Directory is compliant).
Search at rfc-editor.org if you are interested in the gory details.

 

From: MarvinC [mailto:marv...@gmail.com] 
Sent: Tuesday, February 24, 2009 9:48 PM
To: NT System Admin Issues
Subject: A simple yet...not so simple ??

 

dsquery * domainroot -filter
"(&(objectCategory=Person)(objectClass=User)(homeDirectory=\\directorypath))
" -attr sAMAccountName homeDirectory > c:\temp\hdir.csv

  

This "simple" query is suppose to write all domain users who homeDirectory
path resides on a particular server. The file gets created and there are no
errors but nothings' written to it. Can someone quide me on what it is I'm
doing wrong?

 

Any responses appreciated

 

 

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

Reply via email to