Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $xml = '<?xml version="1.0" encoding="UTF-16"?>
- <Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
- <RegistrationInfo>
- <Date>2016-03-16T14:32:21.0880128</Date>
- <Author>SCCM\SCCM</Author>
- </RegistrationInfo>
- <Triggers>
- <LogonTrigger>
- <Enabled>true</Enabled>
- </LogonTrigger>
- </Triggers>
- <Principals>
- <Principal id="Author">
- <RunLevel>LeastPrivilege</RunLevel>
- <GroupId>BUILTIN\Users</GroupId>
- </Principal>
- </Principals>
- <Settings>
- <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
- <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
- <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
- <AllowHardTerminate>true</AllowHardTerminate>
- <StartWhenAvailable>false</StartWhenAvailable>
- <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
- <IdleSettings>
- <StopOnIdleEnd>true</StopOnIdleEnd>
- <RestartOnIdle>false</RestartOnIdle>
- </IdleSettings>
- <AllowStartOnDemand>true</AllowStartOnDemand>
- <Enabled>true</Enabled>
- <Hidden>false</Hidden>
- <RunOnlyIfIdle>false</RunOnlyIfIdle>
- <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
- <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
- <WakeToRun>false</WakeToRun>
- <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
- <Priority>7</Priority>
- </Settings>
- <Actions Context="Author">
- <Exec>
- <Command>C:\Program Files\Hewlett-Packard\HP Hotkey Support\QLBController.exe</Command>
- </Exec>
- </Actions>
- </Task>'
- $schedule = New-Object –ComObject ("Schedule.Service")
- $schedule.connect()
- $folder = $schedule.GetFolder("\")
- $task = $schedule.NewTask($null)
- $task.XmlText = $xml
- $folder.RegisterTaskDefinition("HP Hotkeys", $task, 6, "", "", 1, $null)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement