Click here to Skip to main content
15,888,263 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I am trying to get few users from Azure ADFS within my domain. I am able to get all of my users from my integrated Office 365. But my requirement is to get the filtered user lists. Can we do something like below, I have tried. But it doesn't return anything even if I have few users with that.

C#
ActiveDirectoryClient activeDirectoryClient = new ActiveDirectoryClient(serviceRoot,
                     async () => await GetTokenForApplication());


               var result0 = await activeDirectoryClient.Users
                .Where(u => u.GivenName.Contains("sibeesh"))
                .ExecuteAsync();

               var result1 = await activeDirectoryClient.Users
                 .Where(u => SqlMethods.Like(u.DisplayName, "sib%"))
                 .ExecuteAsync();



And also how can we get the users from other domains which we have in our ADFS? How can we group those users accordingly. I am totally new to configuring ADFS, any help is much appreciated. Thanks in advance.

What I have tried:

As I have already explained in the question I have tried as follows.

C#
ActiveDirectoryClient activeDirectoryClient = new ActiveDirectoryClient(serviceRoot,
                      async () => await GetTokenForApplication());

               
                var result0 = await activeDirectoryClient.Users
                 .Where(u => u.GivenName.Contains("sibeesh"))
                 .ExecuteAsync();

                var result1 = await activeDirectoryClient.Users
                  .Where(u => SqlMethods.Like(u.DisplayName, "sib%"))
                  .ExecuteAsync();
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900