BlueChippy
2008-10-31 10:49:01 UTC
Apologies for cross-posting here as it's a C# question, however someone might
have a solution. A lot of our Active Directory groups have been set up with
an asterisk at the start (I have no idea why!).
This is giving me a huge headache trying to retreive the members of these
groups. I can't use "*groupname" because this uses the * as a wildcard to
find every group!
_______________
I am trying to find the members of an Active Dir group in code, but
unfortunately the name of the group contains "*". I have no problem
returning members of any other groups we have.
I have tried:
searcher.Filter = "(CN=*Chester Ground Floor)"
searcher.Filter = "(CN=\x2AChester Ground Floor)"
searcher.Filter = "(CN=\2AChester Ground Floor)"
searcher.Filter = "(CN~=Chester Ground Floor)"
The first option times out because it finds ALL groups.
Second returns null
Third says "invalid escape sequence" and won't compile
Last one returns null
I know the group name is correct because I can return it in a list of all my
groups.
I have also tried fully qualifying the filter (OU=) etc.
Any advice gratefully received.
Dave.
have a solution. A lot of our Active Directory groups have been set up with
an asterisk at the start (I have no idea why!).
This is giving me a huge headache trying to retreive the members of these
groups. I can't use "*groupname" because this uses the * as a wildcard to
find every group!
_______________
I am trying to find the members of an Active Dir group in code, but
unfortunately the name of the group contains "*". I have no problem
returning members of any other groups we have.
I have tried:
searcher.Filter = "(CN=*Chester Ground Floor)"
searcher.Filter = "(CN=\x2AChester Ground Floor)"
searcher.Filter = "(CN=\2AChester Ground Floor)"
searcher.Filter = "(CN~=Chester Ground Floor)"
The first option times out because it finds ALL groups.
Second returns null
Third says "invalid escape sequence" and won't compile
Last one returns null
I know the group name is correct because I can return it in a list of all my
groups.
I have also tried fully qualifying the filter (OU=) etc.
Any advice gratefully received.
Dave.