girwin / teamcity-agent-dsc

Apache License 2.0
3 stars 4 forks source link

Set Logon As on Service #4

Open jensdotbruggeman opened 7 years ago

jensdotbruggeman commented 7 years ago

Dear,

Is there a possibility to set the "Set Logon As" on a Service? What is the recommended way to achieve this when using the DSC Resource?

Best regards, Jens

coaxke commented 6 years ago

This is trivial to do using the SecurityPolicyDsc DSC module from Microsoft (https://github.com/PowerShell/SecurityPolicyDsc). Run something Similar to the following prior to setting up your Teamcity Agent/Server:

        UserRightsAssignment GrantTCAgentLogonAsAServiceRights
        {
            Policy = 'Log_on_as_a_service'
            Identity = $TeamCityServerUserUsername
        }