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

TeamsMeetingPolicy: Export fails on first policy #5405

Open
TorbenA opened this issue Nov 14, 2024 · 1 comment
Open

TeamsMeetingPolicy: Export fails on first policy #5405

TorbenA opened this issue Nov 14, 2024 · 1 comment

Comments

@TorbenA
Copy link

TorbenA commented Nov 14, 2024

Description of the issue

When trying to export the TeamsMeetingPolicy the export fails on the first policy (Global) the export fails with the Exception "You cannot call a method on a null-valued expression."

I suppose the issue lies within MSFT_TeamsMeetingPolicy.psm1 on line 475. There the Tenant information is missing in the return block.

MSFT_TeamsMeetingPolicy.psm1 Line 470-476:

(...)
            StreamingAttendeeMode                      = $policy.StreamingAttendeeMode
            VideoFiltersMode                           = $policy.VideoFiltersMode
            VoiceIsolation                             = $policy.VoiceIsolation
            TeamsCameraFarEndPTZMode                   = $policy.TeamsCameraFarEndPTZMode
            WhoCanRegister                             = $policy.WhoCanRegister
            Ensure                                     = 'Present'
        }
    }

Compared with e.g. MSFT_TeamsMessagingPolicy.psm1 Line 206-217:

(...)
                Description                                  = $policy.Description
                Tenant                                       = $policy.Tenant
                Ensure                                       = 'Present'
                Credential                                   = $Credential
                ApplicationId                                = $ApplicationId
                TenantId                                     = $TenantId
                CertificateThumbprint                        = $CertificateThumbprint
                ManagedIdentity                              = $ManagedIdentity.IsPresent
                AccessTokens                                 = $AccessTokens
            }
        }
    }

Microsoft 365 DSC Version

1.24.1113.1

Which workloads are affected

Teams

The DSC configuration

Export-M365DSCConfiguration -Components ("TeamsMeetingPolicy") -Path ".\temp" -ApplicationId $ApplicationId -TenantId $TenantID -CertificateThumbprint $CertThumbprint

Verbose logs showing the problem

{InvalidOperation}
System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at Get-M365DSCExportContentForResource(Closure , FunctionContext )
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
   at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
   at System.Management.Automation.CommandProcessorBase.Complete()
"Error during Export:"
at Get-M365DSCExportContentForResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1113.1\Modules\M365DSCUtil.psm1: line 3914
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1113.1\DSCResources\MSFT_TeamsMeetingPolicy\MSFT_TeamsMeetingPolicy.psm1: line 1427
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1113.1\Modules\M365DSCReverse.psm1: line 682
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1113.1\Modules\M365DSCUtil.psm1: line 1460
at <ScriptBlock>, <RedactedForPrivacy>\Get-CurrentTenantConfig.ps1: line 22
at <ScriptBlock>, <No file>: line 1

Environment Information + PowerShell Version

OsName               : Microsoft Windows Server 2022 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Name                           Value
----                           -----
PSVersion                      5.1.20348.2760
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.2760
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
@TorbenA
Copy link
Author

TorbenA commented Nov 14, 2024

Forgot to mention:
Adding the follwing lines to MSFT_TeamsMeetingPolicy.psm1 line 476 fixes the issue:

            Credential                                   = $Credential
            ApplicationId                                = $ApplicationId
            TenantId                                     = $TenantId
            CertificateThumbprint                        = $CertificateThumbprint
            ManagedIdentity                              = $ManagedIdentity.IsPresent
            AccessTokens                                 = $AccessTokens

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

1 participant