Random Commands

Reboot Immediatley Shutdown /f /r /t 0 PSExec PsExec \\computer -u domain\username cmdPsExec \\computer cmd PSExec \\computer -s powershell Enable-PSRemoting -Force

Check if a Windows Update is Installed

Quick powershell command to check if a windows update is installed on a computer. Lists all hotfixes installed on a system Get-HotFix Checks if a specific hotfix is installed Get-HotFix -id KBXXXXXX Microsoft documentation about the Get-HotFix command https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-hotfix?view=powershell-7.1

AnyDesk

Silent install for AnyDesk. Can be run with PSExec for a remote or silent install. @echo offAnyDesk.exe –install “%programfiles%\Anydesk” –start-with-win –silent –create-shortcuts –create-desktop-iconecho password | “%programfiles%\Anydesk\AnyDesk.exe” –set-password Once installed you can remotley get the AnyDesk Id of the system with the below command “%programfiles%\AnyDesk\AnyDesk.exe” –get-id

Automate Windows Update

From an administrative powershell session use the below code to enable windows updates. The update process will not reboot the system when completed. Set-ExecutionPolicy RemoteSignedInstall-Module -Name PSWindowsUpdateAdd-WUServiceManager -MicrosoftUpdate Install-WindowsUpdate -MicrosoftUpdate -AcceptAll
1 2 3 9