简体   繁体   中英

How to retrieve AAD User Settings/Device settings values using c# / powershell?

I'm working on a task to report on information in an AAD tenant. I've been playing with MSGraph in order to retrieve the information from an AAD tenant. Information such as, user settings, device settings, eg

User Settings: Users can register applications Restrict access to Azure AD administration portal

Device Settings: Users may join devices to Azure AD

But I've been unable to retrieve the information.

Could anyone point me in the right direction? I'm good with acquiring an authentication token, just need to know how to access these fundamental settings in AAD. I'd prefer to be able to do this in c# rather than powershell if at all possible.

If you used the Microsoft Graph dotnet core SDK, it is easy to find user info, like this:

// Get all users (one page)
    var result = await graphClient.Users
        .Request()
        .Select(e => new
        {
            e.DisplayName,
            e.Id,
            e.Identities
        })
        .GetAsync();

This complete sample has a lot of information on it. Start here and then branch out to find the right property to add to the Select() method to retrieve permissions info, then filter the users down to just those with the permission you want.

To help you find this info, try searching for Azure AD Business To Consumer also written as AAD B2C .

For help in setting up the permissions in Azure AD that you need to instantiate a Graph client, see this helpful guide here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM