Skip to content

Instantly share code, notes, and snippets.

@EmmanuelTsouris
EmmanuelTsouris / MSFT_WUOperationsSession.ps1
Last active January 11, 2018 19:04
Windows Server 2016 and Nano Server CimMethods for Windows Updates using MSFT_WUOperationsSession
Write-Host "Installed Updates"
$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession
$result = $ci | Invoke-CimMethod -MethodName ScanForUpdates -Arguments @{SearchCriteria="IsInstalled=1";OnlineScan=$true}
$result.Updates
Write-Host "Missing Updates"
$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession 
@thomasalley
thomasalley / WinRM-Insecure-Bootstrap.ps1
Last active December 12, 2017 17:32
Quickly bootstrap a Windows host to allow insecure connections. Also creates an HTTPS listener with a self-signed cert.
winrm quickconfig -q -force
Enable-psremoting –force
Set-executionpolicy bypass –force
winrm set winrm/config/service/Auth '@{Basic="true"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}'
winrm set winrm/config/client '@{TrustedHosts="*"}'
# Configuration Warning: