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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Using xp_cmdshell to copy file to mapped share

Author  Topic 

tribune
Posting Yak Master

105 Posts

Posted - 2004-05-11 : 16:29:02
I wrote a .vbs script which when executes encryptes and compresses a backup file for off-server storage. It works fine in a regular command shell, but not through xp_cmdshell (it just hangs). Any ideas? It seems to be a problem with the mapped share. The script works fine through xp_cmdshell when I use a local drive.

Thanks

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-05-11 : 16:32:50
The user that SQL server runs as needs access to that share. Do you have SQL server running as a system account, or as a domain account?

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

tribune
Posting Yak Master

105 Posts

Posted - 2004-05-11 : 16:43:57
Its running under a system account, which I guess is just the administrator account. There is no special user account created under Users/Groups in the Computer Management snapin.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-11 : 16:56:41
The system account is NOT the administrator account. Both SQL Server services should be configured with a domain account that has local admin privileges.

Tara
Go to Top of Page

tribune
Posting Yak Master

105 Posts

Posted - 2004-05-11 : 17:03:27
Hrmm I'm confused. There is BUILTIN\Administrators, and SA. The comptuer is not connected to a domain.

Anyways, how do I give sql server access to the mapped share?

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-11 : 17:07:49
It's the MSSQLSERVER service that needs an admin account. Go to Start/Settings/Control Panel/Administrative Tools/Services. Double click on MSSQLSERVER, go to second tab, change the account to a local admin account. It is recommended that you use a domain account, but since you've got no domain, use a local admin account. Use an account that is only to be used for the service, which means create one. I typically use sqladmin.

You should do the same with SQLSERVERAGENT service.

Tara
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-11 : 17:13:08
You'll then need to grant the sql service account access to the mapped drive. Not sure how you are going to do this without a domain.

Tara
Go to Top of Page

tribune
Posting Yak Master

105 Posts

Posted - 2004-05-11 : 17:54:31
Thanks Tara, I will try this
Go to Top of Page
   

- Advertisement -