PowerShellを使用してリモートサーバーのWindows更新設定を変更しようとしていますが、以下のコマンドを実行するとエラーが表示されます。 RemotePSセッションでWindows Update COMオブジェクトを使用できません
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
私は、サーバー上でローカルに実行したときに、それが正常に動作しますが、
...は、誰も私を助けてくださいでした。
いいえRDP経由でサーバーにアクセスするときにコマンドを実行するとエラーが表示されない – PowerShell
Ok、どのバージョンのPowerShellをRDP、x86、またはx64経由で実行しますか? – stej