Skip to content

Commit

Permalink
Fix Issue dsccommunity#323
Browse files Browse the repository at this point in the history
  • Loading branch information
PlagueHO committed May 3, 2020
1 parent 83d3b36 commit 6b02ed9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Change Azure DevOps Pipeline definition to include `source/*` - Fixes [Issue #324](https://github.com/dsccommunity/ComputerManagementDsc/issues/324).
- Updated pipeline to use `latest` version of `ModuleBuilder` - Fixes [Issue #324](https://github.com/dsccommunity/ComputerManagementDsc/issues/324).
- Merge `HISTORIC_CHANGELOG.md` into `CHANGELOG.md` - Fixes [Issue #325](https://github.com/dsccommunity/ComputerManagementDsc/issues/325).
- ScheduledTask:
- Fix ServiceAccount behavior on Windows Server 2016 - Fixes [Issue #323](https://github.com/dsccommunity/ComputerManagementDsc/issues/323).

### Fixed

Expand Down
7 changes: 7 additions & 0 deletions source/DSCResources/DSC_ScheduledTask/DSC_ScheduledTask.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,13 @@ function Get-CurrentResource

if (($result.ContainsKey('LogonType')) -and ($result['LogonType'] -ieq 'ServiceAccount'))
{
$userId = $task.Principal.UserId

if ($userId -like 'NT AUTHORITY\*')
{
$userId = "NT AUTHORITY\$($userId)"
}

$result.Add('BuiltInAccount', $task.Principal.UserId)
}
}
Expand Down

0 comments on commit 6b02ed9

Please sign in to comment.