Showing posts with label Services. Show all posts
Showing posts with label Services. Show all posts

Monday, 12 October 2020

Service control in Linux (Ubuntu)

 As root or with sudo

List all services
systemctl list-units --all --type=service --no-pager

Start|Stop a service
systemctl start|stop application.service

Restart a service
systemctl restart application.service

Enable|Disable a service
systemctl enable|disable application.service

Friday, 9 October 2020

Control Windows services via PowerShell

List Services
get-service

Stop Service
stop-service <SERVICENAME>

Start Service
start-service <SERVICENAME>

Change start-up type
set-service <SERVICENAME> -StartupType Automatic|Disabled

Stop multiple services at once
get-service | where name -like <SERVICENAME>* | stop-service

https://docs.microsoft.com/en-us/powershell/scripting/samples/managing-services?view=powershell-7