Access to network resources from SQL management console
Hallo.I have an existing instalation of SQL server in a domain environment.SQl server is installed with default settings/network service/.I'm writing script in which i need to copy some files from drive E of the SQL server to network path in our fileserver.But when i run the script the error is 0 files copied.Access denied.Is there any way to do that task,maybe someway to insert the windwos credentials,or have to change the user that runs the SQL service?How can i grant the NETWORK SERVICE acceess to that folder where i want to insert the files.Thank you.
September 14th, 2015 1:48pm

How do you issue the copy operation? An Agent job? Xp_cmdshell? Something else. I think that you grant access to the *machine* AD account, but this way everyone and everything on that machine will have those permissions...
Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 2:50pm

I use simple copy COPY *.p7s \\SERVERNAME\FOLDER directly from the new query button in sql management studio.Then i plan to make a packet ,and jobs which have to run at specific times.
September 14th, 2015 3:18pm

"copy COPY *.p7s \\SERVERNAME\FOLDER directly from the new query button in sql management studio"

Wow, that didn't say anything to me. Can you be a bit more precise, please? The copy command is an OS command (CMD.EXE to be more precise), and I fail to see how that relates to SQL Server Management Studio.

Depending on the details, it is possible that the service account for Agent will be used for this, by default. But again, more details is needed.

Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 4:24pm

I'm testing the conectivity and the copy code from this button in SQL management studio.I also tried to workaraund it with bat file which do the same copy command.If i run the the bat or copy statement from SQL - access denied.If i run the bat directly there is no problem.The user that i'm logged into the sql server is domain admin and he have rights to write in the remote folder.Only just directly from SQL i cant write.
September 15th, 2015 1:55am