New-JobTrigger -AtStartup really doesnt work..?? :-(
hi,
i tried code, works (at first look) good, jobs created , job "wsusupdate" trigger -at runs fantastic... job trigger, atstartup works never.... can explain me why??
i tried register ist local on myserver doesnt work too.. have idea???
$computername = "myserver" $cred = get-credential invoke-command -computername $computername -credential $cred -scriptblock { $termin = new-jobtrigger –once –at "june 03, 2016 11:35" $start = new-jobtrigger -atstartup register-scheduledjob -name wsusupdate -scriptblock { new-item -path "c:\wsus\jobfolder" -type directory -force} -trigger ($termin) -scheduledjoboption (new-scheduledjoboption -runelevated) register-scheduledjob -name wsusreboot -scriptblock { new-item -path "c:\wsus\jobfolder3" -type directory -force} -trigger ($start) -scheduledjoboption (new-scheduledjoboption -runelevated) }
and scheduled-task isnt working me...
startup jobs run under system account. there no logon available. "run elevated" doesn't make sense.
\_(ツ)_/
Windows Server > Windows PowerShell
Comments
Post a Comment