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

TeamsUserPolicyAssignment - Exported in wrong formatting. #5654

Open
subhashvinjamuri opened this issue Jan 21, 2025 · 3 comments
Open

TeamsUserPolicyAssignment - Exported in wrong formatting. #5654

subhashvinjamuri opened this issue Jan 21, 2025 · 3 comments

Comments

@subhashvinjamuri
Copy link

Description of the issue

I tried to export 'TeamsUserPolicyAssignment' using certificate thumbprint authentication. But the out export is not in the same format as given examples in the documentation. Is there any bug in export formatting ? in each configuration item, it is pasting all policies list.
Command ran :
Export-M365DSCConfiguration -ApplicationId xxxxx -CertificateThumbprint xxxxxx -TenantId 'xxxxxx.onmicrosoft.com' -GenerateInfo $true -Components @("TeamsUserPolicyAssignment") -Path c:\temp -FileName 'M365TenantConfig.ps1' -ConfigurationName 'TeamsUPA'**_

Exported output :

TeamsUserPolicyAssignment "TeamsUserPolicyAssignment-M365 Copilot App PolicyM365 Copilot - App UploadTeams Meeting Recording - ONEnable - Chat OnTeamsPublicPreviewUpgradeToTeams$ConfigurationData.NonNodeData.ApplicationId$ConfigurationData.NonNodeData.TenantId$ConfigurationData.NonNodeData.CertificateThumbprint"
{
ApplicationId = $ConfigurationData.NonNodeData.ApplicationId;
CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
TeamsAppPermissionPolicy = "M365 Copilot App Policy";
TeamsAppSetupPolicy = "M365 Copilot - App Upload";
TeamsMeetingPolicy = "Teams Meeting Recording - ON";
TeamsMessagingPolicy = "Enable - Chat On";
TeamsUpdateManagementPolicy = "TeamsPublicPreview";
TeamsUpgradePolicy = "UpgradeToTeams";
TenantId = $OrganizationName;
User = "";
}

Expected output : examples in https://microsoft365dsc.com/resources/teams/TeamsUserPolicyAssignment/#teamsuserpolicyassignment ,

Microsoft 365 DSC Version

1.24.417.1

Which workloads are affected

Teams

The DSC configuration

Export-M365DSCConfiguration -ApplicationId xxxxx -CertificateThumbprint xxxxxx -TenantId 'xxxxxx.onmicrosoft.com' -GenerateInfo $true -Components @("TeamsUserPolicyAssignment") -Path c:\temp  -FileName 'M365TenantConfig.ps1' -ConfigurationName 'TeamsUPA'**_

Verbose logs showing the problem

Environment Information + PowerShell Version

OsName               : Microsoft Windows Server 2019 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Key   : PSVersion
Value : 5.1.17763.6640
Name  : PSVersion

Key   : PSEdition
Value : Desktop
Name  : PSEdition

Key   : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0...}
Name  : PSCompatibleVersions

Key   : BuildVersion
Value : 10.0.17763.6640
Name  : BuildVersion

Key   : CLRVersion
Value : 4.0.30319.42000
Name  : CLRVersion

Key   : WSManStackVersion
Value : 3.0
Name  : WSManStackVersion

Key   : PSRemotingProtocolVersion
Value : 2.3
Name  : PSRemotingProtocolVersion

Key   : SerializationVersion
Value : 1.1.0.1
Name  : SerializationVersion
@subhashvinjamuri
Copy link
Author

seems got removed after submission . Here is the actual output i got.

TeamsUserPolicyAssignment "[email protected] Copilot App PolicyM365 Copilot - App UploadTeams Meeting Recording - ONEnable - Chat OnTeamsPublicPreviewUpgradeToTeams$ConfigurationData.NonNodeData.ApplicationId$ConfigurationData.NonNodeData.TenantId$ConfigurationData.NonNodeData.CertificateThumbprint"
{
ApplicationId = $ConfigurationData.NonNodeData.ApplicationId;
CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
TeamsAppPermissionPolicy = "M365 Copilot App Policy";
TeamsAppSetupPolicy = "M365 Copilot - App Upload";
TeamsMeetingPolicy = "Teams Meeting Recording - ON";
TeamsMessagingPolicy = "Enable - Chat On";
TeamsUpdateManagementPolicy = "TeamsPublicPreview";
TeamsUpgradePolicy = "UpgradeToTeams";
TenantId = $OrganizationName;
User = "[email protected]";
}

@subhashvinjamuri
Copy link
Author

same formatting issue for - 'TeamsGroupPolicyAssignment' too. Also 'TeamsGroupPolicyAssignment' does not export App permission policies

@FabienTschanz
Copy link
Contributor

Did you already try with the latest version 1.25.115.1 of Microsoft365DSC? 1.24.417.1 is pretty old. For me, it looks like the following:

# Generated with Microsoft365DSC version 1.25.115.1
# For additional information on how to use Microsoft365DSC, please visit https://aka.ms/M365DSC
param (
)

Configuration M365TenantConfig
{
    param (
    )

    $OrganizationName = $ConfigurationData.NonNodeData.OrganizationName

    Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.25.115.1'

    Node localhost
    {
        TeamsUserPolicyAssignment "[email protected]"
        {
            ApplicationId                   = $ConfigurationData.NonNodeData.ApplicationId;
            CallingLineIdentity             = "Global";
            CertificateThumbprint           = $ConfigurationData.NonNodeData.CertificateThumbprint;
            ExternalAccessPolicy            = "Global";
            OnlineVoicemailPolicy           = "Global";
            OnlineVoiceRoutingPolicy        = "Global";
            TeamsAppPermissionPolicy        = "Global";
            TeamsAppSetupPolicy             = "Global";
            TeamsAudioConferencingPolicy    = "Global";
            TeamsCallHoldPolicy             = "Global";
            TeamsCallingPolicy              = "Global";
            TeamsCallParkPolicy             = "Global";
            TeamsChannelsPolicy             = "Global";
            TeamsEmergencyCallingPolicy     = "Global";
            TeamsEmergencyCallRoutingPolicy = "Global";
            TeamsEnhancedEncryptionPolicy   = "Global";
            TeamsEventsPolicy               = "Global";
            TeamsMeetingBroadcastPolicy     = "Global";
            TeamsMeetingPolicy              = "Global";
            TeamsMessagingPolicy            = "Global";
            TeamsMobilityPolicy             = "Global";
            TeamsUpdateManagementPolicy     = "Global";
            TeamsUpgradePolicy              = "UpgradeToTeams";
            TenantDialPlan                  = "Global";
            TenantId                        = $OrganizationName;
            User                            = "[email protected]";
        }
    }
}

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