0

PowerShellを使用してリモートサーバーのWindowsUpdate設定を変更しようとしていますが、以下のコマンドを実行するとエラーが発生します。

PS C:\Windows\system32> Enter-PSSession opalisbinary

[opalisbinary]: PS C:\Users\superv\Documents> $AUSettings = (New-Object -com "Microsoft.Update.AutoUpdate").Settings
[opalisbinary]: PS C:\Users\superv\Documents>  $AUSettings.NotificationLevel=2
Property 'NotificationLevel' cannot be found on this object; make sure it exists and is settable.
At line:1 char:14
+  $AUSettings. <<<< NotificationLevel=2
    + CategoryInfo          : InvalidOperation: (NotificationLevel:String) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound



[opalisbinary]: PS C:\Users\superv\Documents>  $AUSettings.IncludeRecommendedUpdates=$true


Property 'IncludeRecommendedUpdates' cannot be found on this object; make sure it exists and is settable.
At line:1 char:14
+  $AUSettings. <<<< IncludeRecommendedUpdates=$true
    + CategoryInfo          : InvalidOperation: (IncludeRecommendedUpdates:String) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

[opalisbinary]: PS C:\Users\superv\Documents>  $AUSettings.Save()


You cannot call a method on a null-valued expression.
At line:1 char:18
+  $AUSettings.Save <<<< ()
    + CategoryInfo          : InvalidOperation: (Save:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

サーバー上でローカルに実行すると正常に動作しますが...

誰か助けてくれませんか。

4

2 に答える 2

0

リモートデスクトップ経由で接続してコマンドを実行すると機能しますか?それはまたbittnesに依存します。Microsoft.Update.AutoUpdateがわからないので、推測しているだけですが、PowerShellのx64バージョンで利用できますか?つまり、x64バージョンとx86でローカルに実行すると、エラーが表示されますか?

于 2012-02-02T12:50:44.320 に答える
0

申し訳ありませんが、本当の答えが見つかりませんでした。私が見つけたのは、SCCM 2012 ではリモート PS セッションを使用できるが、SCCM 2007 では使用できないと述べているこのリンクです。

これは役に立ちませんが、すべての COM オブジェクトがリモート PS セッションと互換性があるわけではないようです。

于 2012-02-02T13:06:14.063 に答える