Some super handy Nano Server 2016 trick’s

Here are some hany tricks!

Get all available commands

Get-Command -CommandType Cmdlet

Disk management


Resize to max

$size = (Get-PartitionSupportedSize –DiskNumber 0 –PartitionNumber 3)
Resize-Partition -DiskNumber 0 -PartitionNumber 3 -Size $size.SizeMax

Create new partition

Initialize-Disk 1 -PartitionStyle GPT
New-Partition -DiskNumber 1 -UseMaximumSize -AssignDriveLetter
Format-Volume -DriveLetter D

change driveletter

Get-Partition -DriveLetter D | Set-Partition -NewDriveLetter E

Set new Volume Name

Set-Volume -FileSystemLabel “MAIN” -NewFileSystemLabel “”

Create network share

mkdir ISO
net share “ISO=C:\Users\Administrator\ISO” “/GRANT:EVERYONE,FULL”

Enable dedup feature

dism /Online /Get-Features
dism /Online /Enable-Feature /FeatureName:Dedup-Core /all
Enable-DedupVolume -Volume D: -UsageType HyperV

Show saved space status


Windows Update

Check windows update

$sess = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession

$scanResults = Invoke-CimMethod -InputObject $sess -MethodName ScanForUpdates -Arguments @{SearchCriteria=”IsInstalled=0″;OnlineScan=$true}


Install updates

$scanResults = Invoke-CimMethod -InputObject $sess -MethodName ApplyApplicableUpdates

Cleanup afterwards (uninstall not possible after this action)

dism /online /Cleanup-Image /StartComponentCleanup /ResetBase

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s