Upgrade Server 2016 Standard to Server 2016 Datacenter

If you need to change the edition of Server 2016 you can use the following command.

DISM /online /Set-Edition:<edition> /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula

To check what editions you can change to use:

DISM /online /Get-TargetEditions

Here are the standard product keys for each edition.

Windows Server 2016 Datacenter CB7KF-BWN84-R7R2Y-793K2-8XDDG
Windows Server 2016 Standard WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY
Windows Server 2016 Essentials JCKRF-N37P4-C2D82-9YXRT-4M63B
Windows Server 2019 Standard N69G4-B89J2-4G8F4-WWYCC-J464C
Windows Server 2019 Datacenter WMDGN-G9PQG-XVVXX-R3X43-63DFG

Upgrade to Windows 10 Professional installs Enterprise

  1. Open the Settings app and click Update & Security.
  2. Open Activation and click Change product key.
  3. Enter your Windows 10 Professional product key and click Next.
  4. Restart the computer after the new product key is activated.

You can force a downgrade with the default product key (VK7JG-NPHTM-C97JM-9MPGT-3V66T) of Windows 10 Professional.

Windows Deployment Server DHCP Options

Windows Deployment Server normally just works after installation, but if for some reason you need to set these values manually in DHCP, here are the DHCP Options that you need for a standard UEFI boot. 

Set the 066 Boot Server Host Name to your Windows Deployment Server IP address.

Set the 067 Bootfile name to boot\x64\wdsmgf.efi

 

Get Disk Space using PowerShell

Run the following script:

Get-WmiObject -Class Win32_logicaldisk -Filter "DriveType = '3'" | Select-Object -Property DeviceID, DriveType, VolumeName, @{L='FreeSpaceGB';E={"{0:N2}" -f ($_.FreeSpace /1GB)}}, @{L="Capacity";E={"{0:N2}" -f ($_.Size/1GB)}}

How to set Service recovery options via PowerShell

Run this function, then run the new Cmd-let that it creates. Replace the server name with the one you want to set the settings for. Replace the Service name with the Display name of the service you want to set.

  1. function Set-ServiceRecovery{
  2. [alias('Set-Recovery')]
  3. param
  4. (
  5. [string] [Parameter(Mandatory=$true)] $ServiceDisplayName,
  6. [string] [Parameter(Mandatory=$true)] $Server,
  7. [string] $action1 = "restart",
  8. [int] $time1 = 30000, # in miliseconds
  9. [string] $action2 = "restart",
  10. [int] $time2 = 30000, # in miliseconds
  11. [string] $actionLast = "restart",
  12. [int] $timeLast = 30000, # in miliseconds
  13. [int] $resetCounter = 4000 # in seconds
  14. )
  15. $serverPath = "\\" + $server
  16. $services = Get-CimInstance -ClassName 'Win32_Service' -ComputerName $Server| Where-Object {$_.DisplayName -imatch $ServiceDisplayName}
  17. $action = $action1+"/"+$time1+"/"+$action2+"/"+$time2+"/"+$actionLast+"/"+$timeLast
  18. foreach ($service in $services){
  19. # https://technet.microsoft.com/en-us/library/cc742019.aspx
  20. $output = sc.exe $serverPath failure $($service.Name) actions= $action reset= $resetCounter
  21. }
  22. }
  23. Set-ServiceRecovery -ServiceDisplayName "My Service" -Server "PHOSTA"