Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

WSUS Cleanup script: cannot connect to WSUS Server

$
0
0

Hi guys,

I'm trying to apply a script (already posted) which allows to perform the WSUS server cleanup with an unattended way.

The script begins as follow:

[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null
#...Get hostname...
$sysinfo = Get-WmiObject -Class Win32_ComputerSystem
$fullname = “{0}.{1}” -f $sysinfo.Name, $sysinfo.Domain
#...Connection to WSUS...
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer($fullname,$false,8530)

The $fullname variable returns the expected info, but $wsus doesn't. It displays the following:

Exception calling "GetUpdateServer" with "3" argument(s): "Request for principal permission failed."
At C:\Users\*******\Desktop\WSUS_Server_Cleanup.ps1:7 char:1+ $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer($f ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException+ FullyQualifiedErrorId : SecurityException


Please could anybody tell me what am I doing wrong???

Thanks a lot in advance!

Best Regards.


Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>