Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 08, 2012 01:30 AM by Angie xu - MSFT
0 Points
1 Post
Nov 01, 2012 11:03 AM|LINK
Hello, I tried to get all users whose property "memberOf" was changed, but failed.
My code doesn't return me a users if only membership in some group was deleted, for example.
Here is my code:
SearchRequest request = new SearchRequest(ConfigurationProvider.QueryPath, "(&(objectCategory=person)(objectClass=user))", System.DirectoryServices.Protocols.SearchScope.Subtree, null); request.Attributes.Add("userprincipalname"); request.Attributes.Add("mail"); request.Attributes.Add("displayName"); request.Attributes.Add("givenName"); request.Attributes.Add("sn"); request.Attributes.Add("homephone"); request.Attributes.Add("manager"); request.Attributes.Add("mobile"); request.Attributes.Add("title"); request.Attributes.Add("facsimiletelephonenumber"); request.Attributes.Add("department"); request.Attributes.Add("countryCode"); request.Attributes.Add("C"); request.Attributes.Add("co"); request.Attributes.Add("preferredlanguage"); request.Attributes.Add("passwordneverexpires"); request.Attributes.Add("userflags"); request.Attributes.Add("userAccountControl"); request.Attributes.Add("memberOf"); DirSyncRequestControl dirSyncRC = new DirSyncRequestControl(token, System.DirectoryServices.Protocols.DirectorySynchronizationOptions.None, Int32.MaxValue); request.Controls.Add(dirSyncRC);
What I've missed?
All-Star
18457 Points
1564 Posts
Microsoft
Nov 08, 2012 01:30 AM|LINK
Hi Ninja
You could refer the method taken in this case that how to query changes in Active Directory including deleted objects.
Moreover, please check this to learn DirSyncRequestControl Class.
hope it helpful to you.
Regards
Ninja2
0 Points
1 Post
How to get changes of the user's memberOf with DirSyncRequestControl
Nov 01, 2012 11:03 AM|LINK
Hello, I tried to get all users whose property "memberOf" was changed, but failed.
My code doesn't return me a users if only membership in some group was deleted, for example.
Here is my code:
SearchRequest request = new SearchRequest(ConfigurationProvider.QueryPath, "(&(objectCategory=person)(objectClass=user))", System.DirectoryServices.Protocols.SearchScope.Subtree, null); request.Attributes.Add("userprincipalname"); request.Attributes.Add("mail"); request.Attributes.Add("displayName"); request.Attributes.Add("givenName"); request.Attributes.Add("sn"); request.Attributes.Add("homephone"); request.Attributes.Add("manager"); request.Attributes.Add("mobile"); request.Attributes.Add("title"); request.Attributes.Add("facsimiletelephonenumber"); request.Attributes.Add("department"); request.Attributes.Add("countryCode"); request.Attributes.Add("C"); request.Attributes.Add("co"); request.Attributes.Add("preferredlanguage"); request.Attributes.Add("passwordneverexpires"); request.Attributes.Add("userflags"); request.Attributes.Add("userAccountControl"); request.Attributes.Add("memberOf"); DirSyncRequestControl dirSyncRC = new DirSyncRequestControl(token, System.DirectoryServices.Protocols.DirectorySynchronizationOptions.None, Int32.MaxValue); request.Controls.Add(dirSyncRC);What I've missed?
Angie xu - M...
All-Star
18457 Points
1564 Posts
Microsoft
Re: How to get changes of the user's memberOf with DirSyncRequestControl
Nov 08, 2012 01:30 AM|LINK
Hi Ninja
You could refer the method taken in this case that how to query changes in Active Directory including deleted objects.
Moreover, please check this to learn DirSyncRequestControl Class.
hope it helpful to you.
Regards
Feedback to us
Develop and promote your apps in Windows Store