NAV 11 Scheduler Setting Script to run as current logged in User

karthikeyan_mac
Valued Contributor

Hi,

I am trying to Schedule the NAV11 LiveUpdate and Virus scan through script. NAV11 stores the scheduler settings in different plist for each user in /Library/LaunchDameons. I have created the below script which configures the scheduler settings for current user. But when pushing it through Casper Policy, the scheduler settings are only created for root user since Policy runs all the scripts as root user.

*#!/bin/sh* ** *## Schedule the LiveUpdate for Virus Definitions daily at 12:00 AM* ** */usr/bin/symsched LiveUpdate DailyDefinitionsUpdate 1 1 Daily 12:00 "Virus Definitions" -quiet* ** *echo "Product Update Scheduled"* ** *## Schedule the VirusScan weekly on Tuesday at 08:00 PM* ** */usr/bin/symsched VirusScan WeeklyScan 1 1 Weekly 2 20:00 -niceness 20 "/"* ** *echo "Weekly Scan Scheduled"* ** *exit 0*

I have gone through the JAMF article for passing the script parameter for current user($3) but I am unable to implement the parameter in script(I am a new learner).

Article:- http://jamfsoftware.com/kb/article.php?id=040

Kindly help me in running the script as current logged user when pushing via Policy.

P.S:- Policy is configured to trigger By "Login" and Execution Frequency is set as "Once Per User".

Thanks & Regards,
Karthikeyan M

* *

7 REPLIES 7

talkingmoose
Moderator
Moderator

You may be able to do this more easily but we need to test.
On 8/3/11 10:12 AM, "Karthikeyan M" <karthikeyan.mac at gmail.com> wrote:

I believe NAV can use the same command line as SAV. Open the Terminal and
test the following one line on one of your machines with NAV:

'/Applications/Symantec
Solutions/LiveUpdate.app/Contents/MacOS/LiveUpdate' -update LUal
-liveupdatequiet YES -liveupdateautoquit YES

This should quietly open LiveUpdate and update all definitions and product
updates and then it should quit. If you are logged in to the Mac then the
only thing you will notice is the LiveUpdate icon appearing in the Dock.
Be sure to test this command with a machine that is logged out too using
Casper Remote or Apple Remote Desktop.

If this works then you can put this one line into a JSS policy and
schedule the policy for your machines. This would avoid having to create a
launchd plist and pushing that to all your Macs.

Let me know if you need more information.

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

karthikeyan_mac
Valued Contributor

Hi William,

Thanks for your reply. I will try that out. But we also need to schedule daily LiveUpdate and weekly Virus Scan.

Regards,
Karthikeyan

jhalvorson
Valued Contributor

I am not sure if NAV11 includes the symsched command, but for SEP11 and
SAV10.2.3 I deploy a script that includes the following commands:

symsched LiveUpdate "AllUpdate monthy01" 1 1 -monthly 01 10:20 "All
Products" -quiet
symsched LiveUpdate "AllUpdate monthy15" 1 1 -monthly 15 15:45 "All
Products" -quiet
symsched LiveUpdate "Mon VDefs Update" 1 1 -weekly 1 08:00 "Virus
Definitions" -quiet
symsched LiveUpdate "Tue VDefs Update" 1 1 -weekly 2 10:00 "Virus
Definitions" -quiet
symsched LiveUpdate "Wed VDefs Update" 1 1 -weekly 3 12:00 "Virus
Definitions" -quiet
symsched LiveUpdate "Thu VDefs Update" 1 1 -weekly 4 14:00 "Virus
Definitions" -quiet
symsched LiveUpdate "Fri VDefs Update" 1 1 -weekly 5 16:00 "Virus
Definitions" -quiet

As you can see, LiveUpdate client updates everything on the first and 15 of
the month. And updates the definitions at various times through out the
weekdays. It appears to be working well and the next step is to increase
the number of updates to meet the our IT security requirements.

I can share that script if your interested.

On a computer with NAV, enter in terminal>
Sudo symsched -l
That should let you know if symsched is installed and if you have any
scheduled items.

I've used a policy/command that William mentions below, but even if the
update is successful in the end, there is LiveUpdate error midway through.
During the liveupdate, the process tries to set the permissions on one of
the temp folders. If it wasn't there the logs note missing folder, the
update continues, but I still received an email every time that there was a
problem with that policy.

Jason

karthikeyan_mac
Valued Contributor

Hi Jason,

NAV11 also includes the symsched command. We are in the process of deploying the script. But when we deploy the script using Casper Policy, the scheduler settings gets updated for only root user since all the Script by default run as root if deployed using Casper Policy. I am trying a way to run the script through Casper Policy to run for current user.

*#!/bin/sh* ** *## Schedule the LiveUpdate for Virus Definitions daily at 12:00 AM* ** */usr/bin/symsched LiveUpdate DailyDefinitionsUpdate 1 1 Daily 12:00 "Virus Definitions" -quiet* ** *echo "Product Update Scheduled"* ** *## Schedule the VirusScan weekly on Tuesday at 08:00 PM* ** */usr/bin/symsched VirusScan WeeklyScan 1 1 Weekly 2 20:00 -niceness 20 "/"* ** *echo "Weekly Scan Scheduled"* ** *exit 0*

Regards,
Karthikeyan

bentoms
Release Candidate Programs Tester

Create a launchagent that runs the script.

Regards,

Ben.

karthikeyan_mac
Valued Contributor

Hi,

Thanks. I will try creating the lauchagent.

But my doubt is whether Casper Policy can run the script as current logged in user?. If its going to run the script as Current logged in user, my query is solved.

Regards,
Karthikeyan M

bentoms
Release Candidate Programs Tester

Casper will run the script as root.

LaunchAgents run as the user logged in.

Regards,

Ben.