Author Topic: Scheduled Task via Group Policy - Not sure if it's working  (Read 11648 times)

Offline Kelemvor

  • Newbie
  • *
  • Posts: 46
    • View Profile
Scheduled Task via Group Policy - Not sure if it's working
« on: February 15, 2018, 09:14:37 AM »
Howdy,

I'm testing creating a Scheduled Task to run PatchMyPc on a Windows 10 machine.  The only way I could get the scheduled task to show up was to set it to run as NT Authority/System when it runs.  (Apparently that's a Windows 10 thing).

Anyway, I got the task to show up and I ran it manually.  It shows up in Task Manager as running as System, but I can't tell if it's doing anything or not.  Anyone know where the log file might be when running under the System account?  It's been in my Task Manager for over an hour but doesn't seem to actually be doing thing so I'm just trying to get this figured out.

Or does anyone have any other suggestions on how to set this up from within a GPO?

Thanks.

Offline danvega

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #1 on: February 15, 2018, 11:05:28 AM »
Running Patch My PC as a scheduled task is not working. I've tried many times and test on multiple systems. PMP launches under system but then it never does anything and eventually times out. I haven't been able to get it to work as a scheduled task

Offline Kelemvor

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #2 on: February 15, 2018, 12:17:54 PM »
I was able to get it to work if I set it up under User configuration instead of Computer configuration.  However, we have some machines that we don't necessarily want it to run on so I'm told I can look into Loopback Processing within Group Policy to maybe gain some finer controls...

Offline Justin Chalfant

  • Patch My PC Support
  • Administrator
  • Hero Member
  • *****
  • Posts: 2152
    • View Profile
    • Patch My PC Support
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #3 on: February 15, 2018, 06:01:14 PM »
I was able to get it to work if I set it up under User configuration instead of Computer configuration.  However, we have some machines that we don't necessarily want it to run on so I'm told I can look into Loopback Processing within Group Policy to maybe gain some finer controls...

We found a bug when running under SYSTEM context. This will be fixed in V 4.0 that will likely be out next week.

Offline Kelemvor

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #4 on: February 15, 2018, 09:55:34 PM »
Thanks for the response.  If you think to reply here when the new version is out, that'd be great.  I'll give it a try right away.

Offline Justin Chalfant

  • Patch My PC Support
  • Administrator
  • Hero Member
  • *****
  • Posts: 2152
    • View Profile
    • Patch My PC Support
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #5 on: February 16, 2018, 12:24:37 AM »
Thanks for the response.  If you think to reply here when the new version is out, that'd be great.  I'll give it a try right away.

You could try the latest beta if you want.

Offline Kelemvor

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #6 on: February 16, 2018, 08:15:09 AM »
You could try the latest beta if you want.

Just installed the Beta ad am giving it a whirl.  Can you tell me where the log file would be stored if it's running as the "System" user?  Also, does the log file get updated as it runs so I can follow along and see if it's doing anything, or does it only get updated when it's done?

Thanks.

Offline Justin Chalfant

  • Patch My PC Support
  • Administrator
  • Hero Member
  • *****
  • Posts: 2152
    • View Profile
    • Patch My PC Support
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #7 on: February 16, 2018, 09:39:01 AM »
It should be in the same folder as PatchMyPC.exe now. Yes it does log as it runs now this was an improvement in V4

Offline Kelemvor

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #8 on: February 16, 2018, 10:37:51 AM »
We are testing to run it from a shared drive using the caching option.  It'd be great if we could specify to have the log file get stored on each PC somewhere instead of putting it in the folder with the EXE since that would probably make for an ugly mess if multiple people run it at the same time.

Thanks

Offline Justin Chalfant

  • Patch My PC Support
  • Administrator
  • Hero Member
  • *****
  • Posts: 2152
    • View Profile
    • Patch My PC Support
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #9 on: February 16, 2018, 11:16:41 AM »
You can but that setting is saved locally on the machine from the options menu.

Offline Kelemvor

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #10 on: February 16, 2018, 11:36:05 AM »
You can but that setting is saved locally on the machine from the options menu.

