Skip to content

Commit 148471a

Browse files
authored
Merge pull request #188 from sigv/modules-10986
(MODULES-10986) Fix gMSA username support
2 parents 750ddc4 + 051969c commit 148471a

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

REFERENCE.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,10 @@ Please also note that Puppet must be running as a privileged user
197197
in order to manage `scheduled_task` resources. Running as an
198198
unprivileged user will result in 'access denied' errors.
199199

200-
If a user is specified without an accompanying password, the
201-
task will be created with `Run only when user is logged on`
202-
specified.
200+
If a user is specified without an accompanying password, and the
201+
user does not end with a dollar sign (`$`) signifying a Group
202+
Managed Service Account (gMSA), the task will be created with
203+
`Run only when user is logged on` specified.
203204

204205
Default value: `system`
205206

lib/puppet/type/scheduled_task.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@
7979
in order to manage `scheduled_task` resources. Running as an
8080
unprivileged user will result in 'access denied' errors.
8181
82-
If a user is specified without an accompanying password, the
83-
task will be created with `Run only when user is logged on`
84-
specified."
82+
If a user is specified without an accompanying password, and the
83+
user does not end with a dollar sign (`$`) signifying a Group
84+
Managed Service Account (gMSA), the task will be created with
85+
`Run only when user is logged on` specified."
8586

8687
defaultto :system
8788

lib/puppet_x/puppetlabs/scheduled_task/task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def set_account_information(user, password)
359359
@definition.Principal.LogonType = TASK_LOGON_TYPE::TASK_LOGON_SERVICE_ACCOUNT
360360
else
361361
@definition.Principal.UserId = user
362-
@definition.Principal.LogonType = if @task_password
362+
@definition.Principal.LogonType = if @task_password || user[-1] == '$'
363363
TASK_LOGON_TYPE::TASK_LOGON_PASSWORD
364364
else
365365
TASK_LOGON_TYPE::TASK_LOGON_INTERACTIVE_TOKEN

0 commit comments

Comments
 (0)