Hi All,

Hoping someone might be able to help. I want to use ADModify.NET to change
some users home directory's. However, I'm getting stuck with the search
filter.

I'd like to find all users where their samaccount name starts with "a" and
matches a specific server eg server1

The first part of the query, to find samaccount names starting with a is
fine but it's the homedirectory part I'm stuck on. I would like to find all
users homedirectory where it starts with the path: \\server1

Please take a look at it below:

(&(sAMAccountName=a*)(homeDirectory=\\server1*))

I've added quotes, extra backslahes but it still doesn't seem to work, can
anyone help please?

Thanks!!

RE: LDAP Search Query Syntax by Giles

Giles
Wed Aug 06 07:17:01 PDT 2008

Sorry, ignore that, found this handy link where it describes the special
characters:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;255602


"Giles" wrote:

> Hi All,
>
> Hoping someone might be able to help. I want to use ADModify.NET to change
> some users home directory's. However, I'm getting stuck with the search
> filter.
>
> I'd like to find all users where their samaccount name starts with "a" and
> matches a specific server eg server1
>
> The first part of the query, to find samaccount names starting with a is
> fine but it's the homedirectory part I'm stuck on. I would like to find all
> users homedirectory where it starts with the path: \\server1
>
> Please take a look at it below:
>
> (&(sAMAccountName=a*)(homeDirectory=\\server1*))
>
> I've added quotes, extra backslahes but it still doesn't seem to work, can
> anyone help please?
>
> Thanks!!