Link to home
Start Free TrialLog in
Avatar of WeTi
WeTi

asked on

Using Powershell stop multi services.

Dear expert

I would like to know how I write this command in powershell.

I would stop all Services that have service name: Aptic ifront of servicename, for exemple: the name can be: ApticApp1, ApticApp2, all services that got Aptic stop it. if failed stop return a variable $failstop. Services is not on local computer so a network computername or IP is needed.

How do i do? Thanks.
Regards
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WeTi
WeTi

ASKER

Hi oBdA

-ComputerName RemoteMachine here if computer in network called: weti, then its -ComputerName weti or -ComputerName \\weti? If i want to use IP instead how to do then?

Thanks
Just the name, FQDN, or IP address, no backslashes.
Avatar of WeTi

ASKER

Great as always, thnx.
Avatar of WeTi

ASKER

I tried not working tho... no error too
You need to be more precise than "not working".
Avatar of WeTi

ASKER

oh, I checked, well this PS check for service name, not display name, so display name is Aptic something but service name is something else, is there a way to make powershell check display name of services?
It wouldn't be PowerShell if there weren't.
Just replace -Name in the first line with -DisplayName
Avatar of WeTi

ASKER

works well, thanks again!