WSUS Cleanup script: cannot connect to WSUS Server RRS feed

  • Question

  • 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.

    Monday, February 23, 2015 3:48 PM


All replies