0

I'm trying to use the Get-Service command to find a service on a remote computer. What I'm basically doing is typing this:

Get-Service -ComputerName <Server> -Name <Service>

However when I get to the part where I'm wanting to provide my service name the selection window of services I can pick only displays Windows services and not the newly added one I added manually to the server. My service is called "Conec" however I dont see that in the list of suggested services and if I just type -Name Conec and run the script PowerShell says it can't find the service even though that's what its service name is.

So basically how do I Get-Service for services I've added myself, which aren't the standard Windows services?

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328

1 Answers1

0

as long as your service is register it should show up in get-service.
Try to lookup the displayname :

get-service -computername comp1.domain.com | ?{$_.displayname -match "conec"}
Loïc MICHEL
  • 24,935
  • 9
  • 74
  • 103
  • No checking the displayname doesn't show the server either, however after doing some reading around I think I know what the problem is ? @I think@ – Scott Fairclough Mar 20 '15 at 11:36
  • Sorry my last post cut off before I finished typing. Anyway it looks like I need to give permission for the remote serve to receive incoming requests from my source server. Also my remote server is in a different domain to my source server. So when I do a Get-Service I think I'm just getting a stock standard service list instead of the actual server list. So it looks like I have to do something with WinRM ??? – Scott Fairclough Mar 20 '15 at 11:39
  • yes that could be the problem, try to add your 'origin' server to the trusted list of the remote server (look http://stackoverflow.com/questions/21548566/how-to-add-more-than-one-machine-to-the-trusted-hosts-list-using-winrm/26497297#26497297 ) – Loïc MICHEL Mar 20 '15 at 13:11