J
Jim Vierra
Has anyone else tried it on WS2003. I have on two 2003 servers and it says that the "Location" property action on a Put is "Unsupported" It's works on XP and I think, on W2K Server.
--
Jim Vierra
Hi,
from my point of view, this looks like a bug and not a feature ;-)
It make no sense so.
Regards,
Manfred
Sow now that we have beat that dead horse.
Answer this.
WMI can set Win32_Printer.location on XP and not on Windows Server 2003. Why?
It doesn't make sense to have disabled this so why is it disabled?
--
Jim Vierra
Hi Jim,
finally, it looks like, we see it the same way!
And both interfaces have their pros and cons. AT is just simply remotable by the commandline!
Anyway,
best regards,
Manfred
The major difference is only what get into or stays in the registry. The scheduler still runs all of the jobs. I believe it's only ownership that is different.
--
Jim Vierra
Hi,
behind the scene, it is much more complicated. After the "Scheduled task" have been introduced, MS would ensure compatibility with the old and long existing AT interface. So the new engine, represented by the "Task Scheduler Service" has to execute the "old" AT jobs also. You can create AT jobs with the commandline AT command and you'll see this jobs in the tasklist of the "Scheduled Task", but these jobs are executed under the service account [which is normally LocalSystem] and they do not have any users to impersonate to.
You can create a "Scheduled Task" with the taskschedulers GUI and you'll see both jobs, but that one, you've created with the GUI can have assigned an user to which the taskscheduler impersonates the job if it starts. This is not the case for the jobs created by the AT interface or by WMI. If you've created a job with the GUI, go to the commandline and issue an AT command. You will be surprised, but the jobs created with the GUI are NOT there!
On the other hand, if you use the taskschedulers GUI and you see an AT job, you can apply credentials. This essentially will convert the job from a AT job visible with the AT command and executed with LocalSystem, to a new schedulted task, which could have credentials and is finally only visible in the GUI.
Hope, this helps.
Best regards,
Manfred
Look in Task scheduler and it will be there. You can query fr the jobin the scheduler and manage it.
--
Jim Vierra
Hi,
thats just the name MS gave to the wmi-class, which implements this job, this describes the usual "AT" job, not jobs from the TaskScheduler.
BTW, in line:
LogMsg "Job created:strJobName"
I think, this should possibly mean
LogMsg "Job created:" & strJobName
??
Best regards,
Manfred
WHat's wrong with this - It just happens to be called "ScheduleJob instead of ScheduleTask.
Function ScheduleJob( strJobName,strCommand, strTime,strRepeat) 'As Boolean
' call WMI to scedule this job. ,"********012500.000000-420", WMI format
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create(strCommand,strTime,True , 4, strRepeat, True, JobId)
If errJobCreated <> 0 Then
Select Case errJobCreated
Case 1 : strErr = "Incorrect function called or unknown function called."
Case 10 : strErr = "The environment is incorrect."
Case &H8009000f: strErr = "General Access denied "
End Select
LogMsg "Error on task creation - " & strErr
ScheduleJob = False
Else
LogMsg "Job created:strJobName"
ScheduleJob = True
End If
End Function
--
Jim Vierra
--
Jim Vierra
Hi,
from my point of view, this looks like a bug and not a feature ;-)
It make no sense so.
Regards,
Manfred
Sow now that we have beat that dead horse.
Answer this.
WMI can set Win32_Printer.location on XP and not on Windows Server 2003. Why?
It doesn't make sense to have disabled this so why is it disabled?
--
Jim Vierra
Hi Jim,
finally, it looks like, we see it the same way!
And both interfaces have their pros and cons. AT is just simply remotable by the commandline!
Anyway,
best regards,
Manfred
The major difference is only what get into or stays in the registry. The scheduler still runs all of the jobs. I believe it's only ownership that is different.
--
Jim Vierra
Hi,
behind the scene, it is much more complicated. After the "Scheduled task" have been introduced, MS would ensure compatibility with the old and long existing AT interface. So the new engine, represented by the "Task Scheduler Service" has to execute the "old" AT jobs also. You can create AT jobs with the commandline AT command and you'll see this jobs in the tasklist of the "Scheduled Task", but these jobs are executed under the service account [which is normally LocalSystem] and they do not have any users to impersonate to.
You can create a "Scheduled Task" with the taskschedulers GUI and you'll see both jobs, but that one, you've created with the GUI can have assigned an user to which the taskscheduler impersonates the job if it starts. This is not the case for the jobs created by the AT interface or by WMI. If you've created a job with the GUI, go to the commandline and issue an AT command. You will be surprised, but the jobs created with the GUI are NOT there!
On the other hand, if you use the taskschedulers GUI and you see an AT job, you can apply credentials. This essentially will convert the job from a AT job visible with the AT command and executed with LocalSystem, to a new schedulted task, which could have credentials and is finally only visible in the GUI.
Hope, this helps.
Best regards,
Manfred
Look in Task scheduler and it will be there. You can query fr the jobin the scheduler and manage it.
--
Jim Vierra
Hi,
thats just the name MS gave to the wmi-class, which implements this job, this describes the usual "AT" job, not jobs from the TaskScheduler.
BTW, in line:
LogMsg "Job created:strJobName"
I think, this should possibly mean
LogMsg "Job created:" & strJobName
??
Best regards,
Manfred
WHat's wrong with this - It just happens to be called "ScheduleJob instead of ScheduleTask.
Function ScheduleJob( strJobName,strCommand, strTime,strRepeat) 'As Boolean
' call WMI to scedule this job. ,"********012500.000000-420", WMI format
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create(strCommand,strTime,True , 4, strRepeat, True, JobId)
If errJobCreated <> 0 Then
Select Case errJobCreated
Case 1 : strErr = "Incorrect function called or unknown function called."
Case 10 : strErr = "The environment is incorrect."
Case &H8009000f: strErr = "General Access denied "
End Select
LogMsg "Error on task creation - " & strErr
ScheduleJob = False
Else
LogMsg "Job created:strJobName"
ScheduleJob = True
End If
End Function
--
Jim Vierra
Manfred Braun said:Hi,
thats not possible! I am not too sure, but I can imagine, that setting a
null-session-share on the machine, which hosts your script, would help. But
if you create a scheduled task remotely, why not copying the script to
execute also onto the machine, which executes your task?
As I mentioned, there is also, the "JT.EXE" from the Resource Kit, which
could create the Scheduled Task on the target machine, it can also set the
credentials for that task.
Here a sample output from "JT.EXE" from my box:
[TRACE] Enumerating jobs and queuesjt /SE
AutoStart.job
Jo.job
m1--AllProfiles.job
NetMsg.job
PseudoCreateUserProfile1.job
RunAsMB.job
W2KP-E-OfflineBackup-20050531.job
xxcopy.job
May be, that helps.
I personally would really like to see a WMI class for the "Scheduled Task"
... ;-)
even better would be a new solution, because the Task Scheduler is not
cluster-enabled :-(
Best regards,
Manfred
haai said:Hi
Thanks for your advice.
Do you know where I can edit the user-rights of the "system"-account?
Maybe I can fix the problem by that?
Mathias.