Question

 Using the Commands add-on: step-by-step exercises In this exercise, you will explore using the Commands add-on by looking for cmdlets related to WMI.
You will then select the Invoke-WmiMethod cmdlet from the list and create new processes. Following this exercise, you will use Windows PowerShell ISE snippets to create a WMI script.
Using the Commands add-on to use WMI methods
1. Start the Windows PowerShell ISE.
2. Use the Commands add-on to search for cmdlets related to WMI.
3. Select the Invoke-WmiMethod cmdlet from the list.
4. In the class block, add the WMI class name Win32_Process.
5. In the name block, enter the method name create.
6. In the argument list, enter notepad.
7. Click the Run button. In the output console, you should see the following command, and on the next line the output from the command. Sample output appears here:
PS C:\Windows\system32> Invoke-WmiMethod -Class win32_process -Name create -ArgumentList notepad (note: your processID will more than likely be different than mine).
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 2
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ProcessId : 2960
ReturnValue : 0
PSComputerName :
Modify the ArgumentList block by adding calc to the argument list.
Use a semicolon to separate the arguments, as shown here:
Notepad; calc
9. Click the Run button a second time to execute the revised command.
10. In the Commands add-on, look for cmdlets with the word process in the name. Select the Stop-Process cmdlet from the list of cmdlets.
11. Choose the name parameter set in the parameters for StopProcess block.
12. In the Name box, type notepad and calc. The command appears here:
notepad, calc
13. Click the Run button to execute the command.
14. Under the name block showing the process-related cmdlets, choose the Get-Process cmdlet.
15. In the name parameter set, enter calc, notepad.
16. Click the Run button to execute the command.
Two errors should appear, stating that the calc and notepad processes aren’t running. The errors appear here:
PS C:\Windows\system32> Get-Process -Name calc, notepad
Get-Process : Cannot find a process with the name "calc". Verify the process name and call the cmdlet again.
At line:1 char:1
+ Get-Process -Name calc, notepad
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (calc:String) [Get-Process], ProcessCommandException
+ FullyQualifiedErrorId :
NoProcessFoundForGivenName,Microsoft.PowerShell.
Commands.GetProcessCommand
Get-Process : Cannot find a process with the name "notepad". Verify the process name and call the cmdlet again.
At line:1 char:1
+ Get-Process -Name calc, notepad
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (notepad:String) [Get-Process], ProcessCommandException
+ FullyQualifiedErrorId :
NoProcessFoundForGivenName,Microsoft.PowerShell.
Commands.GetProcessCommand
This concludes the exercise.
1. Save your screenshot output of each step in word document. Each screenshot must have a heading or a title or text indicating what the screenshot output represents.
(At least 12 screenshots output if not more)
2. Save as (LastName_Exercise) and attach the file

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

This task was achieved in two different ways:
a) by entering in the command line the following (the output can be seen in the above left pane):
Get-Command -noun wmi*            

b) by searching with “wmi” set as filter in the commands GUI modules (the output can be seen in the above right pane)....

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

Get help from a qualified tutor
Live Chats