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

SCRetentionCompliancePolicy returning null-valued expression for Organization Name #3500

Closed
1 of 10 tasks
808d1 opened this issue Jul 25, 2023 · 0 comments · Fixed by #3525 or #3568
Closed
1 of 10 tasks

SCRetentionCompliancePolicy returning null-valued expression for Organization Name #3500

808d1 opened this issue Jul 25, 2023 · 0 comments · Fixed by #3525 or #3568
Labels
Bug Something isn't working Security & Compliance Center V1.23.719.1 Version 1.23.719.1

Comments

@808d1
Copy link

808d1 commented Jul 25, 2023

Description of the issue

Receiving null-valued expression error when exporting SCRetentionCompliancePolicy.

The Get-TargetResource function appears to be missing TenantID in the $result hashtable on line 196. This is causing an error in M365DSCUtil.psm1 on line 3292 when evaluating the $partialContent hashtable.

Microsoft 365 DSC Version

1.23.719.1

Workload

  • Azure Active Directory
  • Exchange Online
  • Office 365 Admin
  • OneDrive for Business
  • Planner
  • Power Platform
  • Security & Compliance Center
  • SharePoint Online
  • Teams
  • other

The DSC configuration

Extracting SCRetenetionCompliancePolicy using CertificateThumbprint
2/12 Exchange email

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:\Users\zef5gap\Documents\WindowsPowerShell\Modules\Microsoft365DSC\1.23.719.1\modules\M365DSCUtil.psm1: line 3290

at Export-TargetResource, C:...\WindowsPowerShell\Modules\Microsoft365DSC\1.23.719.1\DSCResources\MSFT_SCRetentionCompliancePolicy\MSFT_SCRetentionCompliancePolicy.psm1: line 1079

at Start-M365DSCConfigurationExtract, C:...\WindowsPowerShell\Modules\Microsoft365DSC\1.23.719.1\modules\M365DSCReverse.psm1: line 620

at Export-M365DSCConfiguration, C:...\WindowsPowerShell\Modules\Microsoft365DSC\1.23.719.1\modules\M365DSCUtil.psm1: line 1310

at , C:...\GetConfigs-SecComp.ps1: line 21

Environment Information + PowerShell Version

OsName               : Microsoft Windows 10 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage           : en-US
OsMuiLanguages       : {en-US}
 

Key   : PSVersion
Value : 5.1.19041.3031
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.19041.3031
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
@andikrueger andikrueger added V1.23.719.1 Version 1.23.719.1 Bug Something isn't working Security & Compliance Center labels Jul 26, 2023
NikCharlebois added a commit to NikCharlebois/Microsoft365DSC that referenced this issue Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Security & Compliance Center V1.23.719.1 Version 1.23.719.1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants