Link to home
Start Free TrialLog in
Avatar of mouatts
mouatts

asked on

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
Avatar of Eagle6990
Eagle6990
Flag of United States of America image

Try using the AT command from the command prompt to view more detail of the task and/or recreate them.
Avatar of mouatts
mouatts

ASKER

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.
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
Avatar of mouatts

ASKER

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.

>>>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
Avatar of mouatts

ASKER

>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

ASKER CERTIFIED SOLUTION
Avatar of Nirmal Sharma
Nirmal Sharma
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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

Avatar of mouatts

ASKER

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
Oh! Good :-) Glad you solved it.

Thanks!