0% found this document useful (0 votes)
9 views

02 Command Reference

The document outlines various command-line and PowerShell commands for managing Windows servers, including shutdown, directory changes, and network configuration. It details commands for creating and managing virtual hard drives, installing server features, and configuring replication of volumes. Additionally, it provides descriptions of each command's functionality and usage context.

Uploaded by

Barry abdoul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

02 Command Reference

The document outlines various command-line and PowerShell commands for managing Windows servers, including shutdown, directory changes, and network configuration. It details commands for creating and managing virtual hard drives, installing server features, and configuring replication of volumes. Additionally, it provides descriptions of each command's functionality and usage context.

Uploaded by

Barry abdoul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Command Options

/s
shutdown
/c “my own reason”
cd
.\NanoServerImageGenerator
Import-Module
-Verbose

-Edition Standard/Datacenter
New-NanoServerImage -DeploymentType Host/Guest
-MediaPath d:\
-TargetPath .\[folder]\[filename].vhd
-ComputerName [computer name]
Set-ExecutionPolicy RemoteSigned

ipconfig /all

interface ipv4/ipv6
show interfaces
set address
name=”#”
course=static/dhcp
netsh address=#.#.#.#
mask=#.#.#.#
gateway=#.#.#.#
add dnsserver
address=#.#.#.#
index=“#”
add address
address=#.#.#.#
mask=#.#.#.#*
hostname
Join
netdom [computer name]
/domain:[domainname]

Rename-Computer -NewName [computer name to be assigned]


-restart

-Name [feature name from Get…]


Install-WindowsFeature -VHD*\\[unc to vhd file]
-ComputerName [name of Hyper-V Server to mount the drive]
-Restart
Get-WindowsFeature

/package
smigdeploy /architecture amd64/x86
/os WS12R2/WS12/WS08R2/WS08
/path [local path to an existing folder]
Get-SmigServerFeature
Export - -FeatureID [name from Get-SmigServerFeature output]
SmigServerSetting -Path [path to create the export file]
net stop “[service name]”
Import- -FeatureID [name from Get-SmigServerFeature output
SmigServerSetting -Path [location of file from source]

Volume (eg: e:)


convert
/FS:NTFS

Uninstall-
-Remove
WindowsFeature

Where-Object -FilterScript{$_.Installed -Eq $FALSE}


diskpart
file=“[path and file of vhd to create]”
create vdisk maximum=1000
type=fixed/expandable
select vdisk file=“[path and file of existing vhd]”
convert mbr

Primary
create partition Extended
Logical
Size=[drive size in MB]
fs=fat/ntfs/refs
format label=“[name the partition]”
quick
assign letter=[select an unused letter]
Get-Command -Module StorageReplica

-SourceComputerName [server name]


-SourceRGName [assign a name]
-SourceVolumeName [local mount point of partition to be replicated]
-SourceLogVolumeName [local mount point of the partition that will hold the
log file]
New-SRPartnership -DestinationComputerName [server name]
-DestinationRGName [assign a name]
-DestinationVolumeName [local mount point of partition to receive
replication]
-DestinationLogVolumeName [local mount point of the partition that will
hold the log file]
-LogSizeInBytes [#]gb
Description Environment
Shuts down Windows on the local machine; with an optional switch it can
cmd
shut down a remote Windows server or workstation
Changes directories on the same logical drive cmd
Adds commands and comandlettes to PowerShell; in this case it adds the
PowerShell
scripts to create virtual hard drives prepared with Nano Server installations

PowerShell
Creates a virtual hard drive with Nano Server installed; module must be
added first
Allows scripts to run even if the local machine has not approved them, so
PowerShell
long as they are remotely signed
Views configuration of IP v4 and v6 on the local machine; optional switches
cmd
allow minimal configuration

Sets IP configuration on the local machine; with an optional switch it can


cmd
configure a remote machine as well

Displays the computer name of the local machine cmd

Changes the domain membership of the local machine or a remote machine cmd

PowerShell
Changes the computer name in Server 2016 and Windows 10

PowerShell
Installs server role or feature to a local machine or to a virtual hard drive file
that is not currently in use
Lists available roles and features in Windows, indicating which have been
PowerShell
installed

cmd
Creates an executable for a specific remote server to package a role for
migration
This option for the Get command will display all roles available for migration PowerShell Server
from the current server. Migration
Saves all configuration of the specified feature (role) to a folder that can be PowerShell Server
taken to a new server and applied using the simiar Install command Migration
Stops a service on a Windows server or workstation cmd
Applies settings from a previous export to complete the role migration PowerShell Server
process Migration
Changes a disk format from FAT to NTFS without disrupting the contents of
properties of the drive; this is not commonly used because it will only convert cmd
FAT to NTFS

Uninstalls a role or feature from a Windows server PowerShell

Filters or selects information that meets a certain criteria; this was also used
PowerShell
in wmic when searching for the object: NAME
Commandline disk management tool for Windows servers and workstations elevated cmd

DiskPart
Creates a blank virtual hard drive within DiskPart
Selects a virtual hard disk file to mount and manage DiskPart
Sets the partition type of a selected physical or virtual disk to Master Boot DiskPart
Record

DiskPart
Creates new partitions in unallocated space on a selected physical or virtual
hard drive

DiskPart / cmd
Formats a partition of volume
Assigns a drive letter as a mount point for a partition of volume DiskPart
Loads commands for a specific module; in this case it loads the commands to
PowerShell
create replication of a volume to a remote server

PowerShell

Creates a redundant copy of a volume or partition to a remote server


Chapter and Movie
01_03
01_05
01_05

01_05

01_05

02_01

02_01

02_06

02_06

02_06

03_03

03_03
03_06

03_04

03_04
03_04
03_04

03_04

03_04

03_06

03_06
04_04

04_04

04_04
04_04

04_04

04_04

04_04
04_05

04_05

You might also like