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

Start-DSCConfiguration not inputting TeamsAppPermissionPolicy - no error seen #3373

Closed
meklulose opened this issue Jun 8, 2023 · 2 comments · Fixed by #3380 or #3386
Closed

Start-DSCConfiguration not inputting TeamsAppPermissionPolicy - no error seen #3373

meklulose opened this issue Jun 8, 2023 · 2 comments · Fixed by #3380 or #3386
Labels
Bug Something isn't working Teams

Comments

@meklulose
Copy link

meklulose commented Jun 8, 2023

I can successfully import the following configuration

param (
    [parameter()]
    [System.Management.Automation.PSCredential]
    $Credential
)

Configuration M365TenantConfig
{
    param (
        [parameter()]
        [System.Management.Automation.PSCredential]
        $Credential
    )

    if ($null -eq $Credential)
    {
        <# Credentials #>
        $Credscredential = Get-Credential -Message "Credentials"

    }
    else
    {
        $CredsCredential = $Credential
    }

    $OrganizationName = $CredsCredential.UserName.Split('@')[1]

    Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.23.517.1'

    Node localhost
    {

       TeamsAppPermissionPolicy "TeamsAppPermissionPolicy-Test-Policy"
        {
            Credential             = $Credscredential;
            DefaultCatalogApps     = "com.microsoft.teamspace.tab.vsts";
            DefaultCatalogAppsType = "AllowedAppList";
            Description            = "This is a test policy";
            Ensure                 = "Present";
            GlobalCatalogAppsType  = "BlockedAppList";
            Identity               = "TestPolicy";
            PrivateCatalogAppsType = "BlockedAppList";
        }
    }
}

M365TenantConfig -ConfigurationData .\ConfigurationData.psd1 -Credential $Credential

But when I try to apply the below configuration no new policy is created and I do not see any errors:

param (
    [parameter()]
    [System.Management.Automation.PSCredential]
    $Credential
)

Configuration M365TenantConfig
{
    param (
        [parameter()]
        [System.Management.Automation.PSCredential]
        $Credential
    )

    if ($null -eq $Credential)
    {
        <# Credentials #>
        $Credscredential = Get-Credential -Message "Credentials"

    }
    else
    {
        $CredsCredential = $Credential
    }

    $OrganizationName = $CredsCredential.UserName.Split('@')[1]

    Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.23.517.1'

    Node localhost
    {

       TeamsAppPermissionPolicy "TeamsAppPermissionPolicy-Test Policy - App release"
        {
            Credential             = $Credscredential;
            DefaultCatalogApps     = @("0d820ecd-def2-4297-adad-78056cde7c78","1c4340de-2a85-40e5-8eb0-4f295368978b","26bc2873-6023-480c-a11b-76b66605ce8c","2a527703-1f6f-4559-a332-d8a7d288cd88","2e29398f-1131-4d94-b79f-9c7aa1cfb672","4c4ec2e8-4a2c-4bce-8d8f-00fc664a4e5b","57e078b5-6c0e-44a1-a83f-45f75b030d4a","7299542a-1697-4ec1-812b-6b70065c0795","81fef3a6-72aa-4648-a763-de824aeafb7d","a6b63365-31a4-4f43-92ec-710b71557af9","b4f7d39f-ddc7-4f7e-b320-4344444c5e0e","c3a1996d-db0f-4857-a6ea-7aabf0266b00","cd2d8695-bdc9-4d8e-9620-cc963ed81f41","com.microsoft.teamspace.tab.planner","com.microsoft.teamspace.tab.vsts","com.microsoft.teamspace.tab.web","d5c805b6-2882-45d3-8657-c4f27520f184","d832a33f-28c2-4969-8ad0-4fee681dc5b4","db5e5970-212f-477f-a3fc-2227dc7782bf","f101079c-3162-4ebe-a651-eba617b4be69","fc057f53-bb6b-4868-9eb8-a93a8a361b71","73d49226-b5c0-42f0-b918-acd20e8a22d8");
            DefaultCatalogAppsType = "AllowedAppList";
            Ensure                 = "Present";
            GlobalCatalogApps      = @("203a1e2c-26cc-47ca-83ae-be98f960b6b2","f4d81e8e-4500-44c2-8328-9e06cbe037c5","fc6b6d20-89ed-45fb-9e62-e4b4ca8fbf3f");
            GlobalCatalogAppsType  = "AllowedAppList";
            Identity               = "Test Policy - App release";
            PrivateCatalogAppsType = "BlockedAppList";
        }
    }
}

M365TenantConfig -ConfigurationData .\ConfigurationData.psd1 -Credential $Credential

