Share via


Set-MgBetaServicePrincipalClaimPolicy

Create a new customClaimsPolicy object if it doesn't exist, or replace an existing one.

Syntax

SetExpanded (Default)

Set-MgBetaServicePrincipalClaimPolicy
    -ServicePrincipalId <String>
    [-ResponseHeadersVariable <String>]
    [-AdditionalProperties <Hashtable>]
    [-AudienceOverride <String>]
    [-Claims <IMicrosoftGraphCustomClaimBase[]>]
    [-Id <String>]
    [-IncludeApplicationIdInIssuer]
    [-IncludeBasicClaimSet]
    [-Headers <IDictionary>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Set

Set-MgBetaServicePrincipalClaimPolicy
    -ServicePrincipalId <String>
    -BodyParameter <IMicrosoftGraphCustomClaimsPolicy>
    [-ResponseHeadersVariable <String>]
    [-Headers <IDictionary>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetViaIdentityExpanded

Set-MgBetaServicePrincipalClaimPolicy
    -InputObject <IApplicationsIdentity>
    [-ResponseHeadersVariable <String>]
    [-AdditionalProperties <Hashtable>]
    [-AudienceOverride <String>]
    [-Claims <IMicrosoftGraphCustomClaimBase[]>]
    [-Id <String>]
    [-IncludeApplicationIdInIssuer]
    [-IncludeBasicClaimSet]
    [-Headers <IDictionary>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetViaIdentity

Set-MgBetaServicePrincipalClaimPolicy
    -InputObject <IApplicationsIdentity>
    -BodyParameter <IMicrosoftGraphCustomClaimsPolicy>
    [-ResponseHeadersVariable <String>]
    [-Headers <IDictionary>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Create a new customClaimsPolicy object if it doesn't exist, or replace an existing one.

Permissions

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Policy.Read.ApplicationConfiguration, Policy.ReadWrite.ApplicationConfiguration,
Delegated (personal Microsoft account) Not supported
Application Policy.Read.ApplicationConfiguration, Policy.ReadWrite.ApplicationConfiguration,

Examples

Example 1: Code snippet


Import-Module Microsoft.Graph.Beta.Applications

$params = @{
	"@odata.type" = "#microsoft.graph.customClaimsPolicy"
	includeBasicClaimSet = "Boolean"
	includeApplicationIdInIssuer = "Boolean"
	audienceOverride = "String"
	claims = @(
		@{
			"@odata.type" = "microsoft.graph.customClaim"
		}
	)
}

Set-MgBetaServicePrincipalClaimPolicy -ServicePrincipalId $servicePrincipalId -BodyParameter $params

This example shows how to use the Set-MgBetaServicePrincipalClaimPolicy Cmdlet.

Parameters

-AdditionalProperties

Additional Parameters

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AudienceOverride

If specified, it overrides the content of the audience claim for WS-Federation and SAML2 protocols. A custom signing key must be used for audienceOverride to be applied, otherwise, the audienceOverride value is ignored. The value provided must be in the format of an absolute URI.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-BodyParameter

customClaimsPolicy To construct, see NOTES section for BODYPARAMETER properties and create a hash table.

Parameter properties

Type:IMicrosoftGraphCustomClaimsPolicy
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Set
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
SetViaIdentity
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Claims

Defines which claims are present in the tokens affected by the policy, in addition to the basic claim and the core claim set. Inherited from customclaimbase. To construct, see NOTES section for CLAIMS properties and create a hash table.

Parameter properties

Type:

IMicrosoftGraphCustomClaimBase[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Headers

Optional headers that will be added to the request.

Parameter properties

Type:IDictionary
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

The unique identifier for an entity. Read-only.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludeApplicationIdInIssuer

Indicates whether the application ID is added to the claim. It is relevant only for SAML2.0 and if a custom signing key is used. the default value is true. Optional.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

SetExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludeBasicClaimSet

Determines whether the basic claim set is included in tokens affected by this policy. If set to true, all claims in the basic claim set are emitted in tokens affected by the policy. By default the basic claim set isn't in the tokens unless they're explicitly configured in this policy.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

SetExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Parameter properties

Type:IApplicationsIdentity
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetViaIdentityExpanded
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
SetViaIdentity
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-ResponseHeadersVariable

Optional Response Headers Variable.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RHV

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ServicePrincipalId

The unique identifier of servicePrincipal

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Set
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.Graph.Beta.PowerShell.Models.IApplicationsIdentity

Microsoft.Graph.Beta.PowerShell.Models.IMicrosoftGraphCustomClaimsPolicy

System.Collections.IDictionary

Outputs

Microsoft.Graph.Beta.PowerShell.Models.IMicrosoftGraphCustomClaimsPolicy

Notes

COMPLEX PARAMETER PROPERTIES

To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

BODYPARAMETER <IMicrosoftGraphCustomClaimsPolicy>: customClaimsPolicy

  • [(Any) <Object>]: This indicates any property can be added to this object.
  • [Id <String>]: The unique identifier for an entity. Read-only.
  • [AudienceOverride <String>]: If specified, it overrides the content of the audience claim for WS-Federation and SAML2 protocols. A custom signing key must be used for audienceOverride to be applied, otherwise, the audienceOverride value is ignored. The value provided must be in the format of an absolute URI.
  • [Claims <IMicrosoftGraphCustomClaimBase- []>]: Defines which claims are present in the tokens affected by the policy, in addition to the basic claim and the core claim set. Inherited from customclaimbase.
    • [Configurations <IMicrosoftGraphCustomClaimConfiguration- []>]: One or more configurations that describe how the claim is sourced and under what conditions.
      • [Attribute <IMicrosoftGraphCustomClaimAttributeBase>]: customClaimAttributeBase
        • [(Any) <Object>]: This indicates any property can be added to this object.
      • [Condition <IMicrosoftGraphCustomClaimConditionBase>]: customClaimConditionBase
        • [(Any) <Object>]: This indicates any property can be added to this object.
      • [Transformations <IMicrosoftGraphCustomClaimTransformation- []>]: An ordered list of transformations that are applied in sequence.
        • [Input <IMicrosoftGraphTransformationAttribute>]: transformationAttribute
          • [(Any) <Object>]: This indicates any property can be added to this object.
          • [Attribute <IMicrosoftGraphCustomClaimAttributeBase>]: customClaimAttributeBase
          • [TreatAsMultiValue <Boolean?>]: This flag is only relevant in the case where the attribute is multivalued. By default, transformations are only applied to the first element in a multi-valued claim, however setting this flag to true ensures the transformation is applied to all values, resulting in a multivalued output.
  • [IncludeApplicationIdInIssuer <Boolean?>]: Indicates whether the application ID is added to the claim. It is relevant only for SAML2.0 and if a custom signing key is used. the default value is true. Optional.
  • [IncludeBasicClaimSet <Boolean?>]: Determines whether the basic claim set is included in tokens affected by this policy. If set to true, all claims in the basic claim set are emitted in tokens affected by the policy. By default the basic claim set isn't in the tokens unless they're explicitly configured in this policy.

CLAIMS <IMicrosoftGraphCustomClaimBase- []>: Defines which claims are present in the tokens affected by the policy, in addition to the basic claim and the core claim set. Inherited from customclaimbase.

  • [Configurations <IMicrosoftGraphCustomClaimConfiguration- []>]: One or more configurations that describe how the claim is sourced and under what conditions.
    • [Attribute <IMicrosoftGraphCustomClaimAttributeBase>]: customClaimAttributeBase
      • [(Any) <Object>]: This indicates any property can be added to this object.
    • [Condition <IMicrosoftGraphCustomClaimConditionBase>]: customClaimConditionBase
      • [(Any) <Object>]: This indicates any property can be added to this object.
    • [Transformations <IMicrosoftGraphCustomClaimTransformation- []>]: An ordered list of transformations that are applied in sequence.
      • [Input <IMicrosoftGraphTransformationAttribute>]: transformationAttribute
        • [(Any) <Object>]: This indicates any property can be added to this object.
        • [Attribute <IMicrosoftGraphCustomClaimAttributeBase>]: customClaimAttributeBase
        • [TreatAsMultiValue <Boolean?>]: This flag is only relevant in the case where the attribute is multivalued. By default, transformations are only applied to the first element in a multi-valued claim, however setting this flag to true ensures the transformation is applied to all values, resulting in a multivalued output.

INPUTOBJECT <IApplicationsIdentity>: Identity Parameter

  • [AppId <String>]: Alternate key of application
  • [AppManagementPolicyId <String>]: The unique identifier of appManagementPolicy
  • [AppRoleAssignmentId <String>]: The unique identifier of appRoleAssignment
  • [ApplicationId <String>]: The unique identifier of application
  • [ApplicationTemplateId <String>]: The unique identifier of applicationTemplate
  • [ClaimsMappingPolicyId <String>]: The unique identifier of claimsMappingPolicy
  • [ConnectorGroupId <String>]: The unique identifier of connectorGroup
  • [ConnectorId <String>]: The unique identifier of connector
  • [DelegatedPermissionClassificationId <String>]: The unique identifier of delegatedPermissionClassification
  • [DirectoryDefinitionId <String>]: The unique identifier of directoryDefinition
  • [DirectoryObjectId <String>]: The unique identifier of directoryObject
  • [EndpointId <String>]: The unique identifier of endpoint
  • [ExtensionPropertyId <String>]: The unique identifier of extensionProperty
  • [FederatedIdentityCredentialId <String>]: The unique identifier of federatedIdentityCredential
  • [GroupId <String>]: The unique identifier of group
  • [HomeRealmDiscoveryPolicyId <String>]: The unique identifier of homeRealmDiscoveryPolicy
  • [IPApplicationSegmentId <String>]: The unique identifier of ipApplicationSegment
  • [LicenseDetailsId <String>]: The unique identifier of licenseDetails
  • [Name <String>]: Alternate key of federatedIdentityCredential
  • [OAuth2PermissionGrantId <String>]: The unique identifier of oAuth2PermissionGrant
  • [OnPremisesAgentGroupId <String>]: The unique identifier of onPremisesAgentGroup
  • [OnPremisesAgentGroupId1 <String>]: The unique identifier of onPremisesAgentGroup
  • [OnPremisesAgentId <String>]: The unique identifier of onPremisesAgent
  • [OnPremisesPublishingProfileId <String>]: The unique identifier of onPremisesPublishingProfile
  • [PermissionGrantPreApprovalPolicyId <String>]: The unique identifier of permissionGrantPreApprovalPolicy
  • [PublishedResourceId <String>]: The unique identifier of publishedResource
  • [ServicePrincipalId <String>]: The unique identifier of servicePrincipal
  • [SynchronizationJobId <String>]: The unique identifier of synchronizationJob
  • [SynchronizationTemplateId <String>]: The unique identifier of synchronizationTemplate
  • [TargetDeviceGroupId <String>]: The unique identifier of targetDeviceGroup
  • [TokenIssuancePolicyId <String>]: The unique identifier of tokenIssuancePolicy
  • [TokenLifetimePolicyId <String>]: The unique identifier of tokenLifetimePolicy
  • [UniqueName <String>]: Alternate key of application
  • [UserId <String>]: The unique identifier of user