microsoftgraph / microsoftgraph/msgraph-sdk-powershell
Update-MgIdentityConditionalAccessPolicy "1054: Invalid servicePrincipal value: ."
@timayabi2020 is already working on this.
Since Feb 13, 2025.
- Dominant language
- C#
- Stars
- 898
- Forks
- 230
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 31
Description
Describe the bug
When I try to remove all existing service principal IDs in selected conditional policy condition by defining IncludeServicePrincipals = '', it ends with an error.
I've tried to use:
IncludeServicePrincipals = $null
IncludeServicePrincipals = @()
but both tries ended with empty body a.k.a. nothing happened.
How am I suppose to select NONE then?
To Reproduce
Steps to reproduce the behavior:
$params = @{
Conditions = @{
ClientApplications = @{
IncludeServicePrincipals = ''
}
}
}
Update-MgIdentityConditionalAccessPolicy -ConditionalAccessPolicyId -Conditions $params.Conditions -debug
Expected behavior
Existing service principals defined in such conditional policy should be remove.
Debug Output
Run the problematic command with
-Debugand paste the resulting debug stream below.
⚠ ATTENTION: Be sure to remove any sensitive information that may be in the logs.
Module Version
Please run
Get-Module Microsoft.Graph*after cmdlet execution and paste the output below.
If a module cannot be installed or imported, please runGet-Module -ListAvailableand paste the output.
Environment Data
Please run
$PSVersionTableand paste the output below. If running the Docker container image, indicate the tag of the image used and the version of Docker engine.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.