none
Logon Failure error after changing Services Account on Windows 2016 Server Core RRS feed

  • Question

  • Hi guys,

    I have written a script which will change my services account from localsystem to a local service account. It worked on windows 2016 UI version but when i execute on the core server i am getting services unable to start due to logon failure whenever i try to start (This error only show when i run net start "serivcename").

    Both local services account has the same username and password.

    Below is the script that i use to change the services account.

    Get-CimInstance win32_service -filter "name='servicename" | Invoke-CimMethod -Name Change -Arguments @{StartName=".\servicesAccount";StartPassword="somepassword";}

    Monday, August 12, 2019 7:33 AM

Answers

All replies

  • Solved the issue. For windows core it require us to manually add user logon as services in security policy.

    For those who are new to secedit can take a look at the url:

    https://code.msdn.microsoft.com/windowsapps/Add-log-on-as-a-service-a64dd63c

    Please modify to suit your own use case. Thanks.

    • Marked as answer by Jimson Huang Tuesday, August 13, 2019 5:45 AM
    Tuesday, August 13, 2019 5:45 AM
  • You always have to add an account to "Logon as a service" in full NT or Core.  That has always been true.  When you do it in the GUI with "services" applet the system prompts you to add it. 

    You question indicated that you had used the same PS code to add a "service account".  That means that you have created and account that has that security setting which is how it gets to be a service account.  Apparently you didn't do it before with PowerShell.


    \_(ツ)_/

    Tuesday, August 13, 2019 6:01 AM
  • Yep. This my first time working with a core server. There are a lot of things i need to learn about it.
    Tuesday, August 13, 2019 6:09 AM