Skip to content

Commit

Permalink
Merge pull request #18 from sabinio/issue17
Browse files Browse the repository at this point in the history
fix issue 17
  • Loading branch information
RichieBzzzt committed Jan 8, 2018
2 parents 5892844 + 6695a34 commit 064c0e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion salt/functions/SetJobSchedules.ps1
Expand Up @@ -74,7 +74,7 @@ Disconnect-SqlConnection -SqlDisconnect $SqlConnection
{
$ds = $db.ExecuteWithResults("select owner_sid from sysschedules syssch where syssch.name = '$ServerSchedule'")
[string]$JobScheduleOwnerSid = $ds.Tables[0].Rows[0]."owner_sid"
if ($CurrentUserSid -notmatch $JobScheduleOwnerSid)
if(@(Compare-Object $CurrentUserSid $JobScheduleOwnerSid -SyncWindow 0).Length -gt 0)
{
Write-Error "User $whoAmI is not owner of Schedule $ServerSchedule. Either alter or set user executing PowerShell to sysadmin!"
Throw
Expand Down

0 comments on commit 064c0e7

Please sign in to comment.