1. When using slashes in a query you need to be careful of the characters
following them. Officially you are supposed to specify all slashes that are
part of a query as \5c. However a lot of the times you can skip that, except
if the slash is followed by a valid HEX character 0-9 and A-F. What happens
then is that it gets translated to a binary value and won't match on much
most likely. In the string you specify, \19 for instance becomes EM (End of
Medium) which is obviously not the 1973 you were expecting. 

See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/s
earch_filter_syntax.asp


2. Get ready to upgrade ADFIND, a new version will be out within a week -
V01.31.00. HUGE changes. So huge I almost considered making it V01.50.00
because I won't do V02.00.00 until it is a major rewrite.



--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm 
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steve Rochford
Sent: Tuesday, March 21, 2006 4:34 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] Script to find owner of home directory

I know to write a script which will take a username and find that user's
home directory but can I do the reverse? What I want to to is clean up the
home directories folders - I've got nearly 20,000 home folders but only
about 15,000 active accounts so what I want to do is take each folder name
and ask AD who it belongs to.

I've tried using LDP with the query:

(homedirectory=\\tconwl11\home\1973)

but I get no results (but I know that I should get a result - that's my home
folder!) and I've tried the same thing as an ADSI search in VBScript and
also get no results.

I also tried Joe's ADFind:

AdFind.exe -b dc=cnwl,dc=ac,dc=uk -f
"homedirectory=\\tconwl11\home\1973"

AdFind V01.29.00cpp Joe Richards ([EMAIL PROTECTED]) December 2005

Using server: tconwl4.cnwl.ac.uk:389
Directory: Windows 2000


0 Objects returned

Steve
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to