You are close.
dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(homeDirectory=\5c\5cmyserver))" -attr sAMAccountName homeDirectory > c:\temp\scripts\adinfo\hdprofile.txt Notice that I removed an extra slash you had in there. I tested this, it works. Note that you PROBABLY want a "*" after myserver. You shouldn't be able to specify a servername without a share as a home directory. From: MarvinC [mailto:[email protected]] Sent: Wednesday, February 25, 2009 9:17 AM To: NT System Admin Issues Subject: Re: A simple yet...not so simple ?? Tried that with this and still no luck: dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(homedirectory=\5c\5c\myserver$) )" -attr sAMAccountName homeDirectory > c:\temp\scripts\adinfo\hdprofile.csv and with this: dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(homeDirectory=\5c\5c\myserver)) " -attr sAMAccountName homeDirectory > c:\temp\scripts\adinfo\hdprofile.txt and with this: dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(homeDirectory=\directorypath))" -attr sAMAccountName homeDirectory > c:\temp\hdir.csv What am I missing? On Tue, Feb 24, 2009 at 10:10 PM, KenM <[email protected]> wrote: try (homedirectory=\5c\5cdirectorypath) On Tue, Feb 24, 2009 at 9:48 PM, MarvinC <[email protected]> wrote: 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/> ~
