Schedules Tasks and Network Drives

S

saqib ali

I have a few Windows XP / 2003 Server machine that need run a schedule
task overnite. The schedule task needs to access mapped network drive.


The mapped drive are personal storage for the userid under which the
scheduled task is running. However I have noticed that if the user is
not interactively logged in, the drive mapping does not take place for
schedule task.

I have even tried to map drives using Group Policies for the server. But
the scheduled tasks are still unable to see the drive mappings.

I guess I can use UNC path instead of drive for Scheduling task, but
that would mean we would have to modify our application settings for
each user i.e. to reference their personal storage.

Any ideas?

Saqib Ali
http://www.xml-dev.com/blog/
 
P

Pegasus \(MVP\)

saqib ali said:
I have a few Windows XP / 2003 Server machine that need run a schedule
task overnite. The schedule task needs to access mapped network drive.


The mapped drive are personal storage for the userid under which the
scheduled task is running. However I have noticed that if the user is
not interactively logged in, the drive mapping does not take place for
schedule task.

I have even tried to map drives using Group Policies for the server. But
the scheduled tasks are still unable to see the drive mappings.

I guess I can use UNC path instead of drive for Scheduling task, but
that would mean we would have to modify our application settings for
each user i.e. to reference their personal storage.

Any ideas?

Saqib Ali
http://www.xml-dev.com/blog/

You must run the scheduled task under an account that has
sufficient access privileges for the shared resource.
 
S

saqib ali

You must run the scheduled task under an account that has
sufficient access privileges for the shared resource.


The scheduled task completes successfully if I use the UNC instead of
the drive letter mapping. So the account has sufficient priveleges to
write files to the shared resource.
 
P

Pegasus \(MVP\)

saqib ali said:
The scheduled task completes successfully if I use the UNC instead of
the drive letter mapping. So the account has sufficient priveleges to
write files to the shared resource.

This makes no sense. It's now time for you to add some
diagnostics so that you see what's ***really*** going on.
Instead of scheduling a "net use" command, schedule the
following batch file:

@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log
net use q: \\YourServer\YourShare 1>>c:\test.log 2>c:\test.err
net use 1>>c:\test.log 2>c:\test.err
echo %date% %time% End of task >> c:\test.log

Paste the contents of the two log files into your reply.
 
D

Dave Patrick

Correct, mapped drives won't exist when no one is logged on. Always use UNC
paths.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
|
| > You must run the scheduled task under an account that has
| > sufficient access privileges for the shared resource.
|
|
| The scheduled task completes successfully if I use the UNC instead of
| the drive letter mapping. So the account has sufficient priveleges to
| write files to the shared resource.
 
S

saqib ali

Hi Dave,

Thanks for the response. That was the verification that I was looking
for. I just wanted to make sure that I am not missing something obvious.

Anyways here is how I got around the drive mapping issue:

I use the following cmd line in the scheduler:

cmd \C net use x: /delete && cmd \C net use x:
\\fileserver\share\vol\%username% && x:\app.exe

(watch for line wraps)

1) disconnect from X: if needed
2) map X: to \\fileserver\share\vol\%username%
3) Launch application from X:

This is seems to work fine.

In Peace,
Saqib Ali
http://www.xml-dev.com/blog/
 
P

Pegasus \(MVP\)

It seems someone forgot to tell my Win2000 PC that mapped
drives won't exist when no one is logged on. They certainly do -
I just ran a little test to confirm it. While UNC paths might be
preferable, they are not compulsory.
 
D

Dave Patrick

AFAIK without some sort of trickery mapped drives are user profile specific
and not machine specific so unless you used one of these methods (or
similar) it doesn't happen as standard issue.

http://support.microsoft.com/default.aspx?scid=kb;[LN];243486

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| It seems someone forgot to tell my Win2000 PC that mapped
| drives won't exist when no one is logged on. They certainly do -
| I just ran a little test to confirm it. While UNC paths might be
| preferable, they are not compulsory.
 
S

saqib ali

Pegasus said:
It seems someone forgot to tell my Win2000 PC that mapped
drives won't exist when no one is logged on. They certainly do -
I just ran a little test to confirm it. While UNC paths might be
preferable, they are not compulsory.

See
http://www.microsoft.com/technet/pr...elp/40b9beb1-3578-48f9-93e1-7ca6760c1c15.mspx

------------------- From the above TechNet article ------------
Connecting to network drives

Do not use a redirected drive for scheduled jobs that access the
network. The Schedule service might not be able to access the redirected
drive, or the redirected drive might not be present if a different user
is logged on at the time the scheduled task runs. Instead, use UNC paths
for scheduled jobs. For example:

at 1:00pm my_backup \\server\share"
 
P

Pegasus \(MVP\)

It is ***preferable*** to use UNC paths. If you wish to use
a fixed drive letter then that letter might not be available because
it is used in a different session. However, if the drive letter is free
then it can be used by a scheduled task, without any trickery
whatsoever. The statement "mapped drives won't exist when
no one is logged on" is definitely incorrect.

Mapped drives are indeed profile-specific: They can only be
seen within the context under which they were mapped.
Again this does not prevent a scheduled task from mapping
its own drive letter.
 
D

Dave Patrick

:
| It is ***preferable*** to use UNC paths.
* Agreed. That's what I always recommend.

If you wish to use
| a fixed drive letter then that letter might not be available because
| it is used in a different session.
* I really can't see a reason why risk this.


However, if the drive letter is free
| then it can be used by a scheduled task, without any trickery
| whatsoever. The statement "mapped drives won't exist when
| no one is logged on" is definitely incorrect.
* 99% of users that post here with this same issue expect that drive letters
mapped during the logon session will also exist when they're logged off
which is definitely incorrect. To be more specific I should have said.
"mapped drives won't natively exist when no one is logged on"


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top