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

Unable to generate HTML report from PlannerTask #5775

Open
WillBuck99 opened this issue Feb 14, 2025 · 13 comments
Open

Unable to generate HTML report from PlannerTask #5775

WillBuck99 opened this issue Feb 14, 2025 · 13 comments

Comments

@WillBuck99
Copy link

Description of the issue

When I try to generate a report from the exported configuration of PlannerTasks, the report generation fails. I have looked at the generated ps1 file and the quotes are all over the place, all pointing towards the Notes section for each PlannerTask. It is registering any instances of characters or phrases which could be interpreted as a powershell command. I have tried filtering out those characters but issue remains.

Microsoft 365 DSC Version

V1.25.212.1

Which workloads are affected

Planner

The DSC configuration

Verbose logs showing the problem

New-M365DSCReportFromConfiguration -Type HTML -ConfigurationPath "C:\Temp\DSC\Planner\10-02-2025\M365TenantConfig.ps1" -OutputPath "$savePath\PlannerReport.html" -Verbose

VERBOSE: Loading file 'C:\Temp\DSC\Planner\10-02-2025\M365TenantConfig.ps1'
Error parsing configuration: At line:251 char:272
+ ... ``& file it in the yellow paper folder which says "reciepts" on it.";
+                                                        ~~~~~~~~~~~~~~~~~
Unexpected token 'reciepts" on it."' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\DSCParser\2.0.0.15\Modules\DSCParser.psm1:472 char:9
+         throw "$($errorPrefix)Error parsing configuration: $parseErro ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Error parsing c...n or statement.:String) [], RuntimeException
    + FullyQualifiedErrorId : Error parsing configuration: At line:251 char:272
+ ... ``& file it in the yellow paper folder which says "reciepts" on it.";
+                                                        ~~~~~~~~~~~~~~~~~
Unexpected token 'reciepts" on it."' in expression or statement.

Environment Information + PowerShell Version

OsName               : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Key   : PSVersion
Value : 5.1.22621.4391
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.22621.4391
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
@FabienTschanz
Copy link
Collaborator

@WillBuck99 This will probably be fixed by #5767. We currently have an issue that the export misses escaping a couple of quotes.

@Vorland
Copy link

Vorland commented Feb 17, 2025

I have similar issue. For a particular tenant I was facing a lot of issues, because organization uses many 'bad' characters in various places. For example, Lithuanian symbols in group/policy names like "ĄČĘĖĮŠŲŪŽ", also there are a lot of groups with names containing ", ', etc. symbols. I understand that this is not the best idea, but this is customer's tenant, and we can't change all the names.
I can imagine, how difficult it is to write a PowerShell code to address all these specifics. After many retries, I was able to generate the configuration file, but now I can't create a report from a configuration, all the types are not working.

Image

I would be more than happy to help with demonstration or providing any additional information.

Thank you for an amazing tool you're developing!

@FabienTschanz @WillBuck99

@WillBuck99
Copy link
Author

Thank you @FabienTschanz for the quick response. I'll keep my eye out for the release. Other than that the tool has been extremely useful to us, so thank you for your work on it.

@Vorland - That looks like pretty much the exact issue I've been facing. Attempted some parsing to remove the chunks that were causing it, but with how much data is in the report it wasn't feasable. For me, it only seems to be on this particular PlannerTask report that's causing issues, so for now I'm just not running the PlannerTask component but I can see how it could be affecting people who have different languages in their environment for naming conventions at a much larger scale than just one component.

@FabienTschanz
Copy link
Collaborator

@Vorland Would you be so kind and provide a minimal sample of the configuration that's failing? Then I can check if it's part of the things we're currently fixing. They should be available starting Thursday with the latest release.

@WillBuck99 Same for you, do you have a minimal sample of your PlannerTask?

@Vorland
Copy link

Vorland commented Feb 17, 2025

@FabienTschanz In my case I've tried workload by workload, usually selecting all the components. For me it was failing in Intune (all the components selected) and Exchange (most of the components selected).

I was able to get ps1 configuration file, but wasn't able to generate any type of report.

