Using gMSA for replacing the Task Scheduler service account?

EnterpriseArchitect 6,301 Reputation points
2024-07-17T07:06:45.8466667+00:00

What steps should I follow to change the current Task Scheduler service account from using the regular AD Account in the format of CORP\service.account to a gMSA?

When I try to change it manually by double-clicking on the task, it prompts for the password after clicking the OK button.

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Windows for business | Windows Client for IT Pros | Devices and deployment | Configure application groups
Windows for business | Windows Server | Devices and deployment | Configure application groups
0 comments No comments
{count} votes

Answer accepted by question author
  1. Anonymous
    2024-07-17T11:52:49.78+00:00

    Hello EnterpriseArchitect,

    Thank you for posting in Q&A forum.

    Changing the service account for scheduled tasks to a Group Managed Service Account (gMSA) involves several steps to ensure a smooth transition. Here’s a detailed guide to help you with the process:

    1.Ensure Environment Compatibility: Make sure your environment supports gMSAs. This typically means having a Windows Server 2012 or later domain controller.

    2.Create gMSA: If not already created, a domain administrator will need to create the gMSA.

    Install the gMSA on each server that will use it.

    3.Grant Required Permissions: Ensure that the gMSA has the necessary permissions to run the scheduled tasks.

    4.Change the Task Scheduler Service Account:

    For a single task:

    1.Open Task Scheduler.

    2.Select the task you want to change.

    3.Right-click and select "Properties".

    4.Go to the “General” tab.

    5.In the “Security options” section, click “Change User or Group…”

    6.Enter the gMSA name in the format Domain\gMSAName$ (don’t forget the $ at the end of the gMSA name).

    7.Click “OK”.

    8.Click “OK” again to close the task properties.

    If it prompts for a password, it indicates that Task Scheduler does not recognize the account as a gMSA. Make sure you have entered the correct name with the $ suffix.

    5.Update Service Configuration (if applicable): If your task is tied to a service, update the service configuration to use the gMSA.

    $serviceName = "YourServiceName" $gmsaName = "Domain\gMSAName$" Set-Service -Name $serviceName -Credential $gmsaName -StartupType Automatic

    6.Verify the Changes: Ensure the task runs successfully with the new service account by manually triggering the task and checking if it completes without errors.

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

    Best Regards,

    Daisy Zhou

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    3 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Mukesh Agarwal 65 Reputation points
    2025-02-07T08:18:46.9033333+00:00

    You can't replace a service account with GMSA on task scheduler using GUI.

    Either you need to create a new task with the GMSA using PowerShell or use the option below to replace the existing service account on an existing task-

    schtasks /change /TN \test_gmsa_task /RU contoso\testgmsa$ /RP

    Please upvote and comment if this was beneficial for you.

    5 people found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.