2023-07-25, 02:28 PM
Hi,
One way to do it is this:
Replace the host and port if necessary. Replace 123456789abcde with the API key you generated earlier. I think you can authenticate via a username and password instead of generating an API key, but I don't know how, and I think using an API key for this task is better. curl.exe is included with Windows since Windows 10. If it is not present, you can use PowerShell to achieve the same thing:
Otherwise:
If, contrary to the Windows installer's recommendation, you installed Jellyfin in service mode, a simple net stop JellyfinServer in an elevated Command Prompt* on the same system where Jellyfin is running should also work.
If you're using the tray app, a PowerShell script that uses GenerateConsoleCtrlEvent should also work, but that's a long story.
* Or change the ACL on the Jellyfin service to allow stopping as a normal user - look into sc sdset or System Informer for a GUI
There might be more ways to do it that I'm unaware of. Avoid taskkill though - Jellyfin doesn't listen for window messages so it will cause unclean Jellyfin shutdowns.
One way to do it is this:
- Go to http://127.0.0.1:8096/web/index.html#!/apikeys.html and add an API key
- Run Code:
curl "http://127.0.0.1:8096/System/Shutdown" -X POST -H "X-Emby-Token: 123456789abcde"
Replace the host and port if necessary. Replace 123456789abcde with the API key you generated earlier. I think you can authenticate via a username and password instead of generating an API key, but I don't know how, and I think using an API key for this task is better. curl.exe is included with Windows since Windows 10. If it is not present, you can use PowerShell to achieve the same thing:
Code:
Invoke-WebRequest -UseBasicParsing -Uri "http://127.0.0.1:8096/System/Shutdown" -Method POST -Headers @{ "X-Emby-Token" = "123456789abcde" }
Otherwise:
If, contrary to the Windows installer's recommendation, you installed Jellyfin in service mode, a simple net stop JellyfinServer in an elevated Command Prompt* on the same system where Jellyfin is running should also work.
If you're using the tray app, a PowerShell script that uses GenerateConsoleCtrlEvent should also work, but that's a long story.
* Or change the ACL on the Jellyfin service to allow stopping as a normal user - look into sc sdset or System Informer for a GUI
There might be more ways to do it that I'm unaware of. Avoid taskkill though - Jellyfin doesn't listen for window messages so it will cause unclean Jellyfin shutdowns.