Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

AAD Workload Export to HTML

Open Aussupport opened this issue 6 months ago • 2 comments

Description of the issue

We cannot export to HTML or CSV no Errors just creating prompt for days.

New-M365DSCReportFromConfiguration -Type HTML

PS1 file is 12MB

Microsoft 365 DSC Version

1.25.528.1

Which workloads are affected

Azure Active Directory (Entra ID)

The DSC configuration

Export-M365DSCConfiguration -ApplicationId 'xxc7937-xxxxxxx-885e-9ff7e43xxx' -TenantId 'xxxx.xx.com' -CertificateThumbprint '3xxxxxxx53F1BD3A4859603C9A9' -Workloads @("AAD") -Path "C:\M365\" -FileName "M365DSc-AAD12062025.ps1"

New-M365DSCReportFromConfiguration -Type HTML -ConfigurationPath C:\M365\M365DSc-AAD12062025.ps1 -OutputPath C:\M365\Report\M365DSc-AAD12062025.html

Verbose logs showing the problem

PS C:\Windows\system32> New-M365DSCReportFromConfiguration -Type HTML -ConfigurationPath C:\M365\M365DSc-AAD12062025.ps1 -OutputPath C:\M365\Report\M365DSc-AAD12062025.html
There is a newer version of the 'Microsoft365DSC' module available on the gallery.
To update the module and it's dependencies, run the following command:
Update-M365DSCModule
Generating HTML report

PS C:\Windows\system32> New-M365DSCReportFromConfiguration -Type CSV -ConfigurationPath C:\M365\M365DSc-AAD12062025.ps1 -OutputPath C:\M365\Report\M365DSc-AAD12062025.csv
There is a newer version of the 'Microsoft365DSC' module available on the gallery.
To update the module and it's dependencies, run the following command:
Update-M365DSCModule

Environment Information + PowerShell Version

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

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.20348.2849
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.2849
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Aussupport avatar Jun 18 '25 23:06 Aussupport

  •     ~~~~~~~~~~~~~~~~~~~
    

Resource 'AADServicePrincipal' requires that a value of type 'String' be provided for property 'AppId'. At C:\M365\AAD\M365TenantConfig.ps1:20520 char:9

  •     AADServicePrincipal "AADServicePrincipal-12"
    
  •     ~~~~~~~~~~~~~~~~~~~
    

Resource 'AADServicePrincipal' requires that a value of type 'String' be provided for property 'AppId'. At C:\M365\AAD\M365TenantConfig.ps1:20663 char:9

  •     AADServicePrincipal "AADServicePrincipal-13"
    
  •     ~~~~~~~~~~~~~~~~~~~
    

Resource 'AADServicePrincipal' requires that a value of type 'String' be provided for property 'AppId'. At C:\M365\AAD\M365TenantConfig.ps1:20737 char:9

  •     AADServicePrincipal "AADServicePrincipal-14"
    
  •     ~~~~~~~~~~~~~~~~~~~
    

Resource 'AADServicePrincipal' requires that a value of type 'String' be provided for property 'AppId'. At C:\M365\AAD\M365TenantConfig.ps1:20887 char:9

  •     AADServicePrincipal "AADServicePrincipal-15"
    
  •     ~~~~~~~~~~~~~~~~~~~
    

Resource 'AADServicePrincipal' requires that a value of type 'String' be provided for property 'AppId'. At C:\M365\AAD\M365TenantConfig.ps1:20978 char:9

  •     AADServicePrincipal "AADServicePrincipal-16"
    
  •     ~~~~~~~~~~~~~~~~~~~
    

Resource 'AADServicePrincipal' requires that a value of type 'String' be provided for property 'AppId'. Not all parse errors were reported. Correct the reported errors and try again. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : MissingValueForMandatoryProperty

Aussupport avatar Jun 19 '25 06:06 Aussupport

AppId is missing

AADServicePrincipal "AADServicePrincipal-139" { AccountEnabled = $True; AlternativeNames = @("/subscriptions/0d19e349-1add-43d9-a763-59f674505f38/resourcegroups/prg-aue-prpsi-security-01/providers/Microsoft.HybridCompute/machines/PER-DC-01","isExplicit=False"); ApplicationId = $ConfigurationData.NonNodeData.ApplicationId; AppRoleAssignedTo = @(); AppRoleAssignmentRequired = $False; CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint; CustomSecurityAttributes = @(); DelegatedPermissionClassifications = @(); DisplayName = "DC-01"; Ensure = "Present"; KeyCredentials = @(

Aussupport avatar Jun 19 '25 06:06 Aussupport

I just run the following to test but still got the error?

PS C:\M365\AAD> Update-M365DSCModule Installing Microsoft.Graph.Identity.DirectoryManagement version {2.28.0} Installing Microsoft.Graph.Identity.SignIns version {2.28.0} Uninstalling Microsoft365DSC Version {1.25.528.1} Remove-Item : Cannot remove item C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.528.1\Dependencies\Microsoft.ApplicationInsights.dll: Access to the path 'Microsoft.ApplicationInsights.dll' is denied. At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.611.1\Modules\M365DSCUtil.psm1:3135 char:21

  •                 Remove-Item $($module.ModuleBase) -Force -Recurse
    
  •                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : PermissionDenied: (Microsoft.ApplicationInsights.dll:FileInfo) [Remove-Item], UnauthorizedAccessException
    • FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand Remove-Item : Cannot remove item C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.528.1\Dependencies: The directory is not empty. At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.611.1\Modules\M365DSCUtil.psm1:3135 char:21
  •                 Remove-Item $($module.ModuleBase) -Force -Recurse
    
  •                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : WriteError: (Dependencies:DirectoryInfo) [Remove-Item], IOException
    • FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand Remove-Item : Cannot remove item C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.528.1: The directory is not empty. At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.611.1\Modules\M365DSCUtil.psm1:3135 char:21
  •                 Remove-Item $($module.ModuleBase) -Force -Recurse
    
  •                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : WriteError: (C:\Program File...5DSC\1.25.528.1:DirectoryInfo) [Remove-Item], IOException
    • FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand Uninstalling MSCloudLoginAssistant Version {1.1.43} Checking Microsoft.Graph.Authentication

PS C:\M365\AAD> Update-M365DSCDependencies

PS C:\M365\AAD> New-M365DSCReportFromConfiguration -Type HTML -ConfigurationPath ($filepath+''+$servicename+'\M365TenantConfig.ps1') -outputpath ($filepath+''+$servicename+''+$servicename+'_DSC_Export.html')

Error parsing configuration: At line:19688 char:9

  •     AADServicePrincipal "AADServicePrincipal"
    
  •     ~~~~~~~~~~~~~~~~~~~
    

Resource 'AADServicePrincipal' requires that a value of type 'String' be provided for property 'AppId'. At C:\Program Files\WindowsPowerShell\Modules\DSCParser\2.0.0.17\Modules\DSCParser.psm1:472 char:9

  •     throw "$($errorPrefix)Error parsing configuration: $parseErro ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Error parsing c...operty 'AppId'.:String) [], RuntimeException
    • FullyQualifiedErrorId : Error parsing configuration: At line:19688 char:9
  •     AADServicePrincipal "AADServicePrincipal"
    
  •     ~~~~~~~~~~~~~~~~~~~
    

Resource 'AADServicePrincipal' requires that a value of type 'String' be provided for property 'AppId'.

PS C:\M365\AAD>

Aussupport avatar Jun 25 '25 04:06 Aussupport