Intune Components: @("IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy", "IntuneAccountProtectionLocalUserGroupMembershipPolicy", "IntuneAccountProtectionPolicy", "IntuneAntivirusPolicyWindows10SettingCatalog", "IntuneAppConfigurationDevicePolicy", "IntuneAppConfigurationPolicy", "IntuneApplicationControlPolicyWindows10", "IntuneAppProtectionPolicyAndroid", "IntuneAppProtectionPolicyiOS", "IntuneASRRulesPolicyWindows10", "IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager", "IntuneDeviceAndAppManagementAssignmentFilter", "IntuneDeviceCategory", "IntuneDeviceCleanupRule", "IntuneDeviceCompliancePolicyAndroid", "IntuneDeviceCompliancePolicyAndroidDeviceOwner", "IntuneDeviceCompliancePolicyAndroidWorkProfile", "IntuneDeviceCompliancePolicyiOs", "IntuneDeviceCompliancePolicyMacOS", "IntuneDeviceCompliancePolicyWindows10", "IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10", "IntuneDeviceConfigurationCustomPolicyWindows10", "IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10", "IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10", "IntuneDeviceConfigurationDomainJoinPolicyWindows10", "IntuneDeviceConfigurationEmailProfilePolicyWindows10", "IntuneDeviceConfigurationEndpointProtectionPolicyWindows10", "IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10", "IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10", "IntuneDeviceConfigurationIdentityProtectionPolicyWindows10", "IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10", "IntuneDeviceConfigurationKioskPolicyWindows10", "IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10", "IntuneDeviceConfigurationPkcsCertificatePolicyWindows10", "IntuneDeviceConfigurationPlatformScriptMacOS", "IntuneDeviceConfigurationPlatformScriptWindows", "IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator", "IntuneDeviceConfigurationPolicyAndroidDeviceOwner", "IntuneDeviceConfigurationPolicyAndroidOpenSourceProject", "IntuneDeviceConfigurationPolicyAndroidWorkProfile", "IntuneDeviceConfigurationPolicyiOS", "IntuneDeviceConfigurationPolicyMacOS", "IntuneDeviceConfigurationPolicyWindows10", "IntuneDeviceConfigurationSCEPCertificatePolicyWindows10", "IntuneDeviceConfigurationSecureAssessmentPolicyWindows10", "IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10", "IntuneDeviceConfigurationTrustedCertificatePolicyWindows10", "IntuneDeviceConfigurationVpnPolicyWindows10", "IntuneDeviceConfigurationWindowsTeamPolicyWindows10", "IntuneDeviceConfigurationWiredNetworkPolicyWindows10", "IntuneDeviceEnrollmentLimitRestriction", "IntuneDeviceEnrollmentPlatformRestriction", "IntuneDeviceEnrollmentStatusPageWindows10", "IntuneDeviceRemediation", "IntuneDiskEncryptionMacOS", "IntuneEndpointDetectionAndResponsePolicyWindows10", "IntuneExploitProtectionPolicyWindows10SettingCatalog", "IntunePolicySets", "IntuneRoleAssignment", "IntuneRoleDefinition", "IntuneSettingCatalogASRRulesPolicyWindows10", "IntuneSettingCatalogCustomPolicyWindows10", "IntuneWifiConfigurationPolicyAndroidDeviceAdministrator", "IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner", "IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile", "IntuneWifiConfigurationPolicyAndroidForWork", "IntuneWifiConfigurationPolicyAndroidOpenSourceProject", "IntuneWifiConfigurationPolicyIOS", "IntuneWifiConfigurationPolicyMacOS", "IntuneWifiConfigurationPolicyWindows10", "IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined", "IntuneWindowsAutopilotDeploymentProfileAzureADJoined", "IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled", "IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10", "IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10", "IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10")

Exchange Components: @("EXOAcceptedDomain", "EXOAddressList", "EXOAntiPhishPolicy", "EXOAntiPhishRule", "EXOApplicationAccessPolicy", "EXOAtpPolicyForO365", "EXOAuthenticationPolicy", "EXOAuthenticationPolicyAssignment", "EXOAvailabilityAddressSpace", "EXOAvailabilityConfig", "EXOCalendarProcessing", "EXOCASMailboxPlan", "EXOCASMailboxSettings", "EXOClientAccessRule", "EXODataClassification", "EXODataEncryptionPolicy", "EXODistributionGroup", "EXODkimSigningConfig", "EXOEmailAddressPolicy", "EXOGlobalAddressList", "EXOGroupSettings", "EXOHostedConnectionFilterPolicy", "EXOHostedContentFilterPolicy", "EXOHostedContentFilterRule", "EXOHostedOutboundSpamFilterPolicy", "EXOHostedOutboundSpamFilterRule", "EXOInboundConnector", "EXOIntraOrganizationConnector", "EXOIRMConfiguration", "EXOJournalRule", "EXOMailboxAutoReplyConfiguration", "EXOMailboxCalendarFolder", "EXOMailboxPermission", "EXOMailboxPlan", "EXOMailboxSettings", "EXOMailTips", "EXOMalwareFilterPolicy", "EXOMalwareFilterRule", "EXOManagementRole", "EXOManagementRoleAssignment", "EXOManagementRoleEntry", "EXOMessageClassification", "EXOMobileDeviceMailboxPolicy", "EXOOMEConfiguration", "EXOOrganizationConfig", "EXOOrganizationRelationship", "EXOOutboundConnector", "EXOOwaMailboxPolicy", "EXOPartnerApplication", "EXOPerimeterConfiguration", "EXOPlace", "EXOPolicyTipConfig", "EXOQuarantinePolicy", "EXORecipientPermission", "EXORemoteDomain", "EXOReportSubmissionPolicy", "EXOReportSubmissionRule", "EXOResourceConfiguration", "EXORoleAssignmentPolicy", "EXORoleGroup", "EXOSafeAttachmentPolicy", "EXOSafeAttachmentRule", "EXOSafeLinksPolicy", "EXOSafeLinksRule", "EXOSharingPolicy", "EXOTransportConfig", "EXOTransportRule")

