Show Menu

server administration by

server administration commands


The Diskp­art.exe command utility can be used to manage hard drives and volumes on the local machine.
To get help with a specific command type the command with /?. For example, to get help with the ‘list’ Diskpart command type: list /?
Use the list volume option to display inform­ation about the disk volumes
To get help on how to load a registry hive into memory from disk, type: reg load /?
The following command will load the HKLM registry hive file located in ‘D:\Wi­ndo­ws­\Sys­tem32\ config­\so­ftware’ into a key file called Window­sSo­ftware reg load HKLM\W­ind­ows­Sof­tware D:\Win­dow­s\S­yst­em3­2\c­onf­ig­\sof­tware
Unload the HKLM\W­ind­ows­Sof­tware registry hive. reg unload HKLM\W­ind­ows­Sof­tware

Reg backup and restore

Backup the entire HKLM registry key to a file called HKLM.reg in the C:\Backup directory. reg export HKLM C:\Bac­kup­\HK­LM.reg
To create a Registry Hive file backup of the HKLM\S­oftware registry keys reg save HKLM\S­oftware C:\Bac­kup­\HK­LMS­oft­war­
Display all the currently available registry PSDrives: Get-PS­Drive –PSPro­vider registry
Display the keys and values under the HKCU\C­ontrol Panel key Get-Ch­ildItem “HKCU:­\Co­ntrol Panel” -recurse
Display the keys and values under the HKCU\C­ontrol Panel key whose name contains the string “Mouse”. Get-Ch­ildItem “HKCU:­\Co­ntrol Panel” -recurse | where name –like "­Mo­use­"
Display the content of the HKCU\C­ontrol Panel­\Mou­se­\Dou­ble­Cli­ckSpeed value. Get-It­emP­roperty “HKCU:­\Co­ntrol Panel­\Mou­se" -name Double­Cli­ckSpeed
Notice this value is set to 500. Change the value to 700. Set-It­emP­roperty “HKCU:­\Co­ntrol Panel­\Mouse” –name Double­Cli­ckSpeed –value 700

AD Restore

To find the Windows feature name of the Windows Server Backup, type: Get-Wi­ndo­wsF­eature "­*b­ack­up­*"
This should return a single feature, the Window­s-S­erv­er-­Backup feature. To install the feature, type: Get-Wi­ndo­wsF­eature "­*b­ack­up­*" | Instal­l-W­ind­ows­Feature
To start a System State backup of the Domain contro­ller, type: wbadmin start system­sta­teb­ackup -backu­pTa­rget:E: -quiet
To start the server in DSRM mode, type the following command: bcdedit /set safeboot dsrepair and then reboot
non author­itative
The following command will list all of the backup file versions available on the local machine. wbadmin get versions -backu­pta­rget:E:
wbadmin start system­sta­ter­ecovery -versi­on:­<MM­/DD­/YY­YY-­HH:­MM> -backu­pta­rget:E: -quiet
Start another command prompt and type: ntdsutil
Set the local NTDS store as the active instance activate instance NTDS
This will start the intera­ctive command enviro­nment. Type the following command: author­itative restore
Restore Subtree “OU=Cu­stomer Suppor­t,O­U=H­ami­lto­n,D­C=A­cme­,DC­=Com”
To remove the ‘safeboot’ boot option and restart the server normally, open a command prompt and type the following commands: bcdedit /delet­evalue safeboot shutdown /r /t 0

Remote management

New-Ne­tIP­Address –inter­fac­eAlias “Ethernet” –IPAddress 192.16­8.1­00.13 –Prefi­xLength 24
Set-DN­SCl­ien­tSe­rve­rAd­dress –Inter­fac­eAlias “Ethernet” –Serve­rAd­dresses 192.16­8.1­00.10
Add-Co­mputer –Domai­nName acme –Crede­ntial acme\a­dmi­nis­trator –restart
Type the following commands to enable remote event log management firewall rules: netsh advfir­ewall firewall set rule group=­”Remote Event Log Manage­ment” new enable=Yes
Get-Co­mmand | Where {$­ram­ete­rs.keys -like "­*C­omp­ute­rNa­me­*"}
Get-se­rvice –Compu­terName Acmeserver
Get-Wm­iObject Win32_­Com­put­erS­ystem –Compu­tername Acmese­rver, WINDOW­SCO­RES­ERVER
netsh advfir­ewall firewall set rule group=­"­Windows Management Instru­men­tation (WMI)" new enable=yes
From the Acmeserver virtual machine, start an Intera­ctive PowerShell session on the Window­s81-PC Enter-­PSS­ession Window­s81-pc
Install the Web Access gateway role. Instal­l-W­ind­ows­Feature –Name Window­sPo­wer­She­llW­ebA­ccess
To configure the Windows PowerShell Web Access gateway with the default settings using a self-s­igned certif­icate, type the following: Instal­l-P­swa­Web­App­lic­ation -UseTe­stC­ert­ificate
To see a list of all PSWA cmdlets, type: Get-Co­mmand PSWA -Comma­ndType cmdlet
The following command will create an author­ization rule that will allow the members of the domain admins group access to all of the Domain Contro­llers in the domain using the default Micros­oft.Po­wer­shell config­ura­tion: Add-Ps­waA­uth­ori­zat­ionRule –userG­rou­pName “acme­\domain admins” -Compu­ter­Gro­upName “acme­\Domain Contro­llers” –Confi­gur­ati­onName Micros­oft.Po­wer­shell

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi


No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          VLC (Windows & OS X) Keyboard Shortcuts
          Sublime Text 2 Windows Keyboard Shortcuts