Powershell Flashcards
Show basic networking info.
Get-NetAdapter
Show ip info. Similar to ipconfig
Get-NetIPConfiguration
Set IP, subnet, and gateway.
Set-NetIPAddress -InterfaceIndex 2 -IPAddress 192.168.1.100 -PrefixLength 24 -DefaultGateway 192.168.1.1
Set DNS server.
Set-DNSClientServerAddress -InterfaceIndex 2 -ServerAddress (“8.8.8.8”, “8.8.4.4”)
View firewall information
Get-NetFirewallProfile
Set firewall.
Set-NetFirewallProfile - Profile private,public,domain -Enabled True
Rename computer.
Rename-Computer -NewName COMPUTERNAME -Restart
Rename domain joined computer.
Rename-Computer -NewName COMPUTERNAME -DomainCredential “domain\username” -Force -Restart
View computer name.
$env:COMPUTERNAME
View all powershell commands.
Get-Command
View specific powershell commands.
Get-Command -Module or net or -Noun net*
View powershell help.
Get-Help powershell-command-name
Add computer to domain.
Add-Computer -DomainName domainname.com
Update powershell help files.
Update-Help
Start powershell connection to remote computer.
Enter-PSSession -ComputerName COMPUTERNAME