Update-SCSMClassInstance

クラス インスタンスのプロパティ値を更新します。

構文

Update-SCSMClassInstance
      [-Instance] <EnterpriseManagementInstance[]>
      [-PassThru]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

説明

Update-SCSMClassInstance コマンドレットは、クラス インスタンスのプロパティ値を更新します。

例 1: クラス インスタンスの削除をマークする

PS C:\>Get-SCSMClassInstance (Get-SCSMClass -Name "System.Printer") | % { $_.ObjectStatus = "pending delete"; $_ } | Update-SCSMClassinstance

このコマンドは、System.Printer クラスのすべての構成項目インスタンスを更新して、削除のマークを付けます。

例 2: Service Manager構成項目インスタンスの場所の値を変更する

PS C:\>Get-SCSMClassInstance -Class (Get-SCSMClass -Name "Microsoft.Ad.Printer") -Filter 'Location -eq "Seattle"' | Format-Table UNCName,PrinterName,Description,Location
UNCName                PrinterName Description Location
-------                ----------- ----------- --------
\\PrintServer\Printer4 Printer4                Seattle
\\PrintServer\Printer7 Printer7                Seattle
\\PrintServer\Printer1 Printer1                Seattle
\\PrintServer\Printer9 Printer9                Seattle
\\PrintServer\Printer6 Printer6                Seattle
\\PrintServer\Printer3 Printer3                Seattle
\\PrintServer\Printer2 Printer2                Seattle
\\PrintServer\Printer5 Printer5                Seattle
\\PrintServer\Printer0 Printer0                Seattle
\\PrintServer\Printer8 Printer8                Seattle


PS C:\>Get-SCSMClassInstance -Class (Get-SCSMClass -Name "Microsoft.Ad.Printer") -Filter 'Location -eq "Seattle"'| % { $_.Location = "Portland"; $_ } | Update-SCSMClassInstance
PS C:\>Get-SCSMClassInstance -Class (Get-SCSMClass -Name "Microsoft.Ad.Printer") -Filter 'Location -eq "Portland"' | Format-Table UNCName,PrinterName,Description,Location
UNCName                PrinterName Description Location
-------                ----------- ----------- --------
\\PrintServer\Printer4 Printer4                Portland
\\PrintServer\Printer7 Printer7                Portland
\\PrintServer\Printer1 Printer1                Portland
\\PrintServer\Printer9 Printer9                Portland
\\PrintServer\Printer6 Printer6                Portland
\\PrintServer\Printer3 Printer3                Portland
\\PrintServer\Printer2 Printer2                Portland
\\PrintServer\Printer5 Printer5                Portland
\\PrintServer\Printer0 Printer0                Portland
\\PrintServer\Printer8 Printer8                Portland

このコマンドは、Service Manager構成項目インスタンスの場所の値を変更します。

パラメーター

-Confirm

コマンドレットの実行前に確認を求めるメッセージが表示されます。

Type:System.Management.Automation.SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Instance

更新するクラスのインスタンスを指定します。

Type:Microsoft.EnterpriseManagement.Core.Cmdlets.Instances.EnterpriseManagementInstance[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PassThru

更新が完了した後、クラス インスタンスが現在のWindows PowerShell セッションに返されることを示します。 この出力オブジェクトは、他のコマンドレットに渡すことができます。

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

コマンドレットの実行時に発生する内容を示します。 このコマンドレットは実行されません。

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

入力

Microsoft.EnterpriseManagement.Core.Cmdlets.Instances.EnterpriseManagementInstance

Update-SCSMClassInstance コマンドレットの Instance パラメーターにクラス インスタンスをパイプできます。

出力

EnterpriseManagementInstance

このコマンドレットは、パラメーターの使用時に EnterpriseManagementInstance オブジェクトを PassThru 生成します。