PowerShell commands Flashcards
install Network Load Balancing
Install-WindowsFeature -IncludeAllSubFeature -IncludeManagementTools -Name “NLB”
join a domain
Add-Computer –DomainName sandbox.com -Credential sandbox\administrator -restart –force
disable a service
Set-Service -Name “MapsBroker” -StartupType Disabled
vs. Automatic or Manual
add/remove a vNIC from host
on host: Add-VMNetworkAdapter -VMName Sandbox-NLB02 -Name “Ethernet 2” -SwitchName Sandbox-vSwitch
(note this names it only w/in Hyper-V manager, not w/in the VM… but each new NIC will be added w/in the VM as Ethernet #)
Remove-VMNetworkAdapter -VMName Sandbox-NLB02 -Name “Ethernet 2”
set static IP addy
New-NetIPAddress -InterfaceAlias “Ethernet 2” -IPAddress 192.168.0.112 -PrefixLength 24 -DefaultGateway 192.168.0.1
install Failover Clustering
Install-WindowsFeature Failover-Clustering
install graphic failover clustering mgmt tools
Install-WindowsFeature RSAT-Clustering-MGMT
install PS failover clustering module
Install-WindowsFeature RSAT-Clustering-PowerShell
install network load balancing and tools
Install-WindowsFeature NLB
Install-WindowsFeature RSAT-NLB
stop and drain network load balancing on a single host, then start it again
Stop-NlbClusterNode -Drain -Hostname “NLBNODE2”
Start-NlbClustetNode -Hostname “NLBNODE2
discover the interface index of the adapters
Get-NetAdapter
Set IP addy by index
New-NetIpAddress -InterfaceIndex 6 -IPaddress 192.168.0.200 -PrefixLength 24
-DefaultGateway 192.168.0.1
Configure DNS addys
Set-DNCclientServerAddress -InterfaceIndex 6 -ServerAddresses
(“192.168.0.1”,”192.168.0.2”)
Rename computer whilst joining the domain
Add-Computer -DomainName foo.com -NewName ServerFoo -Credential foo\administrator
same at CMD:
1) netdom renamecomputer %computername% /newname: newcomputername
2) shutdown /r
3) netdom join %computername% /domain: domainname /userd: username /passwordd:*
(* = prompt for pw)
Update firewall to allow remote MMC management
Set-NetFirewallRule –name complusnetworkaccess-dcom-in –Enabled true
Set-NetFirewallRule –name remoteeventlogsvc-in-tcp –Enabled true
Set-NetFirewallRule –name remoteeventlogsvc-np-in-tcp –Enabled true
Set-NetFirewallRule –name remoteeventlogsvc-rpcss-in-tcp –Enabled true