Set-CMAssignedSite

Assigns a client computer to a primary site.

Syntax

Set-CMAssignedSite
   [-Confirm]
   -DeviceId <String>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-SiteCode <String>]
   [-WhatIf]
   [<CommonParameters>]
Set-CMAssignedSite [-Confirm] -DeviceName  [-DisableWildcardHandling] [-ForceWildcardHandling]
 [-SiteCode ] [-WhatIf] []
Set-CMAssignedSite [-Confirm] [-DisableWildcardHandling] [-ForceWildcardHandling] -InputObject 
 [-SiteCode ] [-WhatIf] []

Description

The Set-CMAssignedSite cmdlet assigns a client computer to a primary site. When you install a client agent, the installation determines the primary site for the client. This cmdlet assigns a client to a different primary site.

Examples

Example 1: Reassign a client to a site

PS C:\> Set-CMAssignedSite -DeviceId "2097152000" -SiteCode "CM7"

This command reassigns the client that has the device ID 2097152000 to the site that has the site code CM7.

Required Parameters

-DeviceId

Specifies an array of device IDs.

Type:String
Aliases:ResourceId
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DeviceName

Specifies an array of device names.

Type:String
Aliases:Name
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies a CMDevice object. To obtain a CMDevice object, use the Get-CMDevice cmdlet.

Type:IResultObject
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SiteCode

Specifies the site code of the new primary site to assign the client to.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False