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

Export-M365DSCConfiguration for Teams having Read.All permission is not generating configuration information #3704

Closed
Infy-Ayusi opened this issue Sep 20, 2023 · 12 comments

Comments

@Infy-Ayusi
Copy link

Infy-Ayusi commented Sep 20, 2023

Checked required permission for Teams for some of the policies using command

Get-M365DSCCompiledPermissionList -ResourceNameList @('TeamsCallingPolicy','TeamsClientConfiguration','TeamsEmergencyCallingPolicy','TeamsGuestCallingConfiguration','TeamsGuestMeetingConfiguration','TeamsGuestMessagingConfiguration','TeamsMeetingBroadcastConfiguration','TeamsMeetingBroadcastPolicy','TeamsMeetingConfiguration','TeamsMeetingPolicy','TeamsMessagingPolicy','TeamsUpgradeConfiguration') -PermissionType 'Application' -AccessType 'Read'

Generates below ReadWrite.All and Delete,All permissions along with Organization.Read.All and User.Read.All

Group.ReadWrite.All
AppCatalog.ReadWrite.All
TeamSettings.ReadWrite.All
Channel.Delete.All
ChannelSettings.ReadWrite.All
ChannelMember.ReadWrite.All

I don't intend to modify any of the configuration settings. Why ReadWrite.All and Delete.All permissions required only for executing Export-M365DSCConfiguration for Teams?

@andikrueger
Copy link
Collaborator

What version of M365DSC are you using? This issue was already reported in #3404 and got closed with #3636.

@Infy-Ayusi
Copy link
Author

I am using version 1.23.809.1

@andikrueger
Copy link
Collaborator

Would you mind updating to the latest release? This should fix the issue

@Infy-Ayusi
Copy link
Author

Would you mind updating to the latest release? This should fix the issue

Hello,
I have updated Microsoft36DSC to the latest version 1.23.920.2 but looks like the issue is still not resolved for Teams -

Exporting Microsoft 365 configuration for Components: TeamsCallingPolicy, TeamsClientConfiguration, TeamsEmergencyCallingPolicy, TeamsGuestCallingConfiguration, TeamsGuestMeetingConfiguration, TeamsGuestMessagingConfiguration, TeamsMeetingBroadcastConfiguration, TeamsMeetingBroadcastPolicy, TeamsMeetingConfiguration, TeamsMeetingPolicy, TeamsMessagingPolicy, TeamsUpgradeConfiguration {"code":"Forbidden","message":"Access Denied.","action":"Provide different credential or request access."}

Below are the permissions that my Azure AD app has -

Microsoft Graph Application Application.Read.All
Microsoft Graph Application DeviceManagementApps.Read.All
Microsoft Graph Application DeviceManagementConfiguration.Read.All
Microsoft Graph Application DeviceManagementManagedDevices.Read.All
Microsoft Graph Application DeviceManagementServiceConfig.Read.All
Microsoft Graph Application Directory.Read.All
Microsoft Graph Application Domain.Read.All
Microsoft Graph Application Group.Read.All
Microsoft Graph Application Policy.Read.All
Microsoft Graph Application User.Read.All
Microsoft Graph Application Organization.Read.All
Microsoft Graph Application AppCatalog.Read.All
Microsoft Graph Application TeamSettings.Read.All
Microsoft Graph Application ChannelSettings.Read.All
Microsoft Graph Application ChannelMember.Read.All
Microsoft Graph Application Policy.Read.All

@andikrueger
Copy link
Collaborator

Did you reset the permissions (removed the old and set the new ones) or are you re-using the previous app registration?

@Infy-Ayusi
Copy link
Author

I already had these READ permissions added on the Azure AD App. No new additions/removal of permission done on the App.

@andikrueger
Copy link
Collaborator

AFAIK The cmdLet will not remove permissions. @NikCharlebois Is this even doable?

@DennisLangenberg
Copy link

Having a similar issue where all permissions are inline with compiled permission list correct. Export success on only Teams, Users and Channels. All Policies and Settings are failing to export. On the latest version currently investigating further.

@andikrueger
Copy link
Collaborator

There is a known issue with Teams PowerShell which is different and affects only TeamsOrgWideAppSettings: #3394 Either there was a change to the bad or this is something new.

@andikrueger andikrueger added Teams V1.23.809.1 Version 1.23.809.1 labels Oct 6, 2023
@DennisLangenberg
Copy link

DennisLangenberg commented Oct 6, 2023

Update on my case, created a full new AppRegistration exactly the same API permissions as my DEV tenant (where it worked). Was still not working did a further look and in my Dev-Tenant i also gave the same Appregistration the Exchange Role.

For testing purposes i gave the new test-Appregistration the Teams-Admin role and now it works. The additional role apparently adds some extra permissions in the forms of a role is needed.

@andikrueger
Copy link
Collaborator

@DennisLangenberg Thank you for the feedback. This would align with the documentation: https://learn.microsoft.com/en-us/microsoftteams/teams-powershell-application-authentication#setup-application-based-authentication

  1. Assign Azure AD roles to the application. Refer to this Assign a role procedure, but search for the application instead of a user.

We should add this to our documentation and check with the teams team, what roles are needed.

//cc @NikCharlebois

@FabienTschanz
Copy link
Collaborator

The Teams Administrator role is listed on the Teams resources. Closing this issue.

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

No branches or pull requests

4 participants