• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 364
  • Last Modified:

Scheduled tasks problem

I'm going to be posting a number of questions all resulting from a common event, which I will describe in a miniute. So if you get the feeling of deja vu my apologies.

Following my PDC going phut! I installed Active Directory on another server and made this into a DC. It seemed to happily replicate from another DC. However at one point during the installation process it warned me that it was going to get rid of all local accounts. Which it did but did a few more things besides!

So my first problem is that it removed the administrator account and as a consequence none of the schedule tasks work (the all fail saying that the account doesn't exist). Now I am happy enough to recreate them but I need to get at the parameters which aren't fully visible when you open the task up as it will not allow the task to be edited.

So the question is there a way in which I can edit or view the actual .job files or alternatively change the account under which each job runs (without using the task property page).

Thanks
Steve
0
mouatts
Asked:
mouatts
  • 5
  • 4
1 Solution
 
Eagle6990Commented:
Try using the AT command from the command prompt to view more detail of the task and/or recreate them.
0
 
mouattsAuthor Commented:
sorry AT displays only "There are no entries in the list." which is correct as AT displays task running under SYSTEM and as I said the ones that I was interested was the local administrator acount.
0
 
Nirmal SharmaSolution ArchitectCommented:
So my first problem is that it removed the administrator account and as a consequence none of the schedule tasks work (the all fail saying that the account doesn't exist). Now I am happy enough to recreate them but I need to get at the parameters which aren't fully visible when you open the task up as it will not allow the task to be edited.

By default, before promoting this computer to domain controller the computer was Member server or standalone and all tasks were running in the security context of Local Administrator now you have promoted and domain administrator has taken over control to this machine. Thus SIDs changed for both the accounts. NOTE: - Windows uses only SIDs to identify an account and it does not use name. Now your problem is that you do not have security rights to edit these tasks.

Please answer the following questions: -

1. What all entries you see in \Winnt\Tasks folder.
2. Did you try to Stop and Start Task Scheduler service from services.msc snap-in to re-generate security ID under the security context of domain administrator account.
3. Did you try to change the AT service account from Advanced Property and then specifying the Domain Administrator account.
4. Did you see the Log and find an cause listed under it.

Let me know.

Thanks
SystmProg
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
mouattsAuthor Commented:
I understand what the problem is what I really want to do is see the data of the jobs, and this it won't allow because each of the jobs is still 'owned' by the now defunct Local Admin account.

1 All the tasks are there is that's what you mean
2 I did but it isn't a problem with the scheduler (which runs under SYSTEM not admin by the way)
3 I did but you can't do this under windows 2000, I think you could under NT as I think I did this once. W2000 insists that the task scheduler is run under SYSTEM.
4 Yes and the gist of the message is that it can't find the old local admin account.

0
 
Nirmal SharmaSolution ArchitectCommented:
>>>I understand what the problem is what I really want to do is see the data of the jobs, and this it won't allow because each of the jobs is still 'owned' by the now defunct Local Admin account.

Yes. I can understand but retreiving parameter details from JOB files is not so easy. You might need to use this: -
http://www.15seconds.com/Issue/980513.htm

Or see if this can help in editing the task: -
http://www.jsifaq.com/SUBF/TIP2600/rh2621.htm

Thanks for your reply.
SystmProg
0
 
mouattsAuthor Commented:
>Yes. I can understand but retreiving parameter details from JOB files is not so easy.

I know that's why I asked the question :)

Thanks but JT fails with the same error.

I am assuming that the tasks that are present within the task folder are the .job files themselves but because this is a special folder a special tool is needed to access them as files. (Admitedly even if I do there is a chance that they will not be readable)

Steve

0
 
Nirmal SharmaSolution ArchitectCommented:
I got an idea.

Each scheduled task you create is stored as a .job file in the \Windows\Tasks folder. The .job file contains the properties and configuration information for the task. You can create a scheduled task on your computer and then drag the .job object over to a remote computer. After you drag a task from one computer to another, you must update the account information for the task before it will run. Removing a scheduled task removes only the .job file from the schedule. The program file the task runs is not removed from the hard disk.

The above quote copied from MS Link. So final thoughts are to drag-and-drop to another member computer and then retreiving the details.

If that does not work then i need to find a Job parser.

Let me know.

Thanks
SystmProg
0
 
Nirmal SharmaSolution ArchitectCommented:
Did you check this: -

Generate a CSV file of scheduled tasks and their credentials.

Using JT.EXE, I scripted Credentials.bat, to generate a CSV file of the scheduled tasks on any Windows 2000, Windows XP, and Windows .NET Server computer. The CSV file contains:

"\\ComputerName","Credentials","JobName".

The syntax for using Credentials.bat is:

Credentials ComputerName ReportFile

where:

ComputerName is the NetBIOS computer name, without leading \\.

ReportFile is the path to the output CSV file.

Credentials.bat contains:

@echo off
if {%2}=={} goto syntax
if not exist \\%1\c$ goto syntax
if not exist %~DP2 goto syntax
setlocal
set server=%1
set server="\\%server:"=%"
set report=%2
if exist %report% del /q %report%
if exist %tmp%\Credentials.tmp del /q %tmp%\Credentials.tmp
for /f "Tokens=*" %%a in ('jt /sm %server% /se p') do set line1=%%a&call :parse1
if exist %tmp%\Credentials.tmp sort %tmp%\Credentials.tmp /o %report%
if exist %tmp%\Credentials.tmp del /q %tmp%\Credentials.tmp
endlocal
goto :EOF
:syntax
@echo Syntax: Credentials ComputerName ReportFile
goto :EOF
:parse1
set line1=%line1:"=%
if not "%line1:~0,22%" EQU "[TRACE] Activating job" goto :EOF
set job=%line1:~24,99%
set job=%job:.job'=%
for /f "Tokens=*" %%b in ('jt /sm %server% /sac "%job%" /gc') do set line2=%%b&call :parse2
goto :EOF
:parse2
set line2=%line2:"=%
if not "%line2:~0,9%" EQU "[TRACE] C" goto :EOF
set cred=%line2:~35,99%
set cred=%cred:'=%
@echo %server%,"%cred%","%job%">>%tmp%\Credentials.tmp

Ref: - http://www.jsifaq.com/SUBL/tip5700/rh5712.htm

0
 
mouattsAuthor Commented:
You latter post wouldn't work because the JT fails.

But you were on the right track with your first post.

You can't look at the remote task folder because when you select it windows actually displays the local folder instead!

But what I did was to set up web sharing on the task folder then access it via the web server, which allowed me to copy the files down as text files. They are binary files, however the command line bit is readable.

Thanks for your help
0
 
Nirmal SharmaSolution ArchitectCommented:
Oh! Good :-) Glad you solved it.

Thanks!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now