View Scheduled Tasks via VNC

Page 1 of 2 12 LastLast

  1. Posts : 11
    Windows 7
       #1

    View Scheduled Tasks via VNC


    I am running windows 7 RC in our corporate environment. We hope to start deploying in october. One issue I have is the ability to view the Scheduled Tasks for an XP machine via UNC path seems to be gone, I can't find any information about re-enabling this. Anyone have any insight?
      My Computer


  2. Posts : 1,289
       #2

    adamdaviddoyle said:
    I am running windows 7 RC in our corporate environment. We hope to start deploying in october. One issue I have is the ability to view the Scheduled Tasks for an XP machine via UNC path seems to be gone, I can't find any information about re-enabling this. Anyone have any insight?
    Hi Adam,

    What method are you currently using to view the Scheduled Tasks on remote machines using a UNC path? Is it something like WMI or an application?

    You can use this WMI script to view all Scheduled Tasks on remote machines, if there connected to a domain network you just need to replace "." after strComputer with the UNC path of the remote machine

    WMI Tasks: Scheduled Tasks (Windows)

    Code:
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\"_
        & strComputer & "\root\cimv2")
    Set colScheduledJobs = objWMIService.ExecQuery _
        ("Select * from Win32_ScheduledJob")
    For Each objJob in colScheduledJobs
        Wscript.Echo "Command: " & objJob.Command & VBNewLine _
        & "Days Of Month: " & objJob.DaysOfMonth & VBNewLine _
        & "Days Of Week: " & objJob.DaysOfWeek & VBNewLine _
        & "Description: " & objJob.Description & VBNewLine _
        & "Elapsed Time: " & objJob.ElapsedTime & VBNewLine _
        & "Install Date: " & objJob.InstallDate & VBNewLine _
        & "Interact with Desktop: " _
            & objJob.InteractWithDesktop & VBNewLine _
        & "Job ID: " & objJob.JobId & VBNewLine _
        & "Job Status: " & objJob.JobStatus & VBNewLine _
        & "Name: " & objJob.Name & VBNewLine _
        & "Notify: " & objJob.Notify & VBNewLine _
        & "Owner: " & objJob.Owner & VBNewLine _
        & "Priority: " & objJob.Priority & VBNewLine _
        & "Run Repeatedly: " & objJob.RunRepeatedly & VBNewLine _
        & "Start Time: " & objJob.StartTime & VBNewLine _
        & "Status: " & objJob.Status & VBNewLine _
        & "Time Submitted: " & objJob.TimeSubmitted & VBNewLine _
        & "Until Time: " & objJob.UntilTime
    Next
    There are a few other methods of extracting the information you require, it just depends how you doing it now?

    Steven
      My Computer


  3. Posts : 11
    Windows 7
    Thread Starter
       #3

    Well,

    Currently we are running Windows XP everywhere and with Windows XP when you hit

    \\pcname unc path, the scheduled tasks are just there.

    With windows 7 it seems they've removed that functionality. I was hoping it was just a security setting we can toggle off.
      My Computer


  4. Posts : 11
    Windows 7
    Thread Starter
       #4

    Can you pass like a %1 variable for the PC name so that you don't have to modify the script file every time and just launch it from the run prompt?
      My Computer


  5. Posts : 11
    Windows 7
    Thread Starter
       #5

    I saved that script as a .vbs and run it from the command prompt and it returns no value

    C:\>cscript sched_tasks.vbs
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.

    C:\>
      My Computer


  6. Posts : 1,289
       #6

    adamdaviddoyle said:
    Well,

    Currently we are running Windows XP everywhere and with Windows XP when you hit

    \\pcname unc path, the scheduled tasks are just there.

    With windows 7 it seems they've removed that functionality. I was hoping it was just a security setting we can toggle off.

    Edit: It appears WMI aka vbscript is useless for tasks created using Task Scheduler unless they where created using WMI in the first place.. wtf

    I cant believe this still hasn't been fixed, wtf 2x

    However, suppose you say to yourself, “Hey, as long as I have the Task Scheduler open I might as well schedule a second task.” Let’s say you do so. That task, created by the Task Scheduler, will not be visible to your WMI scripts. The Task Scheduler can deal with tasks created by WMI, but WMI cannot deal with tasks created by the Task Scheduler.
    Even worse, suppose you use Task Scheduler to modify the task you originally created with WMI. That task will be successfully modified, but you’ll no longer be able to access it using WMI, even though WMI created the thing in the first place. Yes, we know. And, hopefully, this problem will be corrected in future versions of Windows. And, yes, we know: that doesn’t really help you much right now, does it? Sorry.
    You can try these other solutions...

    Windows 7 includes PowerShell with much more powerfull scripting and output, you can output to multiple formats (doc, pdf, html...) and present the information in multiple ways...

    For example you can output a list of scheduled tasks into CSV format about 2x faster than using the vbscript/WMI above and it aparently works where WMI/vbscript fails

    geekpoet: Powershell script to report on all scheduled tasks in our domain

    There are many others but you should be able to give this one a try...

    As a last resort you can try re-adding the folder into the Network Shares view.

       Warning
    I have no idea if this will work and incorrect security settings set for this key will allow anyone to view/edit remote tasks on that machine, You have been warned!


    (I figure you might be able to re-add the folder by doing the reverse of removing it for XP
    Hide the Scheduled Tasks and Printers folder in the network share view )

    Goto:

    HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Explorer \RemoteComputer \ NameSpace
    Add the following key:
    {D6277990-4C6A-11CF-8D87-00AA0060F5BF}

    Like I said I have no idea if its even possible or the repercussions of doing that, I think powershell is the best bet since its fully scripable and seems to work...

    If you need some help getting the Powershell script running or modifying it for remote machines let me know and ill see what I can do
      My Computer


  7. Posts : 11
    Windows 7
    Thread Starter
       #7

    dmex said:
    (I figure you might be able to re-add the folder by doing the reverse of removing it for XP
    Hide the Scheduled Tasks and Printers folder in the network share view )

    Goto:

    HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Explorer \RemoteComputer \ NameSpace
    Add the following key:
    {D6277990-4C6A-11CF-8D87-00AA0060F5BF}

    I was wondering the same thing, I recall seeing this as a performance tweak for XP to remove the feature. I'll give this a shot on my virtual machine and see if it works!
      My Computer


  8. Posts : 11
    Windows 7
    Thread Starter
       #8

    Just rebooted after adding the key

    no good
      My Computer


  9. Posts : 1,289
       #9

    adamdaviddoyle said:
    Just rebooted after adding the key

    no good
    I just found this: CodeProject: A New Task Scheduler Class Library for .NET. Free source code and programming help

    if you have anyone about the office who knows some C# they can use this library to create a custom application for the same thing but it would need to be run on each machine

    Give the powershell script a try, there are quite a few of them and from what Ive been reading its the only way your going to be able to retireve the scheduled tasks minus using that library above

    If worst comes to worst I can knock up a basic app using that library to accomplish what your after and upload the source-code here, I would prefer not to have to goto that length since powershell is more than capable
      My Computer


  10. Posts : 11
    Windows 7
    Thread Starter
       #10

    Thanks for your help, We have a dev here that might be able to (he's pretty tied up so i might not get an answer for a while.)

    I've gone to my server guys to see if they can pull reports of this data from our System Center Configuration Manager server (SMS).
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:27.
Find Us