I am trying to filter services running in server using powershell script.But the syntax seems not in proper way
Script
Get-Service -ComputerName $ServerName |Where-Object {$_.Name -like "DEX*" -or $_.Name -like "WORLD*" -or $_.Name -like "Entr*"}
the highlighted section is having the problem.Any help is well appreciated..
In Get-Service Name property match the short name of the service. Don't you need the DisplayName ?
Get-Service -ComputerName $ServerName |Where-Object {$_.DisplayName -like "DEX*" -or $_.DisplayName -like "WORLD*" -or $_.DisplayName -like "Entr*"}
Another thing, your services short or display names are really begining by WORLD or Entr ?
Once you know you are looking for displayname, here is a shortest way :
get-service -displayname DEX*,WORLD*,Entr*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With