Microsoft365DSC
Microsoft365DSC copied to clipboard
Setting ServicePrincipalRiskLevels failure
Description of the issue
Setting newly added ServicePrincipalRiskLevels fails because of incorrect parameter type
Microsoft 365 DSC Version
1.25.709.1
Which workloads are affected
Azure Active Directory (Entra ID)
The DSC configuration
param (
[parameter()]
[system.string]$ApplicationId,
[parameter()]
[system.string]$CertificateThumbprint,
[parameter()]
[system.string]$tenantID
)
$configurationData = @{
AllNodes = @(
@{
NodeName = "localhost"
#PSDscAllowPlainTextPassword = $true;
#PSDscAllowDomainUser = $true;
}
)
}
Configuration M365TenantConfig
{
param (
[parameter(Mandatory = $True)]
[system.string]$ApplicationId,
[parameter(Mandatory = $True)]
[System.String]$CertificateThumbprint,
[parameter(Mandatory = $True)]
[system.string]$tenantID
)
Import-DscResource -ModuleName 'Microsoft365DSC'
Node localhost
{
AADConditionalAccessPolicy "AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block"
{
TenantId = $tenantID;
ApplicationId = $ApplicationId;
CertificateThumbprint = $CertificateThumbprint;
ApplicationEnforcedRestrictionsIsEnabled = $False;
AuthenticationContexts = @();
BuiltInControls = @("block");
GrantControlOperator = "OR";
ClientAppTypes = @("all");
DisplayName = "CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block";
Ensure = "Present";
IncludeApplications = @("All");
ExcludeApplications = @();
IncludeServicePrincipals = @();
ExcludeServicePrincipals = @();
IncludeUsers = @("None");
ExcludeUsers = @();
ServicePrincipalFilterMode = "include";
ServicePrincipalFilterRule = "CustomSecurityAttribute.asrapps_apiPermLevel -eq `"high`"";
ServicePrincipalRiskLevels = @("high","medium");
State = "enabledForReportingButNotEnforced";
}
}
}
M365TenantConfig -configurationdata $configurationdata -applicationId $applicationId -CertificateThumbprint $CertificateThumbprint -tenantID $tenantID
Verbose logs showing the problem
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' =
SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer xxx with user sid
yyy.
VERBOSE: [machinename]: LCM: [ Start Set ]
VERBOSE: [machinename]: LCM: [ Start Resource ]
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block]
VERBOSE: [machinename]: LCM: [ Start Test ]
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block]
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Getting configuration of AzureAD Conditional Access Policy
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Id was NOT specified
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Retrieved policy:
{
"Conditions": {
"Applications": {
"ApplicationFilter":
"Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphConditionalAccessFilter",
"ExcludeApplications": "",
"IncludeApplications": "All",
"IncludeAuthenticationContextClassReferences": "",
"IncludeUserActions": ""
},
"AuthenticationFlows": {
"TransferMethods": null
},
"ClientAppTypes": [
"all"
],
"ClientApplications": {
"ExcludeServicePrincipals": "",
"IncludeServicePrincipals": "",
"ServicePrincipalFilter":
"Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphConditionalAccessFilter"
},
"DeviceStates": {
"ExcludeStates": null,
"IncludeStates": null
},
"Devices": {
"DeviceFilter":
"Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphConditionalAccessFilter",
"ExcludeDeviceStates": null,
"ExcludeDevices": null,
"IncludeDeviceStates": null,
"IncludeDevices": null
},
"InsiderRiskLevels": null,
"Locations": {
"ExcludeLocations": null,
"IncludeLocations": null
},
"Platforms": {
"ExcludePlatforms": null,
"IncludePlatforms": null
},
"ServicePrincipalRiskLevels": [
"high"
],
"SignInRiskLevels": [
],
"UserRiskLevels": [
],
"Users": {
"ExcludeGroups": "",
"ExcludeGuestsOrExternalUsers":
"Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphConditionalAccessGuestsOrExternalUsers",
"ExcludeRoles": "",
"ExcludeUsers": "",
"IncludeGroups": "",
"IncludeGuestsOrExternalUsers":
"Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphConditionalAccessGuestsOrExternalUsers",
"IncludeRoles": "",
"IncludeUsers": "None"
}
},
"CreatedDateTime": "\/Date(1752504790785)\/",
"Description": null,
"DisplayName": "CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block",
"GrantControls": {
"AuthenticationStrength": {
"AllowedCombinations": null,
"CombinationConfigurations": null,
"CreatedDateTime": null,
"Description": null,
"DisplayName": null,
"Id": null,
"ModifiedDateTime": null,
"PolicyType": null,
"RequirementsSatisfied": null
},
"BuiltInControls": [
"block"
],
"CustomAuthenticationFactors": [
],
"Operator": "OR",
"TermsOfUse": [
]
},
"Id": "286047e1-3476-4531-a905-b32eb69c1a7d",
"ModifiedDateTime": "\/Date(1752649686558)\/",
"SessionControls": {
"ApplicationEnforcedRestrictions": {
"IsEnabled": null
},
"CloudAppSecurity": {
"CloudAppSecurityType": null,
"IsEnabled": null
},
"ContinuousAccessEvaluation": { "Mode": null }, "DisableResilienceDefaults": null, "GlobalSecureAccessFilteringProfile": { "IsEnabled": null, "ProfileId": null }, "PersistentBrowser": { "IsEnabled": null, "Mode": null }, "SecureSignInSession": { "IsEnabled": null }, "SignInFrequency": { "AuthenticationType": null, "FrequencyInterval": null, "IsEnabled": null, "Type": null, "Value": null } }, "State": "disabled", "AdditionalProperties": { } } VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Get-TargetResource: Found existing Conditional Access policy VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Get-TargetResource: Process IncludeUsers
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Process ExcludeUsers
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Process IncludeGroups
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Process ExcludeGroups
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Location condition defined, processing
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Processing IncludeLocations
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Processing ExcludeLocations
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource Result:
AccessTokens=$null
ApplicationEnforcedRestrictionsIsEnabled=False
ApplicationId=***
ApplicationSecret=$null
ApplicationsFilter=$null
ApplicationsFilterMode=$null
AuthenticationContexts=()
AuthenticationStrength=$null
BuiltInControls=(block)
CertificateThumbprint=***
ClientAppTypes=(all)
CloudAppSecurityIsEnabled=False
CloudAppSecurityType=
Credential=$null
CustomAuthenticationFactors=()
DeviceFilterMode=
DeviceFilterRule=
DisableResilienceDefaultsIsEnabled=False
DisplayName=CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block
Ensure=Present
ExcludeApplications=()
ExcludeExternalTenantsMembers=()
ExcludeExternalTenantsMembershipKind=
ExcludeGroups=()
ExcludeGuestOrExternalUserTypes=$null
ExcludeLocations=()
ExcludePlatforms=()
ExcludeRoles=()
ExcludeServicePrincipals=()
ExcludeUsers=()
GrantControlOperator=OR
Id=286047e1-3476-4531-a905-b32eb69c1a7d
IncludeApplications=(All) IncludeExternalTenantsMembers=() IncludeExternalTenantsMembershipKind= IncludeGroups=() IncludeGuestOrExternalUserTypes=$null IncludeLocations=() IncludePlatforms=() IncludeRoles=() IncludeServicePrincipals=() IncludeUserActions=() IncludeUsers=(None) InsiderRiskLevels=$null Managedidentity=False PersistentBrowserIsEnabled=False PersistentBrowserMode= ServicePrincipalFilterMode=include ServicePrincipalFilterRule=CustomSecurityAttribute.asrapps_apiPermLevel -eq "high" ServicePrincipalRiskLevels=high SignInFrequencyInterval=$null SignInFrequencyIsEnabled=False SignInFrequencyType= SignInFrequencyValue=$null SignInRiskLevels=() State=disabled TenantId=*** TermsOfUse=$null TransferMethods= UserRiskLevels=()
VERBOSE: [machinename]: LCM: [ End Test ]
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] in 14.5660 seconds.
VERBOSE: [machinename]: LCM: [ Start Set ]
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block]
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Setting configuration of AzureAD Conditional Access Policy
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Set-Targetresource: Running Get-TargetResource
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Getting configuration of AzureAD Conditional Access Policy
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Id was NOT specified
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Retrieved policy:
{
"Conditions": {
"Applications": {
"ApplicationFilter":
"Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphConditionalAccessFilter",
"ExcludeApplications": "",
"IncludeApplications": "All",
"IncludeAuthenticationContextClassReferences": "",
"IncludeUserActions": ""
},
"AuthenticationFlows": {
"TransferMethods": null
},
"ClientAppTypes": [
"all"
],
"ClientApplications": {
"ExcludeServicePrincipals": "",
"IncludeServicePrincipals": "",
"ServicePrincipalFilter":
"Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphConditionalAccessFilter"
},
"DeviceStates": {
"ExcludeStates": null,
"IncludeStates": null
},
"Devices": {
"DeviceFilter":
"Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphConditionalAccessFilter",
"ExcludeDeviceStates": null,
"ExcludeDevices": null,
"IncludeDeviceStates": null,
"IncludeDevices": null
},
"InsiderRiskLevels": null,
"Locations": {
"ExcludeLocations": null,
"IncludeLocations": null
},
"Platforms": {
"ExcludePlatforms": null,
"IncludePlatforms": null
},
"ServicePrincipalRiskLevels": [
"high"
],
"SignInRiskLevels": [
],
"UserRiskLevels": [
],
"Users": {
"ExcludeGroups": "",
"ExcludeGuestsOrExternalUsers":
"Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphConditionalAccessGuestsOrExternalUsers",
"ExcludeRoles": "",
"ExcludeUsers": "",
"IncludeGroups": "",
"IncludeGuestsOrExternalUsers":
"Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphConditionalAccessGuestsOrExternalUsers",
"IncludeRoles": "",
"IncludeUsers": "None"
}
},
"CreatedDateTime": "\/Date(1752504790785)\/",
"Description": null,
"DisplayName": "CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block",
"GrantControls": {
"AuthenticationStrength": {
"AllowedCombinations": null,
"CombinationConfigurations": null,
"CreatedDateTime": null,
"Description": null,
"DisplayName": null,
"Id": null,
"ModifiedDateTime": null,
"PolicyType": null,
"RequirementsSatisfied": null
},
"BuiltInControls": [
"block"
],
"CustomAuthenticationFactors": [
],
"Operator": "OR",
"TermsOfUse": [
]
},
"Id": "286047e1-3476-4531-a905-b32eb69c1a7d",
"ModifiedDateTime": "\/Date(1752649686558)\/",
"SessionControls": {
"ApplicationEnforcedRestrictions": {
"IsEnabled": null
},
"CloudAppSecurity": {
"CloudAppSecurityType": null,
"IsEnabled": null
},
"ContinuousAccessEvaluation": { "Mode": null }, "DisableResilienceDefaults": null, "GlobalSecureAccessFilteringProfile": { "IsEnabled": null, "ProfileId": null }, "PersistentBrowser": { "IsEnabled": null, "Mode": null }, "SecureSignInSession": { "IsEnabled": null }, "SignInFrequency": { "AuthenticationType": null, "FrequencyInterval": null, "IsEnabled": null, "Type": null, "Value": null } }, "State": "disabled", "AdditionalProperties": { } } VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Get-TargetResource: Found existing Conditional Access policy VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Get-TargetResource: Process IncludeUsers
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Process ExcludeUsers
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Process IncludeGroups
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Process ExcludeGroups
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Location condition defined, processing
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Processing IncludeLocations
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource: Processing ExcludeLocations
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Get-TargetResource Result:
AccessTokens=$null
ApplicationEnforcedRestrictionsIsEnabled=False
ApplicationId=***
ApplicationSecret=$null
ApplicationsFilter=$null
ApplicationsFilterMode=$null
AuthenticationContexts=()
AuthenticationStrength=$null
BuiltInControls=(block)
CertificateThumbprint=***
ClientAppTypes=(all)
CloudAppSecurityIsEnabled=False
CloudAppSecurityType=
Credential=$null
CustomAuthenticationFactors=()
DeviceFilterMode=
DeviceFilterRule=
DisableResilienceDefaultsIsEnabled=False
DisplayName=CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block
Ensure=Present
ExcludeApplications=()
ExcludeExternalTenantsMembers=()
ExcludeExternalTenantsMembershipKind=
ExcludeGroups=()
ExcludeGuestOrExternalUserTypes=$null
ExcludeLocations=()
ExcludePlatforms=()
ExcludeRoles=()
ExcludeServicePrincipals=()
ExcludeUsers=()
GrantControlOperator=OR
Id=286047e1-3476-4531-a905-b32eb69c1a7d
IncludeApplications=(All) IncludeExternalTenantsMembers=() IncludeExternalTenantsMembershipKind= IncludeGroups=() IncludeGuestOrExternalUserTypes=$null IncludeLocations=() IncludePlatforms=() IncludeRoles=() IncludeServicePrincipals=() IncludeUserActions=() IncludeUsers=(None) InsiderRiskLevels=$null Managedidentity=False PersistentBrowserIsEnabled=False PersistentBrowserMode= ServicePrincipalFilterMode=include ServicePrincipalFilterRule=CustomSecurityAttribute.asrapps_apiPermLevel -eq "high" ServicePrincipalRiskLevels=high SignInFrequencyInterval=$null SignInFrequencyIsEnabled=False SignInFrequencyType= SignInFrequencyValue=$null SignInRiskLevels=() State=disabled TenantId=*** TermsOfUse=$null TransferMethods= UserRiskLevels=() VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: Cleaning up parameters VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: Policy CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block Ensure Present VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: create Conditions object VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: create Application Condition object VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process includeusers VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process excludeusers VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process includegroups VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process excludegroups VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process includeroles VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process excluderoles VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process includeGuestOrExternalUser VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process excludeGuestsOrExternalUsers VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process includeServicePrincipals VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process excludeServicePrincipals VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process servicePrincipalFilter VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] GET https://graph.microsoft.com/v1.0/directory/customSecurityAttributeDefinitions with 0-byte payload VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] received 1010-byte response of content type application/json VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process platform condition VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process include and exclude locations VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process device filter VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: process risk levels and app types VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: UserRiskLevels:
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Set-Targetresource: SignInRiskLevels:
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Set-Targetresource: ClientAppTypes: all
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Set-Targetresource: authenticationFlows transferMethods:
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Set-Targetresource: Adding processed conditions
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Set-Targetresource: create and provision Grant Control object
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] Set-Targetresource: Adding processed grant controls
VERBOSE: [machinename]:
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] newparameters: {
"displayName": "CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block",
"grantControls": {
"builtInControls": [
"block"
],
"operator": "OR"
},
"conditions": {
"clientAppTypes": [
"all"
],
"servicePrincipalRiskLevels": "high,medium",
"users": {
"excludeUsers": [
],
"includeUsers": [ "None" ] }, "applications": { "includeApplications": [ "All" ], "excludeApplications": [ ] }, "clientApplications": {
"excludeServicePrincipals": [
],
"servicePrincipalFilter": {
"rule":
"CustomSecurityAttribute.asrapps_apiPermLevel -eq \"high\"",
"mode": "include"
}, "includeServicePrincipals": [ ] } }, "state": "enabledForReportingButNotEnforced" } VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: Change policy CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Updating existing policy with values: ConditionalAccessPolicyId=286047e1-3476-4531-a905-b32eb69c1a7d conditions={applications={excludeApplications=() includeApplications=(All)} clientApplications={excludeServicePrincipals=() includeServicePrincipals=() servicePrincipalFilter={mode=include rule=CustomSecurityAttribute.asrapps_apiPermLevel -eq "high"}} clientAppTypes=(all) servicePrincipalRiskLevels=high,medium users={excludeUsers=() includeUsers=(None)}} displayName=CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block grantControls={builtInControls=(block) operator=OR} state=enabledForReportingButNotEnforced VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] PATCH https://graph.microsoft.com/beta/identity/conditionalAccess/policies/286047e1-3476-4531-a905-b32eb69c1a7d with 660-byte payload VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] received 547-byte response of content type application/json Set-Targetresource: Failed changing policy CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block + CategoryInfo : NotSpecified: (:) [], CimException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Set-TargetResource + PSComputerName : localhost VERBOSE: [machinename]: [[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk- Block] Set-Targetresource: Finished processing Policy CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-Block VERBOSE: [machinename]: LCM: [ End Set ]
[[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityProtection-HighImpactAnyRisk-
Block] in 1.2080 seconds.
The PowerShell DSC resource '[AADConditionalAccessPolicy]AADConditionalAccessPolicy-CA0901-WorkloadIdentities-IdentityP
rotection-HighImpactAnyRisk-Block' with SourceInfo 'C:\temp\M365TenantConfig.ps1::35::9::AADConditionalAccessPolicy'
threw one or more non-terminating errors while running the Set-TargetResource functionality. These errors are logged
to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost
VERBOSE: [machinename]: LCM: [ End Set ]
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : localhost
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 70.581 seconds
Environment Information + PowerShell Version
OsName : Microsoft Windows 11 Enterprise multi-session
OsOperatingSystemSKU : 175
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage : en-US
OsMuiLanguages : {en-US, nl-NL}
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