Avatar of bnorrisatnortechsolutions
bnorrisatnortechsolutions

asked on 

POSH to check specific services for a list of servers

I need a script that would check for a list of services listed in a txt file for a list of servers in a txt file.  

I have several servers that I would like to check to see if certain services are running on them.  If the service does not exist on that server I would like the script to keep going and report nothing for that service.  

For example in my environment a sql server would not have IIS running on it, but a web server would.  So for the sql server I would like for the result set to return nothing for IIS, but the status obviously for the web server.

I then need the result set exported to a CSV file in the following format:

ServerName, ServiceName, CurrentState
Powershell

Avatar of undefined
Last Comment
soostibi
ASKER CERTIFIED SOLUTION
Avatar of soostibi
soostibi
Flag of Hungary image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Powershell
Powershell

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.

27K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo