Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

The assignment is as follows: Create a powershell cmdletwhich looks at the services which are running. The cmdletmust check the running services against a list of known allowed services and indicate...

1 answer below »
The assignment is as follows:
Create a powershell cmdletwhich looks at the services which are running. The cmdletmust check the running services against a list of known allowed services and indicate any which are not on the list. If theservice is not listed, then the cmdlet should provide information about the service and its status. The cmdlet should also determine if the service is on the autostart list. If the allowed services list determines that the service should be set to autostart, then it will do so. The cmdletshould give the option of adding the service to the allowed services list. The name of the services list should be settable as an attribute. The cmdlet must have a help function.


The following is the completed assignment with some directions. Please write a detailed report using the attached format.


Open an elevated Command Prompt, type the following and hit Enter:

sc query type= service > "%userprofile%\Desktop\ServicesList.txt"

This will save the list as a text file on your Desktop.

Use PowerShell to generate list of Windows Services

The Get-Service cmdlet is designed to retrieve information about the services installed on your computer. Using the Get-Service PowerShell cmdlet, you can generate a list of Windows Services running on your Windows 10/8/7 computer.

How to export Windows Services list

Open an elevated PowerShell console, type Get-Service and hit Enter. You will see a list of all the Services installed on your Windows system.

You can also filter out the results using the filtering capabilities of Windows PowerShell. Make use of the parameters to achieve this. You can generate a list of Running Services as well as Stopped Services. You can also sort them by name using the Sort-Object cmdlet. You can go a step forward and even output the list to GridView.

For instance, you can use the Get-Service cmdlet, filter the status on the word Running, and then output to the GridView, by using the following command:

Get-Service | Where Status -eq "Running" | Out-GridView

This will generate a list of the Running Services, and another window will open to show the result.

To retrieve information about Stopped Services on a remote computer, and output it to GridView, use -ComputerName parameter, as shown below:

Get-Service -ComputerName RemoteComputerName | Where Status -eq "Stopped" | Out-GridView

To export the list of Windows Services, use the following command:

Get-Service | Where-Object {$_.Status -eq "Running"} | Out-File -filepath "$Env:userprofile\Desktop\ServicesList.txt"

This will save the list as a text file on your Desktop.

Answered Same Day Mar 11, 2022

Solution

Chirag answered on Mar 12 2022
104 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here