get-help syntax
Eg: get-help get-vmhost
get-help syntax -examples = displays help with examples

Server Configuration

Type cmdlet sconfig

Install a feature using an exported configuration file:

Install-WindowsFeature –ConfigurationFilePath FILENAME
Eg: Install-WindowsFeature –ConfigurationFilePath x:\filename.xml

Convert VHD to VHDX:

ConvertVHD –Path (path) –DestinationPath (path)
Eg:  Convert-VHD –Path c:\drive1.vhd – DestinationPath c:\drive1.vhdx

Remote Administration of Server from Workstation:

Run following cmdlets
Netsh advfirewall firewall set rule group=”Windows Management Instrumentation (WMI)” new enable=yes
Netsh advfirewall firewall set rule group=”Remote Event Log Management” new enable=yes

Roles & Features

Remove a feature
Uninstall-WindowsFeature  xxxx –Remove
Eg: “Uninstall-WindowsFeature  WINS –Remove

Display windows features

Feature on Demand – remove unused files from winsxs (Windows sidy by side ) folder
Get-WindowsFeature | Where-Object –FilterScript { $_.Installed –Eq $FALSE }  =  Displays all not installed features
Get-WindowsFeature | Where-Object –FilterScript { $_.Installed –Eq $FALSE } | Uninstall-WindowsFeature – Remove = Removes not installed feature from winsxs folder.

Install Minimal GUI Interface from core OS

First specify source file. Use media or ISO image
Open command prompt and type dism /get-wiminfo /wimfile:f:\sources\install.wim (F drive is installation media)
This will display the list of OS in index eg: index :1
Open powershell type cmdlet Install-WindowsFeature server-gui-mgmt-infra -source wim:f:\sources\install.wim:1 (1 is index of OS which displayed in previous command)
run cmdlet restart-computer

Install full GUI Interface from minimal or core OS

Run powershell cmdlet Install-WindowsFeature server-gui-shell -source wim:f:\sources\install.wim:1 (1 is index of OS which displayed in previous command)
Run cmdlet restart-computer

Convert to minimal OS from full GUI OS

Go to server manager >> Remove Role and Features >> Features >> User Interface and Infrastructure >> Uncheck Server Graphical Shell

Resource Metering on Hyper-V:
get-vm =  displays the virtual machine from hyper-v host
get-vm | Enable-VMResourceMetering = Enables resource metering for all VMs




Leave a Reply

Your email address will not be published.