Automating Administration with Windows PowerShell Flashcards

1
Q

Profile scripts are a Windows PowerShell feature that you can use to specify a list of commands that run every time you open a new Windows PowerShell session. True or False?

A

True

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

If you want a PowerShell profile script to be loaded for All user and for both PowerShell console and PowerShell ISE, which profile script location and file name should you use?

A

$pshome
(C:\Windows\System32\WindowsPowerShell\v1.0)

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

Write 2 methods to monitor the use of Windows PowerShell on a computer.

A

Transcript logging, module logging, script logging

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

Both -in and -contains operators support exact match, partial match and pattern match. True or False?

A

False

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

What command do you use to protect a users password input?

A

Read-Host “enter password here” -AsSecureString

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

If the Powershell cannot run external commands, one solution is to use “stop parsing symbol”.
Write the “stop parsing symbol” syntax:

A

–%

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

Windows PowerShell 5.0 logs suspicious script blocks automatically, even if script block logging is not enabled.
True or False?

A

True

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

List 2 applications in windows OS that can interact with PowerShell.

A

Powershell and Powershell ISE

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

You wish to join multiple computers to the Adatum domain. The Add-Computer cmdlet’s -ComputerName parameter accepts multiple values. Which of the following is a set of valid values for this parameter?

A

-ComputerName LON-CL2,LON-CL3,LON-CL4

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

What is the difference between Get-Help and Get-Command?

A

Get help prints the commands documentation to screen where get command only lists available commands.

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

PowerShell is Microsoft product, so that we cannot use it to manage Linux and macOS computers. True or False?

A

False

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

Which of the following cmdlet verbs is not associated with the ADUser noun?
Get
Update
New
Remove
Set

A

update

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

The default value for the -protectedFromAccidentalDeletion parameter of New-ADOrganizationalUnit is $true. True of False?

A

false

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

Which two parameters can you use with *-NetIPAddress cmdlets to identify a network interface?

A

-InterfaceAlias and -InterfaceIndex

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

What Windows feature must you install before you can use Hyper-V cmdlets?

A

Hyper-V

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

Which Windows PowerShell cmdlets should you pipe output to when you want to return specified properties of an object?

A

Select-Object

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

Which Windows PowerShell cmdlets should you pipe output to descending order based on specific properties?

A

Sort-Object

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

List the 3 basic formatting commands.

A

Format-Wide, Format-List and Format-Table

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

Name two techniques for pipeline parameter binding.

A

ByValue and ByPropertyName

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

Both Windows Management Instrumentation (WMI) and Common Information Model (CIM) support local, session based connection and ad-hoc connection. True or False?

A

True

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

If you query a computer multiple times in a short period of time, a CIM session offers much better performance than an ad-hoc connection. True or False?

A

True

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

All repository classes are well documented. True or False

A

False

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

PSProviders are adapters that connect Windows Powershell to data stores. True or False?

A

True

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

Both Array and ArrayList support the Add() and Remove() methods. True or False?

25
An array is a data structure that is designed to store a collection of items. True or False?
True
26
What is the PowerShell script extension in PowerShell 5.0?
.ps1
27
An organisation requires that downloaded PowerShell scripts must be signed by a trusted publisher before they can be run. However, scripts from the local computer don't need to be signed. Which PowerShell execution policy should you set?
RemoteSigned
28
Break stops processing the current iteration of a loop, while Continue completely stops loop processing True or False?
False
29
The ______________construct is used to run a script block a specific number of times based on the: Initial state; Condition and Action
For
30
Which one of following cmdlets is not correct to import data from external file to PowerShell? a. $Users=Get-Content “c:\Users.txt” b. $Users=Import-CSV “c:\Users.csv” c. $Users=Import-CliXML “c:\Users.xml” d. $Users=Import-JSON “c:\Users.json”
d
31
Adding comments and help documentation to your script make it easier for others to use. True or False?
True
32
How do you view the most recent error?
33
A switch parameter has a value of $true or $false. True or False?
34
When using Try..Catch construct to implement error handling, Finally section is optional. True or False?
True
35
You can use Try..Catch and provide different responses for different error types. True or False
True
36
Compared to dot sourcing, which technology is better to use when referencing functions in multiple scripts?
modules
37
__ __________ allow you to pause script processing and interact with the variables in the script.
read-host
38
For both non-terminating and terminating errors, you can use Try..Catch to display error messages in a friendly way. True or False?
True
39
Name 3 Windows PowerShell cmdlets to import data in different formats for use in your scripts.
Import-Csv Import-Clixml Get-Content
40
An Administrator creates a PowerShell script named process.ps1 and stores it in D:\ Why does administrator receive error when trying to run it using the command process.ps1?
They didnt specify the command path.
41
Name 3 variable types.
42
The following command is the most efficient way to produce a list of services that have names beginning with svc? Get-Service | Where Name –like n*svc True /False?
false
43
Which PowerShell cmdlets are NOT correct? (Choose 2) a. ConvertTo-CSV b. Export-CSV c. ConvertTo-CliXml d. Export-CliXml e. ConvertTo-JSON f. Export-JSON g. ConvertTo-HTML h. Export-HTML
f and h
44
When using PS Remoting, the Administrator needs to enable PS Remoting on both local and remote computers. True or False?
False
45
When using PS Remoting, the contents of the script block or file are transmitted as literal text to the remote computers. True or False?
True
46
Results received through remoting are static snapshot, don’t have methods or events. True or False?
True
47
What are three types of jobs?
local, remote and CIM/WMI
48
The Get-CIMInstance has an -AsJob parameter. True or False?
False
49
When using Receive-Job to retrieve job results, you can use -keep to retain a copy of the results in memory. Otherwise, the results are not maintained in memory. True or False?
True
50
Select the 3 components of a scheduled job (select 3) a. Job definition b. Job actions c. Job options d. Job principals e. Job triggers
actions, triggers and principals
51
The PS scheduled job results are stored in _____?
Both disk and memory.
52
Match the PS features with their correct description: 1. Implicit remoting 2. PSSessions 3. $Using a. It present a persistently running connection on the remote computer b. Which is known as scope modifier, it’s used to identify a local variable in a remote command c. Administrators do not have to install administrative tools such as Windows PowerShell commands on their local computers.
1-c 2-a 3-b
53
ISE offers two main panes. What are they?
Script and console pane.
54
What is the structure of the powershell cmdlet?
verb and noun
55
What enables you to enter commands much faster and make your code less prone to errors?
tab completion
56
Select the 3 PowerShell Active directory administration cmdlets from the list? a) Group b) VHD c) VM d) OU e) Managing routing f) User
a, d, f
57
Select 2 cmdlets to manager IIS a. New-Website b. Get-site c. Start-site d. Stop-Website
a, d
58
7. What are the ways to send output to a file using PowerShell? Select 2 answers a) > b) << c) Out-file d) && e) >>
c, e