x

Location of user account temp dir for service accounts (Jet drivers on 64-bit)

Yet another "Jet drivers on 64 bit" question........

Had a scenario where a query using OPENROWSET wouldn't work on the newly built 64-bit server. And of course, a lot of the answers here (thanks to @Pavel) pointed me in the right direction

And despite downloading and installing Microsoft Access Database Engine 2010 Redistributable, I still had an error.

EDIT : I should add this is the error I was getting

OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error". Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".

END EDIT

This post, and subsequently this post got me going in the right direction - essentially the account running the query needs permissions to the folder that is the temp directory of the account running the SQL Server service.

I was running this on my local instance, and normally the directory for a normal user is C:\Users\*user.name*\AppData\Local\Temp, but my SQL instance had been configured to run as Network Service - where is this account's temp directory? I managed to workaround the issue by changing the service account to a domain user.

This then got me thinking, on the live server, SQL is running under LocalSystem - again where would I find this account's temp directory.

So finally, the question.... where is the 'user' temp directory for

  • Local Service (NT AUTHORITY\LOCAL SERVICE)
  • Network Service (NT AUTHORITY\NETWORK SERVICE)
  • Local System (NT AUTHORITY\SYSTEM)
and does it differ across Windows Server 2008, Server 2008R2, Windows 7, etc....
more ▼

asked Aug 08 '11 at 02:18 AM in Default

Kev Riley gravatar image

Kev Riley ♦♦
50.8k 43 49 76

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

I believe the path would be under: C:\Windows\system32\config\systemprofile\AppData\Local\Temp

I checked an Windows XP and Windows 7 and that is the directory. I don't believe it has changed but have not confirmed it.

EDIT Test done so far on Windows 7 machine. Setup PowerShell script to execute 2 commands...

 $env:USERNAME | Out-file Testit.txt $env:TEMP | Out-File Testit.txt -Append 

Results:

  • Run as System (NT AUTHORITY\SYSTEM) = Hostname / C:\Windows\TEMP
  • Run as Network Service (NT AUTHORITY\NETWORK SERVICE) = Hostname / C:\Windows\SERVIC~2\NETWOR~1\AppData\Local\Temp
  • Run as Local Service (NT AUTHORITY\LOCAL SERVICE) = Hostname / C:\Windows\SERVIC~2\LOCALS~1\AppData\Local\Temp
more ▼

answered Aug 08 '11 at 03:03 AM

Shawn_Melton gravatar image

Shawn_Melton
5.3k 17 21 29

One directory for all 3 service accounts?
Aug 08 '11 at 03:18 AM Kev Riley ♦♦
I presume the 'SERVIC~2' is ServiceProfiles?
Aug 08 '11 at 04:34 AM Kev Riley ♦♦
Yep. That is what I am presumm'n.
Aug 08 '11 at 04:58 AM Shawn_Melton
(comments are locked)
10|1200 characters needed characters left

According to [this Stackoverflow post][1] the location does differ from pre Win7/2008 and post Win7/2008.

Windows XP (and I would think Windows 2003) has an entry under "Documents and Settings" Windows 7/2008/2008R2 uses C:\AppData or C:\Windows\Temp

Great question BTW (+1) [1]: http://stackoverflow.com/questions/3637605/where-can-a-service-running-under-the-local-service-account-save-its-state
more ▼

answered Aug 08 '11 at 03:00 AM

WilliamD gravatar image

WilliamD
25.8k 17 19 41

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x24
x9
x9
x6

asked: Aug 08 '11 at 02:18 AM

Seen: 9103 times

Last Updated: Aug 08 '11 at 04:43 AM