Scheduling task on windows server 2016 using group managed service account failing
I have created a new group managed service account in AD and added two servers to access the account. I am able to use the account in services.msc. It is accepting it there but when I am trying to schedule task in Task scheduler (using PowerShell command) I am getting error that user name or password is incorrect.
Register-ScheduledTask : The user name or password is incorrect.
At line:4 char:1
+ Register-ScheduledTask myAdminTask –Action $action –Trigger $trigger ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : AuthenticationError: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-ScheduledTask], CimException
+ FullyQualifiedErrorId : HRESULT 0x8007052e,Register-ScheduledTask
The command I am using is this:
$action = New-ScheduledTaskAction "C:UsersadminDesktopbackup.cmd"
$trigger = New-ScheduledTaskTrigger -At 23:00 -Daily
$principal = New-ScheduledTaskPrincipal -UserID abcgmsa$ -LogonType Password
Register-ScheduledTask myAdminTask –Action $action –Trigger $trigger –Principal $principal
I am using the right syntax for username (domainnameserviceaccount$).
FYI : I am testing this on win server 2016 on azure cloud.
powershell scheduled-task windows-server-2016
migrated from superuser.com Jan 19 at 17:57
This question came from our site for computer enthusiasts and power users.
add a comment |
I have created a new group managed service account in AD and added two servers to access the account. I am able to use the account in services.msc. It is accepting it there but when I am trying to schedule task in Task scheduler (using PowerShell command) I am getting error that user name or password is incorrect.
Register-ScheduledTask : The user name or password is incorrect.
At line:4 char:1
+ Register-ScheduledTask myAdminTask –Action $action –Trigger $trigger ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : AuthenticationError: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-ScheduledTask], CimException
+ FullyQualifiedErrorId : HRESULT 0x8007052e,Register-ScheduledTask
The command I am using is this:
$action = New-ScheduledTaskAction "C:UsersadminDesktopbackup.cmd"
$trigger = New-ScheduledTaskTrigger -At 23:00 -Daily
$principal = New-ScheduledTaskPrincipal -UserID abcgmsa$ -LogonType Password
Register-ScheduledTask myAdminTask –Action $action –Trigger $trigger –Principal $principal
I am using the right syntax for username (domainnameserviceaccount$).
FYI : I am testing this on win server 2016 on azure cloud.
powershell scheduled-task windows-server-2016
migrated from superuser.com Jan 19 at 17:57
This question came from our site for computer enthusiasts and power users.
This was simply not possible with earlier versions of Windows as noted here: docs.microsoft.com/en-us/previous-versions/windows/it-pro/…. As for WS2016, I've not tired nor have I seen it done. Before trying to do this with PowerShell, try it using the GUI. If it cannot be done in the GUI, then, there should be no expectation you can do it in code. Yet even with WS12, there were similar issues, playing around with the task trigger, ended up working, using run once, then try an run it, then set it back to Daily and see if it sticks
– postanote
Jan 21 at 1:32
add a comment |
I have created a new group managed service account in AD and added two servers to access the account. I am able to use the account in services.msc. It is accepting it there but when I am trying to schedule task in Task scheduler (using PowerShell command) I am getting error that user name or password is incorrect.
Register-ScheduledTask : The user name or password is incorrect.
At line:4 char:1
+ Register-ScheduledTask myAdminTask –Action $action –Trigger $trigger ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : AuthenticationError: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-ScheduledTask], CimException
+ FullyQualifiedErrorId : HRESULT 0x8007052e,Register-ScheduledTask
The command I am using is this:
$action = New-ScheduledTaskAction "C:UsersadminDesktopbackup.cmd"
$trigger = New-ScheduledTaskTrigger -At 23:00 -Daily
$principal = New-ScheduledTaskPrincipal -UserID abcgmsa$ -LogonType Password
Register-ScheduledTask myAdminTask –Action $action –Trigger $trigger –Principal $principal
I am using the right syntax for username (domainnameserviceaccount$).
FYI : I am testing this on win server 2016 on azure cloud.
powershell scheduled-task windows-server-2016
I have created a new group managed service account in AD and added two servers to access the account. I am able to use the account in services.msc. It is accepting it there but when I am trying to schedule task in Task scheduler (using PowerShell command) I am getting error that user name or password is incorrect.
Register-ScheduledTask : The user name or password is incorrect.
At line:4 char:1
+ Register-ScheduledTask myAdminTask –Action $action –Trigger $trigger ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : AuthenticationError: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-ScheduledTask], CimException
+ FullyQualifiedErrorId : HRESULT 0x8007052e,Register-ScheduledTask
The command I am using is this:
$action = New-ScheduledTaskAction "C:UsersadminDesktopbackup.cmd"
$trigger = New-ScheduledTaskTrigger -At 23:00 -Daily
$principal = New-ScheduledTaskPrincipal -UserID abcgmsa$ -LogonType Password
Register-ScheduledTask myAdminTask –Action $action –Trigger $trigger –Principal $principal
I am using the right syntax for username (domainnameserviceaccount$).
FYI : I am testing this on win server 2016 on azure cloud.
powershell scheduled-task windows-server-2016
powershell scheduled-task windows-server-2016
asked Jan 19 at 16:17
LoGaNLoGaN
61
61
migrated from superuser.com Jan 19 at 17:57
This question came from our site for computer enthusiasts and power users.
migrated from superuser.com Jan 19 at 17:57
This question came from our site for computer enthusiasts and power users.
This was simply not possible with earlier versions of Windows as noted here: docs.microsoft.com/en-us/previous-versions/windows/it-pro/…. As for WS2016, I've not tired nor have I seen it done. Before trying to do this with PowerShell, try it using the GUI. If it cannot be done in the GUI, then, there should be no expectation you can do it in code. Yet even with WS12, there were similar issues, playing around with the task trigger, ended up working, using run once, then try an run it, then set it back to Daily and see if it sticks
– postanote
Jan 21 at 1:32
add a comment |
This was simply not possible with earlier versions of Windows as noted here: docs.microsoft.com/en-us/previous-versions/windows/it-pro/…. As for WS2016, I've not tired nor have I seen it done. Before trying to do this with PowerShell, try it using the GUI. If it cannot be done in the GUI, then, there should be no expectation you can do it in code. Yet even with WS12, there were similar issues, playing around with the task trigger, ended up working, using run once, then try an run it, then set it back to Daily and see if it sticks
– postanote
Jan 21 at 1:32
This was simply not possible with earlier versions of Windows as noted here: docs.microsoft.com/en-us/previous-versions/windows/it-pro/…. As for WS2016, I've not tired nor have I seen it done. Before trying to do this with PowerShell, try it using the GUI. If it cannot be done in the GUI, then, there should be no expectation you can do it in code. Yet even with WS12, there were similar issues, playing around with the task trigger, ended up working, using run once, then try an run it, then set it back to Daily and see if it sticks
– postanote
Jan 21 at 1:32
This was simply not possible with earlier versions of Windows as noted here: docs.microsoft.com/en-us/previous-versions/windows/it-pro/…. As for WS2016, I've not tired nor have I seen it done. Before trying to do this with PowerShell, try it using the GUI. If it cannot be done in the GUI, then, there should be no expectation you can do it in code. Yet even with WS12, there were similar issues, playing around with the task trigger, ended up working, using run once, then try an run it, then set it back to Daily and see if it sticks
– postanote
Jan 21 at 1:32
add a comment |
1 Answer
1
active
oldest
votes
Found the solution for the problem. Only thing that needs to be done after added the computer in a security group which access group managed service account is to reboot the server once to reflect membership changes.
After reboot I was able to add the account using powershell.
P.S :- Thanks for your reply postanote, I really appreciate it. :)
No worries, glad it lead to a workaround. You probably could have made it work by doing a gpupdate / force and restart the registry, stop and restart the service, which is what the reboot does, amongst other stuff that spins up.
– postanote
Jan 22 at 0:53
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f949875%2fscheduling-task-on-windows-server-2016-using-group-managed-service-account-faili%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Found the solution for the problem. Only thing that needs to be done after added the computer in a security group which access group managed service account is to reboot the server once to reflect membership changes.
After reboot I was able to add the account using powershell.
P.S :- Thanks for your reply postanote, I really appreciate it. :)
No worries, glad it lead to a workaround. You probably could have made it work by doing a gpupdate / force and restart the registry, stop and restart the service, which is what the reboot does, amongst other stuff that spins up.
– postanote
Jan 22 at 0:53
add a comment |
Found the solution for the problem. Only thing that needs to be done after added the computer in a security group which access group managed service account is to reboot the server once to reflect membership changes.
After reboot I was able to add the account using powershell.
P.S :- Thanks for your reply postanote, I really appreciate it. :)
No worries, glad it lead to a workaround. You probably could have made it work by doing a gpupdate / force and restart the registry, stop and restart the service, which is what the reboot does, amongst other stuff that spins up.
– postanote
Jan 22 at 0:53
add a comment |
Found the solution for the problem. Only thing that needs to be done after added the computer in a security group which access group managed service account is to reboot the server once to reflect membership changes.
After reboot I was able to add the account using powershell.
P.S :- Thanks for your reply postanote, I really appreciate it. :)
Found the solution for the problem. Only thing that needs to be done after added the computer in a security group which access group managed service account is to reboot the server once to reflect membership changes.
After reboot I was able to add the account using powershell.
P.S :- Thanks for your reply postanote, I really appreciate it. :)
answered Jan 21 at 5:39
LoGaNLoGaN
61
61
No worries, glad it lead to a workaround. You probably could have made it work by doing a gpupdate / force and restart the registry, stop and restart the service, which is what the reboot does, amongst other stuff that spins up.
– postanote
Jan 22 at 0:53
add a comment |
No worries, glad it lead to a workaround. You probably could have made it work by doing a gpupdate / force and restart the registry, stop and restart the service, which is what the reboot does, amongst other stuff that spins up.
– postanote
Jan 22 at 0:53
No worries, glad it lead to a workaround. You probably could have made it work by doing a gpupdate / force and restart the registry, stop and restart the service, which is what the reboot does, amongst other stuff that spins up.
– postanote
Jan 22 at 0:53
No worries, glad it lead to a workaround. You probably could have made it work by doing a gpupdate / force and restart the registry, stop and restart the service, which is what the reboot does, amongst other stuff that spins up.
– postanote
Jan 22 at 0:53
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f949875%2fscheduling-task-on-windows-server-2016-using-group-managed-service-account-faili%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
This was simply not possible with earlier versions of Windows as noted here: docs.microsoft.com/en-us/previous-versions/windows/it-pro/…. As for WS2016, I've not tired nor have I seen it done. Before trying to do this with PowerShell, try it using the GUI. If it cannot be done in the GUI, then, there should be no expectation you can do it in code. Yet even with WS12, there were similar issues, playing around with the task trigger, ended up working, using run once, then try an run it, then set it back to Daily and see if it sticks
– postanote
Jan 21 at 1:32