I tried running the Beta version via a Scheduled Task that runs as the SYSTEM account and it doesn't seem to work.  It's been running in Task Manager for a couple hours already.  THe only thing in the log file is:
2/16/2018 9:11:59 AM - Patch My PC Started
2/16/2018 9:11:59 AM - Patch My PC running with command line option: /s

The Beta is v3.9 so I can wait until v4 next week and try again.

Offline Justin Chalfant

  • Patch My PC Support
  • Administrator
  • Hero Member
  • *****
  • Posts: 2152
    • View Profile
    • Patch My PC Support
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #11 on: February 16, 2018, 04:43:04 PM »
what happens if you run it manually? We aren't having any issues with /s under system context.

Offline Kelemvor

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #12 on: February 16, 2018, 05:18:11 PM »
I am running it now at home and it seems to be working fine.  I'll try again on Monday when I'm back in the office and see how it goes.

Offline Kelemvor

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #13 on: February 19, 2018, 09:05:56 AM »
Two things:

1) Any chance the log file location could be modified to be stores in the Settings file like all the other settings?  If we are running Patchmypc.exe from a network share, each individual user will never run the program manually to set a location.  We want each computer to keep its own log so if we have to research something, we can do so.  If it just stores in the same folder as the EXE, then we'll just have one gigantic log file with 100 machine's information in it which won't be helpful at all.

2) When I run the program from a scheduled Task under the System account from my own machine, it seems to work fine.  But I've run the program manually so not sure if that would have changed something.  I had a different person just run the scheduled task, without having ever run the program manually, and he's getting what I got last week.  It shows up in Task Manager but just sits there forever and never does anything.

I had the person try copying the files to their local machine and running patchmypc.exe /s from an admin command prompt.  It ran for a few seconds and then just went away.

This is all that was in the log file:

Code: [Select]
2/19/2018 9:26:24 AM - Patch My PC Started
2/19/2018 9:26:24 AM - Patch My PC running with command line option: /s
2/19/2018 9:26:24 AM - Performing scan of installed applications
2/19/2018 9:26:25 AM - 7-Zip 16.04 (x64 edition)  -  16.04.00.0
2/19/2018 9:26:29 AM - Scan completed
2/19/2018 9:26:29 AM - Starting to perform updates automatically in silent mode
2/19/2018 9:26:33 AM - Patch My PC 4.0.0.0 | Definitions: 19-Feb-2018 | 2/19/2018 9:26:33 AM

2/19/2018 9:26:33 AM - Run With /S Switch
2/19/2018 9:26:33 AM - Operating System: Microsoft Windows 10 Enterprise x64

2/19/2018 9:26:33 AM - Operating System: 6.2.9200.0

They are a local admin of their machine as well.  No idea what the problem might be.

Offline Kelemvor

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Scheduled Task via Group Policy - Not sure if it's working
« Reply #14 on: February 19, 2018, 10:35:16 AM »
OK.  Some more info.

No matter what we do, we can't get it to run as System, from a network drive.  Maybe it's a permissions thing or something.  No idea.

So, as a work around, I modified my GPO to now copy the patchmypc.exe, patchmypc.ini, defailtapps.settings, and patchmypc.settings files to the local C drive.  The Scheduled Task then runs it from that location.  This work.  Everything runs and the software gets updated.

However, this doesn't seem to work when told to use the Cache folder out on our network.  The log shows that it downloaded the updates from the internet instead of pulling them from the cache.

When I ran the program manually, it does have the path to the cache folder listed in options but it just seemed to ignore that settings.

Ideally what I'd like to happen is this:
  • PC runs PMP.exe /s based on the scheduled task.
    If it finds something out of date, it will look to our network share to see if the file it needs is already out there.  If it finds it, it will install the update.
    If it looks to the network share but doesn't find what it needs, I want it to go online and download the file and then put the installer into the cache folder for the next person.

Maybe it just can't do what we want and we'll jsut deal with having everyone have to download the files every time but just thought I'd check back in.