Edit

Share via


Set-CMCollectionCloudSync

Configure collection membership synchronization to Microsoft Entra groups for a device or user collection. For more information, see How to synchronize collection members to Microsoft Entra groups

Syntax

SetByValue (Default)

Set-CMCollectionCloudSync
    -InputObject <IResultObject#SMS_Collection>
    [-AddGroupName <string[]>]
    [-EnableAssignEndpointSecurityPolicy <bool>]
    [-RemoveGroupName <string[]>]
    [-TenantId <string>]
    [-TenantName <string>]
    [-TenantObject <IResultObject#SMS_AAD_Tenant_Ex>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetById

Set-CMCollectionCloudSync
    -Id <string>
    [-AddGroupName <string[]>]
    [-EnableAssignEndpointSecurityPolicy <bool>]
    [-RemoveGroupName <string[]>]
    [-TenantId <string>]
    [-TenantName <string>]
    [-TenantObject <IResultObject#SMS_AAD_Tenant_Ex>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetByName

Set-CMCollectionCloudSync
    -Name <string>
    [-AddGroupName <string[]>]
    [-EnableAssignEndpointSecurityPolicy <bool>]
    [-RemoveGroupName <string[]>]
    [-TenantId <string>]
    [-TenantName <string>]
    [-TenantObject <IResultObject#SMS_AAD_Tenant_Ex>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use this cmdlet to configure collection membership synchronization to Microsoft Entra groups for a device or user collection.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Enable a collection to synchronize members to Microsoft Entra group

The first command gets the collection object named testUserCollection and stores it in the $userCollection variable. The second command gets the Microsoft Entra tenant named contoso and stores it in the $AADTenant variable. The third command enables the synchronization of the collection with Microsoft Entra group named testUserGroup belonging to tenant name "contoso"

$userCollection = Get-CMCollection -Name "testUserCollection"
$AADTenant = Get-CMAADTenant -Name "contoso"
Set-CMCollectionCloudSync -InputObject $userCollection -AddGroupName "testUserGroup" -EnableAssignEndpointSecurityPolicy $true -TenantObject $AADTenant

Example 2: Remove collection synchronization with Microsoft Entra group

The first command gets the collection object named testUserCollection and stores it in the $userCollection variable. The second command removes the synchronization of the collection with Microsoft Entra group named testUserGroup belonging to tenant name "contoso", which is passed as value for -TenantName parameter. Alternatively -TenantId parameter can also be used.

$userCollection = Get-CMCollection -Name "testUserCollection"
Set-CMCollectionCloudSync -InputObject $userCollection -RemoveGroupName "testUserGroup" -EnableAssignEndpointSecurityPolicy $true -TenantName "contoso"

Parameters

-AADGroupName

Specify target Microsoft Entra group name with which the collection's members needs to be synchronized.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:True
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:False
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

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Parameter properties

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

Parameter sets

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

-EnableAssignEndpointSecurityPolicy

Use this parameter enable or disable the collection to show up in Intune portal to assign endpoint security policies in Tenant Attach scenario.

Parameter properties

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

Parameter sets

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

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Parameter properties

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

Parameter sets

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

-Id

Specify the ID of the collection to configure. This value is the CollectionID property, for example, XYZ00012.

Parameter properties

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

Parameter sets

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

-InputObject

Specify a collection object to configure. To get this object, use the Get-CMCollection, Get-CMDeviceCollection, or Get-CMUserCollection cmdlets.

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Collection

Parameter sets

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

-Name

Specify the name of a collection to configure.

Parameter properties

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

Parameter sets

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

-RemoveGroupName

Use this parameter to remove synchronization with the specified Microsoft Entra group.

Parameter properties

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

Parameter sets

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

-TenantId

Specify the ID of the Microsoft Entra tenant. This value is the TenantId property, for example, 72f988bf-00ab-11cd-22ef-2d7cd011db00.

Parameter properties

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

Parameter sets

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

-TenantName

Specify the name of the Microsoft Entra tenant, for example, contoso.

Parameter properties

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

Parameter sets

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

-TenantObject

Specify an object for the Microsoft Entra tenant. To get this object, use the Get-CMAADTenant cmdlet.

Parameter properties

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

Parameter sets

(All)
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 doesn't run.

Parameter properties

Type:SwitchParameter
Default value:False
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.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object