Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Job cannot write to root of C:/ on Windows 2008

Author  Topic 

Nicholson
Starting Member

8 Posts

Posted - 2011-01-11 : 12:18:07
One of the jobs that I have setup on SQL Server 2008 tries to write to the root of C:/

However, since the server is running in a Windows 2008 environment, it will not allow the file to write to the root of C:/

This it where I want this job to write the file, though. It is consistent with all of the other jobs on all other servers/environments.

Has anyone run into this and if so, do you have a suggested resolution?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-11 : 12:32:49
Check with your Windows 2008 server administrator and have him fix the permissions.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Nicholson
Starting Member

8 Posts

Posted - 2011-01-11 : 12:50:15
Is there any way for them to accomplish this other than turning off UAC or disabling the firewall? Those are really not viable options.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-11 : 12:54:33
I'm not a Windows administrator, so this is outside of my scope and really is outside of the scope of SQLTeam.com as it isn't specifically a SQL question. I'd highly recommend that you post your question on a Windows administration forum, just leave off the fact that it's SQL Server 2008 doing the writing, only mention you need to write to the C drive for a scheduled job. If you add in SQL Server 2008, the Windows administration forum will likely point you to a SQL Server forum which will just put you back here. It's really a Windows question that you need answered.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

RobertKaucher
Posting Yak Master

169 Posts

Posted - 2011-01-11 : 14:05:26
quote:
Originally posted by Nicholson

One of the jobs that I have setup on SQL Server 2008 tries to write to the root of C:/

However, since the server is running in a Windows 2008 environment, it will not allow the file to write to the root of C:/

This it where I want this job to write the file, though. It is consistent with all of the other jobs on all other servers/environments.

Has anyone run into this and if so, do you have a suggested resolution?



In Vista/Server 2008 onward the root of C is protected. Don't write to it. This was a bad habit to get into in the first place and should be corrected now. Not that there is something wrong with what you are doing, but there is something wrong with letting users in general have modify access to the root of the system drive. The only way to do this would be to circumvent the new security model put in place by UAC.

===
http://www.ElementalSQL.com/
Go to Top of Page

Nicholson
Starting Member

8 Posts

Posted - 2011-01-11 : 21:51:52
Okay. Appreciate the insight. I was aware of this as a workaround, but it is not the route I wanted to go.

The only files that are written to the root of C:/ are those that are outputs of a weekly job. All other files are written to specific directories - not on the c:/ drive.

Thanks for the information and for responding promptly.
Go to Top of Page

RobertKaucher
Posting Yak Master

169 Posts

Posted - 2011-01-12 : 08:20:08
quote:
Originally posted by Nicholson

Okay. Appreciate the insight. I was aware of this as a workaround, but it is not the route I wanted to go.

The only files that are written to the root of C:/ are those that are outputs of a weekly job. All other files are written to specific directories - not on the c:/ drive.

Thanks for the information and for responding promptly.


I understand how it might seem convenient to turn off UAC, modify permissions, and allow this account access the root of the system drive but

1. This will make your server less secure.
2. Subverting a security best practice for the sake of convenience is never advisable.

I strongly urge you to consider writing these files to a directory you create like C:\SQLTemp so that the jobs begin to conform to best practice. Doing something that is wrong for the sake of convenience is how events chain together to form disasters. Just keep that in mind. Things like this never seem like a big deal when taken in isolation, but then when placed in the context of other people taking similar shortcuts things add up and next thing you know BOOOM.

===
http://www.ElementalSQL.com/
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-01-12 : 11:50:10
All you have to do is grant the SQL Agent account modify permissions to C:
This is no different in Windows Server 2008 than it is on any other OS.

No need to mess with UAC or anything else.
Go to Top of Page

Nicholson
Starting Member

8 Posts

Posted - 2011-01-12 : 12:11:08
Thanks, Russell.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-01-12 : 12:13:09
By the way, Robert's cautions are all valid and should be strongly considered.
Go to Top of Page

Nicholson
Starting Member

8 Posts

Posted - 2011-01-12 : 12:27:31
Understood. Appreciate the insight from all.
Go to Top of Page
   

- Advertisement -