The following is the output I see in Powershell ISE:

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigura
tionManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer PS25477 with user sid S-1-5-21-711866018-943390210-2349124967-44682.
VERBOSE: [PS25477]: LCM:  [ Start  Set      ]
VERBOSE: [PS25477]: LCM:  [ Start  Resource ]  [[TeamsAppPermissionPolicy]TeamsAppPermissionPolicy-Test Policy - App release]
VERBOSE: [PS25477]: LCM:  [ Start  Test     ]  [[TeamsAppPermissionPolicy]TeamsAppPermissionPolicy-Test Policy - App release]
VERBOSE: [PS25477]:                            [[TeamsAppPermissionPolicy]TeamsAppPermissionPolicy-Test Policy - App release] Testing configuration 
of {Test Policy - App release}
VERBOSE: [PS25477]:                            [[TeamsAppPermissionPolicy]TeamsAppPermissionPolicy-Test Policy - App release] Test-TargetResource re
turned False
VERBOSE: [PS25477]: LCM:  [ End    Test     ]  [[TeamsAppPermissionPolicy]TeamsAppPermissionPolicy-Test Policy - App release]  in 14.8700 seconds.
VERBOSE: [PS25477]: LCM:  [ Start  Set      ]  [[TeamsAppPermissionPolicy]TeamsAppPermissionPolicy-Test Policy - App release]
VERBOSE: [PS25477]:                            [[TeamsAppPermissionPolicy]TeamsAppPermissionPolicy-Test Policy - App release] Creating {Test Policy 
- App release} with Parameters:
DefaultCatalogApps=(0d820ecd-def2-4297-adad-78056cde7c78,1c4340de-2a85-40e5-8eb0-4f295368978b,26bc2873-6023-480c-a11b-76b66605ce8c,2a527703-1f6f-455
9-a332-d8a7d288cd88,2e29398f-1131-4d94-b79f-9c7aa1cfb672,4c4ec2e8-4a2c-4bce-8d8f-00fc664a4e5b,57e078b5-6c0e-44a1-a83f-45f75b030d4a,7299542a-1697-4ec
1-812b-6b70065c0795,81fef3a6-72aa-4648-a763-de824aeafb7d,a6b63365-31a4-4f43-92ec-710b71557af9,b4f7d39f-ddc7-4f7e-b320-4344444c5e0e,c3a1996d-db0f-485
7-a6ea-7aabf0266b00,cd2d8695-bdc9-4d8e-9620-cc963ed81f41,com.microsoft.teamspace.tab.planner,com.microsoft.teamspace.tab.vsts,com.microsoft.teamspac
e.tab.web,d5c805b6-2882-45d3-8657-c4f27520f184,d832a33f-28c2-4969-8ad0-4fee681dc5b4,db5e5970-212f-477f-a3fc-2227dc7782bf,f101079c-3162-4ebe-a651-eba
617b4be69,fc057f53-bb6b-4868-9eb8-a93a8a361b71,73d49226-b5c0-42f0-b918-acd20e8a22d8)
DefaultCatalogAppsType=AllowedAppList
GlobalCatalogApps=(203a1e2c-26cc-47ca-83ae-be98f960b6b2,f4d81e8e-4500-44c2-8328-9e06cbe037c5,fc6b6d20-89ed-45fb-9e62-e4b4ca8fbf3f)
GlobalCatalogAppsType=AllowedAppList
Identity=Test Policy - App release
PrivateCatalogAppsType=BlockedAppList
VERBOSE: [PS25477]: LCM:  [ End    Set      ]  [[TeamsAppPermissionPolicy]TeamsAppPermissionPolicy-Test Policy - App release]  in 1.4900 seconds.
VERBOSE: [PS25477]: LCM:  [ End    Resource ]  [[TeamsAppPermissionPolicy]TeamsAppPermissionPolicy-Test Policy - App release]
WARNING: Falling back to the previous MOD file or system defaults because the meta configuration mof does not exist or has either been corrupted or 
an invalid mof property has been set.
VERBOSE: [PS25477]: LCM:  [ End    Set      ]
VERBOSE: [PS25477]: LCM:  [ End    Set      ]    in  16.7920 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 16.874 second

Why am not able to import the second config?

@NikCharlebois NikCharlebois added Bug Something isn't working Teams labels Jun 9, 2023
@NikCharlebois
Copy link
Collaborator

NikCharlebois commented Jun 9, 2023

We are investigating this issue with the Product Group. Essentially, running the following command doesn't throw any errors but doesn't create any policies either:

$params = @{
    DefaultCatalogApps=[Microsoft.Teams.Policy.Administration.Cmdlets.Core.DefaultCatalogApp]::New('0d820ecd-def2-4297-adad-78056cde7c78')
    DefaultCatalogAppsType='AllowedAppList'
    GlobalCatalogApps=[Microsoft.Teams.Policy.Administration.Cmdlets.Core.GlobalCatalogApp]::New('203a1e2c-26cc-47ca-83ae-be98f960b6b2')
    GlobalCatalogAppsType='AllowedAppList'
    Identity='TestPolicyNik'
    PrivateCatalogAppsType='BlockedAppList'
}
New-CsTeamsAppPermissionPolicy @params

NikCharlebois added a commit to NikCharlebois/Microsoft365DSC that referenced this issue Jun 12, 2023
@long199941hp
Copy link

I got the same issues with conditional access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Teams
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants