Helpful information to includeProduct name: NServiceBus
Version: latest
Stacktrace: none
Description: I want the Windows Service that NServiceBus.Host.exe creates to be executed as a Group Managed Service Account. In Windows Server 2012, you can create a special account in Active Directory called a Group Managed Service Account (gMSA). You can use this account to host Windows Services, IIS App Pools, Scheduled Tasks, and more. The advantage of using a gMSA is that you don't have to know the password. In fact, no one knows the password. When an administrator of a server creates a Windows Service using services.msc, he (or she) can click on the login tab, type the gMSA's UPN and leave the password blank. The server (if it is permitted to do so) will retrieve the managed password from Active Directory. The password is automatically changed and refreshed on a scheduled basis.
We run as many services as we can using gMSA's.
My question is, how can I run Windows Services using NServiceBus.Host.exe using a gMSA?
I've tried the following::
NServiceBus.Host.exe -install -serviceName="MyExample" -displayName="Example" -description="Example" -username="CORP\mygmsa$" -password="password"
Unhandled Exception: System.InvalidOperationException: The installation failed, and the rollback has been performed. ---> System.ComponentModel.Win32Exception: The account name is invalid or does not exist, or the password is invalid for the account name specified
NServiceBus.Host.exe -install -serviceName="MyExample" -displayName="Example" -description="Example" -username="CORP\mygmsa$" -password=""
Unhandled Exception: System.InvalidOperationException: The installation failed, and the rollback has been performed. ---> System.ComponentModel.Win32Exception: The account name is invalid or does not exist, or the password is invalid for the account name specified
NServiceBus.Host.exe -install -serviceName="MyExample" -displayName="Example" -description="Example" -username="CORP\mygmsa$"
Successful installation, but the Windows Service is running under "Local System" not the gMSA.