Configure a WSUS client using PowerShell

I want to configure a Windows Server 2012 to be a client of a WSUS server that is on the network. I want to use PowerShell and avoid using Active Directory.

From a WSUS client server with PowerShell 4 and Windows Server 2012 RS, I tried this three line script:

$wsusserver = ‘FQDNofWSUSserver’
[void][reflection.assembly]::LoadWithPartialName(“Microsoft.UpdateServices.Administration”)
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer($wsusserver,$False)

I got this: “Unable to find type [Microsoft.UpdateServices.Administration.AdminProxy]. Make sure that the assembly that contains this type is loaded…”

Maybe you could try to edit the local security policy on the computer.
Please be aware that the local sec policies will get overridden if a similar GPO is targeting the computer.

All the word is done for you :wink:

https://gallery.technet.microsoft.com/scriptcenter/Set-ClientWSUSSetting-2e84b805