Set-CMAssignedSite

Set-CMAssignedSite

Assigns a client computer to a primary site.

構文

Parameter Set: SearchByNameMandatory
Set-CMAssignedSite -DeviceName <String[]> -SiteCode <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByIdMandatory
Set-CMAssignedSite -DeviceId <String[]> -SiteCode <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByValueMandatory
Set-CMAssignedSite -InputObject <IResultObject> -SiteCode <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

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.

パラメーター

-DeviceId<String[]>

Specifies an array of device IDs.

エイリアス

ResourceId

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-DeviceName<String[]>

Specifies an array of device names.

エイリアス

Name

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-InputObject<IResultObject>

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

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-SiteCode<String>

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

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

Example 1: Reassign a client to a site

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

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

関連トピック

Get-CMDevice