Question: owershell script running on Virtual machine The script you will create will list all of the currently running services, on the server where the script

owershell script running on Virtual machine

The script you will create will list all of the currently running services, on the server where the script is executed, that begin with a certain, user supplied (an input parameter to the script), prefix (e.g., A*, *c*, m*, A*, or some variation). List only the service name, display name, and service type in your output.

Hints: (1) Youll need to ask the user to input the search pattern to match against the running services.

(2) Use the cmdlets get-service, format-table, where-object, get-member to accomplish your tasks.

(3) Use get-content on the ENV variable to determine the name of the host computer.

example:

owershell script running on Virtual machine The script you will create will

Mark - Server 2016- S1 Runningl Oracle VM VirtualBox File Machine View Input Devices Help Administrator Windows PowerShell indows PowerShell R Copyright (C) 2016 Microsoft Corporation. A11 rights reserved. Ps C:lusers administrator MyScripts> get-runningservice.psl a The following Name DisplayName DWS Active Directory Web Services Win320wnProcess services are currently unning on: MARK-SERVER-1 ServiceType List of Running Services Complete Script terminating. . PS C:lusers\administrator MyScripts> .get-runningservice.psl se* he following Name DisplayName SENS System Event Notification Service Win32ShareProcess services are currently running on MARK-SERVER-1 ServiceType List of Running Services Complete Script terminating PS C:\users\administrator MyScripts get-runningservice.psl m* The fol1owing ame DisplayName psSvc Windows Firewal1 services are currently running on MARK-SERVER-1 ServiceType Win32ShareProcess SDTC Distributed Transaction Coordinator Win320wnProcess List of Running Services Complete Script terminating. PS C:\users\ administrator MyScripts>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!