Powershell Flashcards Preview

Windows Server 70-740 > Powershell > Flashcards

Flashcards in Powershell Deck (23):
1

Show basic networking info.

Get-NetAdapter

2

Show ip info. Similar to ipconfig

Get-NetIPConfiguration

3

Set IP, subnet, and gateway.

Set-NetIPAddress -InterfaceIndex 2 -IPAddress 192.168.1.100 -PrefixLength 24 -DefaultGateway 192.168.1.1

4

Set DNS server.

Set-DNSClientServerAddress -InterfaceIndex 2 -ServerAddress (“8.8.8.8”, “8.8.4.4”)

5

View firewall information

Get-NetFirewallProfile

6

Set firewall.

Set-NetFirewallProfile - Profile private,public,domain -Enabled True

7

Rename computer.

Rename-Computer -NewName COMPUTERNAME -Restart

8

Rename domain joined computer.

Rename-Computer -NewName COMPUTERNAME -DomainCredential “domain\username” -Force -Restart

9

View computer name.

$env:COMPUTERNAME

10

View all powershell commands.

Get-Command

11

View specific powershell commands.

Get-Command -Module or *net* or -Noun net*

12

View powershell help.

Get-Help powershell-command-name

13

Add computer to domain.

Add-Computer -DomainName domainname.com

14

Update powershell help files.

Update-Help

15

Start powershell connection to remote computer.

Enter-PSSession -ComputerName COMPUTERNAME

16

View all available features/roles.

Get-WindowsFeature

17

View installed features/roles.

Get-WindowsFeature | Where-Object Installed -eq True

18

Install a server role/feature.

Install-WindowsFeature -Name Web-Server, Web-Mgmt-Service

19

Configure server for remote management.

Set-ItemProperty -Path “HKLM:\Software\Microsoft\WebManagement\Server” -Name “EnableRemoteManagerment” -Value 1

20

Set remote management service to start automatically.

Set-Service WMSCV -StartupType Automatic

21

Exit remote powershell connection.

Exit-PSSession

22

Send a powershell command to a remote computer using http (firewall on).

Invoke-Command -ComputerName COMPUTERNAME -ScriptBlock {Get-Service W3SVC, WMSVC }

23

Send a powershell command to a remote computer using dcom (will not work with firewall on).

Get-Service -ComputerName COMPUTERNAME