# Windows

# Scripts - Disable Windows Updates

```
Clear-Host

$WindowsUpdatePath = "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\"
$AutoUpdatePath = "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"

If(Test-Path -Path $WindowsUpdatePath) {
    Remove-Item -Path $WindowsUpdatePath -Recurse
}

New-Item $WindowsUpdatePath -Force
New-Item $AutoUpdatePath -Force

Set-ItemProperty -Path $AutoUpdatePath -Name NoAutoUpdate -Value 1

Get-ScheduledTask -TaskPath "\Microsoft\Windows\WindowsUpdate\" | Disable-ScheduledTask

takeown /F C:\Windows\System32\Tasks\Microsoft\Windows\UpdateOrchestrator /A /R
icacls C:\Windows\System32\Tasks\Microsoft\Windows\UpdateOrchestrator /grant Administrators:F /T

Get-ScheduledTask -TaskPath "\Microsoft\Windows\UpdateOrchestrator\" | Disable-ScheduledTask

Stop-Service wuauserv
Set-Service wuauserv -StartupType Manual

Write-Output "All Windows Updates were disabled"

```

References:

- [https://stackoverflow.com/a/49790849](https://stackoverflow.com/a/49790849)

# Windows - Administration References

## Windows Server RDP Port Registry Path

**Path**: `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp`  
**Attribute name**: `Port Number`

## Remove Windows License Key

To remove the product key from a Windows Server 2008 (R2) follow these steps:

1. Open command prompt as administrator: 
    1. ```
        START->RUN->”cmd” (right-click -> run as administrator)
        ```
2. Type in: `slmgr -upk`
3. Wait a few seconds until windows confirms the removal of the product key.