Powershell Flashcards

1
Q

Show basic networking info.

A

Get-NetAdapter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Show ip info. Similar to ipconfig

A

Get-NetIPConfiguration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Set IP, subnet, and gateway.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Set DNS server.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

View firewall information

A

Get-NetFirewallProfile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Set firewall.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Rename computer.

A

Rename-Computer -NewName COMPUTERNAME -Restart

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Rename domain joined computer.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

View computer name.

A

$env:COMPUTERNAME

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

View all powershell commands.

A

Get-Command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

View specific powershell commands.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

View powershell help.

A

Get-Help powershell-command-name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Add computer to domain.

A

Add-Computer -DomainName domainname.com

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Update powershell help files.

A

Update-Help

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Start powershell connection to remote computer.

A

Enter-PSSession -ComputerName COMPUTERNAME

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

View all available features/roles.

A

Get-WindowsFeature

17
Q

View installed features/roles.

A

Get-WindowsFeature | Where-Object Installed -eq True

18
Q

Install a server role/feature.

A

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

19
Q

Configure server for remote management.

A

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

20
Q

Set remote management service to start automatically.

A

Set-Service WMSCV -StartupType Automatic

21
Q

Exit remote powershell connection.

A

Exit-PSSession

22
Q

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

A

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

23
Q

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

A

Get-Service -ComputerName COMPUTERNAME