microsoft / Microsoft365DSC

Manages, configures, extracts and monitors Microsoft 365 tenant configurations
https://aka.ms/M365DSC
MIT License
1.59k stars 500 forks source link

AADApplication: Get-DSCConfiguration not working #4461

Open Wopienkaatwork opened 7 months ago

Wopienkaatwork commented 7 months ago

Description of the issue

After applying a valid configuration I wanted to Get-DSCConfiguration but the command crashes with three eventlog entries. I have encluded a ZIP file with all the eventlog entries that happend during the call dsc-eventlogexport.zip The problem occurs while parsing an AADApplication.

Microsoft 365 DSC Version

1.24.313.1

Which workloads are affected

Azure Active Directory

The DSC configuration

No response

Verbose logs showing the problem

VERBOSE: [M365DSC-VM]:                            [[AADApplication]AADApplication-afterdeploy] Getting configuration of Azure AD Application
VERBOSE: [M365DSC-VM]:                            [[AADApplication]AADApplication-afterdeploy] An instance of Azure AD App was retrieved.
VERBOSE: [M365DSC-VM]:                            [[AADApplication]AADApplication-afterdeploy] Retrieving permissions for Azure AD Application {afterdeploy}
VERBOSE: [M365DSC-VM]:                            [[AADApplication]AADApplication-afterdeploy] Get-TargetResource Result:
 AppId=89ec29b7-dfea-4342-b929-801f75a17974
ApplicationId=***
ApplicationSecret=$null
AvailableToOtherTenants=False
CertificateThumbprint=***
Credential=$null
Description=$null
DisplayName=afterdeploy
Ensure=Present
GroupMembershipClaims=$null
Homepage=https://account.activedirectory.windowsazure.com:444/applications/default.aspx?metadata=customappsso|ISV9.1|primary|z
IdentifierUris=()
IsFallbackPublicClient=False
KnownClientApplications=()
LogoutURL=$null
Managedidentity=False
ObjectId=3177df0f-d102-4553-b453-d3a9e59cab11
Owners=()
Permissions=$null
PublicClient=False
ReplyURLs=()
TenantId=***
Get-DscConfiguration : GetConfiguration did not succeed.
At line:1 char:1
+ Get-DscConfiguration -verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (MSFT_DSCLocalConfigurationManager:root/Microsoft/...gurationManager) [Get-DscConfiguration], CimException
    + FullyQualifiedErrorId : MI RESULT 1,Get-DscConfiguration

Environment Information + PowerShell Version

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

PS C:\latest>
PS C:\latest> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.20348.2227
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.2227
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
NikCharlebois commented 7 months ago

Any chances you would have duplicate Applications with the same names in your environment?

Wopienkaatwork commented 7 months ago

I already checked that because if two applications with the same name are found it will not be evaluated and warning is shown during the export

Wopienkaatwork commented 7 months ago

I just doubled checked it, I have no applications with the same name in the environment.