
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2017 07:27 PM
To get better reporting on our users laptops we would like to run LSPush to our LS server when the laptops achieve any network connection. I would like this to be an easy installation that could just be the exe and batch file for users to download and run the batch file. I was looking into trying to script a task schedule for running the exe as admin so it reported drive encryption status just when it had and active network connection. I would normally look into how to do this myself, but I have an audit coming up and need to start collecting info soon.
Solved! Go to Solution.
Labels:
- Labels:
-
General Discussion
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2017 02:29 PM
So I have it working for what we need. Ended up having to make two batch files, an xml file for the task scheduler, then include the lspush.exe.
First bat is the install for the xml that is run as admin:
This is the xml file:
Last is the bat that runs the lspush when the laptop gets any network connectivity:
This allows us to get updates on any computers as long as they don't mess with the C:\ls directory with the the batches and lspush.exe.
First bat is the install for the xml that is run as admin:
@echo off
schtasks /create /xml c:\ls\lspush.xml /tn lspush
pause
This is the xml file:
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2017-03-23T12:29:54.6885051</Date>
<Author>comp-name\user</Author>
<URI>\lspush</URI>
</RegistrationInfo>
<Triggers>
<EventTrigger>
<Enabled>true</Enabled>
<Subscription><QueryList><Query Id="0" Path="Microsoft-Windows-NetworkProfile/Operational"><Select Path="Microsoft-Windows-NetworkProfile/Operational">*[System[Provider[@Name='Microsoft-Windows-NetworkProfile'] and EventID=10000]]</Select></Query></QueryList></Subscription>
</EventTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-18</UserId>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>true</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>true</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\ls\lspush.bat</Command>
</Exec>
</Actions>
</Task>
Last is the bat that runs the lspush when the laptop gets any network connectivity:
@echo off
c:\ls\lspush.exe publicip 9524
pause
This allows us to get updates on any computers as long as they don't mess with the C:\ls directory with the the batches and lspush.exe.
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2017 03:57 PM
Thank you for the update!

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2017 02:29 PM
So I have it working for what we need. Ended up having to make two batch files, an xml file for the task scheduler, then include the lspush.exe.
First bat is the install for the xml that is run as admin:
This is the xml file:
Last is the bat that runs the lspush when the laptop gets any network connectivity:
This allows us to get updates on any computers as long as they don't mess with the C:\ls directory with the the batches and lspush.exe.
First bat is the install for the xml that is run as admin:
@echo off
schtasks /create /xml c:\ls\lspush.xml /tn lspush
pause
This is the xml file:
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2017-03-23T12:29:54.6885051</Date>
<Author>comp-name\user</Author>
<URI>\lspush</URI>
</RegistrationInfo>
<Triggers>
<EventTrigger>
<Enabled>true</Enabled>
<Subscription><QueryList><Query Id="0" Path="Microsoft-Windows-NetworkProfile/Operational"><Select Path="Microsoft-Windows-NetworkProfile/Operational">*[System[Provider[@Name='Microsoft-Windows-NetworkProfile'] and EventID=10000]]</Select></Query></QueryList></Subscription>
</EventTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-18</UserId>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>true</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>true</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\ls\lspush.bat</Command>
</Exec>
</Actions>
</Task>
Last is the bat that runs the lspush when the laptop gets any network connectivity:
@echo off
c:\ls\lspush.exe publicip 9524
pause
This allows us to get updates on any computers as long as they don't mess with the C:\ls directory with the the batches and lspush.exe.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2017 02:20 PM
The laptops are not domain joined, so that wouldn't work for us.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2017 09:56 PM
Another option depending on your infrastructure is to push the scheduled task out via GPO.
We also run the LSPUSH.exe from a file share when the laptops are internal to our network.
We also run the LSPUSH.exe from a file share when the laptops are internal to our network.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 03:36 PM
I saw that one, but it wasn't within the specifications of what I was doing. I've done something similar and will post the results once I'm positive that it works. Basically I made a scheduled task to run a batch file on network connection, exported that working task, made a batch file to install the xml to another system, then used iexpress to stupid proof the installation for users. I just need to test that it's working then I'll do a write up.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 03:25 PM
This forum topic may be helpful. We unfortunately don't have a set procedure for setting up a scheduled task via a script.
