?
Solved

Windows scheduled task and shared drive mapping

Posted on 2012-09-11
9
Medium Priority
?
1,881 Views
Last Modified: 2012-10-09
Hi,
I am using scheduled task to schedule one of my batch file to delete files from a shared drive. When scheduled this file is returning errors "access denied". If I run the same batch file as logged in user, it all goes fine.

Does scheduled task run as user who submit task or run as system internal user?
How do I get shared mapping working thru batch script without revealing the password?

Many Thanks
0
Comment
Question by:crazywolf2010
  • 5
  • 4
9 Comments
 
LVL 19

Expert Comment

by:helpfinder
ID: 38386218
for rhis you couold create service account in AD and set to run scheduled task under this credentials. (of course you have to set permission for that user on shared folder)
For service account you can follow this MS basics:
http://technet.microsoft.com/en-us/library/cc739458%28v=ws.10%29.aspx
0
 

Author Comment

by:crazywolf2010
ID: 38386243
Hi,
I don't have domain account with all privs. I wish to do it thru a machine admin account. I have domain account for mapping shared drive with limited privs.

Thanks
0
 
LVL 19

Expert Comment

by:helpfinder
ID: 38386298
but if shared folder has set NTFS/share permission (they are cumulative) which does not allow local users (even admins) to modify (delete) its content you won´t be able to achieve this.
You has to work with account  (set schedule task to un under this account) which has privilege to modify contend of your desired shared folder.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:crazywolf2010
ID: 38386324
Hi Mate,
Probably I didn't write my setup clearly, here are the details.

I have a machine admin user "admin" with all privs
I then have a Domain user with only limited privs to "SHARE" as "user"

Once I login at machine, I use net share command and use "user" credentials to map shared drive. I can run commands manually and they do work fine.

How do I replicate it at scheduled task?

Regards
0
 
LVL 19

Assisted Solution

by:helpfinder
helpfinder earned 2000 total points
ID: 38386549
then you have to run the task under user account which is able to run it also when you are logged as that user - see printscreen (green line and Administrator account)
scheduled.PNG
0
 

Author Comment

by:crazywolf2010
ID: 38386617
Hi,
I don't want user to login to fire this task. It's spooling,copying files at 5am.
Can I schedule it thru scheduled task but then the challenge is mapping shared drive.

Thanks
0
 
LVL 19

Expert Comment

by:helpfinder
ID: 38386876
the task is scheduld and will be proceed automatically at desired time and date under defined user credentials and with his permissions - no need to be logged as that user, it is enough to have PC powered on.
0
 

Author Comment

by:crazywolf2010
ID: 38386897
That's great. I will test.
How does network share mapping will work under such scenario? Do I need to map that share on the machine explicitly after reboot? OR I have to use net use command within script?

Thanks
0
 
LVL 19

Accepted Solution

by:
helpfinder earned 2000 total points
ID: 38386940
yop, best would be to use net use command in the script (or just do not specify in the command disk drive you have mapped but UNC path, e.g. \\fileserver\myshare)
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn about cloud computing and its benefits for small business owners.
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question