I have a custom Windows service developed in house and deployed on a client's server. It's installed using a PowerShell command similar to the following:
$serviceUser = Get-Credential
New-Service -Name 'service-name' -DisplayName 'service-name' -Description 'This service does things' -BinaryPathName 'C:\path\to\my\service.exe' -StartupType Automatic -Credential $serviceUser
I need to back up this service's files and configuration and be able to restore them. I can back up the files myself using Robocopy or something similar, but I don't know of a way to back up the service configuration itself (credentials, start up settings, name, etc.).
If it were my decision, I'd be looking at just snapshotting the whole machine and restoring from back up. (It'd save me a lot of trouble.) Unfortunately, the client's administration has forbidden using this as the mechanism for back up/restore.
PowerShell commands or calls to executables from it are very strongly preferred, but I could do something graphical if that's the only thing available. PowerShell is the default 4.0 that comes with Windows 2012.
How can I back up/restore a Windows service?