Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App registration requires group read / write permission even when not using "-AddGroup" #26

Closed
darkorion6661 opened this issue Feb 18, 2025 · 2 comments

Comments

@darkorion6661
Copy link

Hi Andrew,

One thing with the get-windowsautopilotinfo and your community fork is that the app registration I have currently doesn't suffice because the script tries to connect to graph with "Group.ReadWrite.All" access even without the "-AddGroup" parameter.

I note in the script that the "Connect-ToGraph" calls the same scopes regardless of the parameter passed.

    # Connect
    if ($AppId -ne "") {
        Connect-ToGraph -AppId $AppId -AppSecret $AppSecret -Tenant $TenantId
    }
    else {
        $graph = Connect-ToGraph -scopes "Group.ReadWrite.All, Device.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, DeviceManagementServiceConfig.ReadWrite.All, GroupMember.ReadWrite.All"
        Write-Host "Connected to Intune tenant $($graph.TenantId)"
        if ($AddToGroup) {
            $aadId = Connect-ToGraph -scopes "Group.ReadWrite.All, Device.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, DeviceManagementServiceConfig.ReadWrite.All, GroupMember.ReadWrite.All"
            Write-Host "Connected to Azure AD tenant $($aadId.TenantId)"
        }
    }

Would it be at all possible to only use the "Group.ReadWrite.All, GroupMember.ReadWrite.All" if $AddToGroup is true?

@andrew-s-taylor
Copy link
Owner

I can't see that causing any issues, have updated it in 5.0.3 which is online now

@darkorion6661
Copy link
Author

darkorion6661 commented Feb 18, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants