gMSA for scheduled task.

Question

Wednesday, May 8, 2019 4:05 PM

I'm down to the 4th and 5th pages of google and cannot get this to work. I have the GMSA setup correctly and can apply it to services no problem. I want to apply it to scheduled tasks and I've seen where this is supported but you cannot do through GUI. Via powershell I should be able to run "schtasks /Change /RU "domain\gmsa" /TN "task name"

Leave password blank.

thing is this worked once, then I reversed the change to test again and now I get.

ERROR: no mapping between account names and security ID's was done.    I cannot find anything as it relates to scheduled tasks and this error.   any idea's?  I really want gmsa's to work in scheduled tasks I feel it'll be better than standard service accounts.

EDIT:  I have read the blogs on creating the task via powershell.  I want to change existing after I've created.

EDIT AGAIN:   The devil is in the details and I dug so much I missed the obvious, hope this helps someone else.  the command missed the $ after account name.

"schtasks /Change /RU "domain\gmsa$" /TN "task name"

All replies (2)

Friday, May 17, 2019 1:44 PM ✅Answered

Thank you, in my edits of my original post I found my errors.  I simply had a typo and hope this helps someone else.

thank you again, that link is the best instructions I had seen.


Thursday, May 9, 2019 1:58 AM

Please refer to this link below:

4. Using the gMSA for a Scheduled Task

https://blogs.technet.microsoft.com/askpfeplat/2012/12/16/windows-server-2012-group-managed-service-accounts/

Section 4 on how to use it for task scheduler. GUI does not work, use PowerShell as guided.

Regards

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.