Is there anything else I could help you with?

@WillBuck99
Copy link
Author

In my case, I've looked at the M365TenantConfig.ps1 and this is an example (I've edited the text after the ' which is causing the issue for sensitivity)

Notes = "It's back - rest of the note.....";

It seems in my case that the ' is acting as an escape from the text string, thus changing everything after it from being read correctly. Removing the ' manually from the .ps1 file fixes it, but not efficient as the PlannerTask .ps1 config report is 314,132 lines.

This then interprets anything else as a command until a new quote block is reached, so if the term If is used in a note that is affected, it interprests the If as a powershell command

@FabienTschanz
Copy link
Collaborator

@WillBuck99 I see, yes that's exactly the issue we're fixing. @Vorland If I do an export right now, it will also fail unfortunately when converting. This should be fixed on Thursday at the latest. The corresponding PR with the changes for the export was just merged, stay tuned for the latest release.

@Vorland
Copy link

Vorland commented Feb 17, 2025

@FabienTschanz thank you for the information!

@FabienTschanz
Copy link
Collaborator

@WillBuck99 @Vorland Latest version of Microsoft365DSC 1.25.219.2 contains all the fixes. Please try again and let us know the result.

@WillBuck99
Copy link
Author

Thank you @FabienTschanz. Tried it against an already pulled M365TenantConfig.ps1 but still got the same error after updating. Running a fresh report now just to be sure and I'll get back to you. Thank you for your help on this and thank you @Vorland for your input 👍

@FabienTschanz
Copy link
Collaborator

@WillBuck99 Already exported configurations are most likely invalid, so a fresh export and a report from that should solve it. Thank you so much for testing 😄

@WillBuck99
Copy link
Author

WillBuck99 commented Feb 21, 2025

Hi @FabienTschanz, done a fresh PlannerTask export but still running into the same issue unfortunately:

VERBOSE: Loading file 'C:\Temp\DSC\Planner\21-02-2025\\M365TenantConfig.ps1'
Error parsing configuration: At line:251 char:272
+ ... ``& file it in the yellow paper folder which says reciepts on it.";
+                                                        ~~~~~~~~~~~~~~~~~
Unexpected token 'reciepts on it."' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\DSCParser\2.0.0.15\Modules\DSCParser.psm1:472 char:9
+         throw "$($errorPrefix)Error parsing configuration: $parseErro ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Error parsing c...n or statement.:String) [], RuntimeException
    + FullyQualifiedErrorId : Error parsing configuration: At line:251 char:272
+ ... ``& file it in the yellow paper folder which says reciepts on it.";
+                                                        ~~~~~~~~~~~~~~~~~
Unexpected token 'reciepts on it."' in expression or statement.

PS C:\Users\GithubAutomation> Get-Module -Name "ReverseDSC"

ModuleType Version    Name                                ExportedCommands                                                                                                                                                                          
---------- -------    ----                                ----------------                                                                                                                                                                          
Manifest   2.0.0.27   ReverseDSC                          {Add-ConfigurationDataEntry, Add-ReverseDSCUserName, Convert-DSCStringParamToVariable, Get-ConfigurationDataContent...}                                                                   



PS C:\Users\GithubAutomation> Get-Module -Name "Microsoft365DSC"

ModuleType Version    Name                                ExportedCommands                                                                                                                                                                          
---------- -------    ----                                ----------------                                                                                                                                                                          
Manifest   1.25.219.2 Microsoft365DSC                     {Add-M365DSCEvent, Add-M365DSCTelemetryEvent, Assert-M365DSCBlueprint, Assert-M365DSCIsNonInteractiveShell...}

@FabienTschanz
Copy link
Collaborator

Ahh I see. Seems like those are some fancy double quotes you're using there (-->“reciepts”<--). Can you please post a quick version of your M365TenantConfig.ps1 file so that I can double check? Thank you!

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

3 participants