Question

I have an existing DirectoryEntry connection and I want to check if the user that was used for the creation of this DirectoryEntry belongs to a specific group. anyone knows how to achieve this?

Thanks, Shuky

Was it helpful?

Solution

I don't think there's any magic, easy way to do this....

On the DirectoryEntry object, you do have a UserName property which should hold the name of the user that was used to create this entry, if a specific user was supplied. Using that user name, you could do a directory lookup and find that user and check whether that user belongs to the Administrators group (or any other group) - but it's not exactly a one-liner.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top