[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Export data from ASP.Net to EXCEL 2010, do we need local administrator credential to run?

Posted on 2011-10-06
7
Medium Priority
?
474 Views
Last Modified: 2012-05-12
Hello experts!
My team has been developing an intranet application in ASP.Net, with Excel 2010 installed on the application server. Only local administrators can download the Excel file. Users, remote desktop users are asked to login. To automate that, we are considering iimpersonation in ASP.Net, but do we need local admin? And why?

Thank you,
KS
0
Comment
Question by:Lighthouse325
  • 4
  • 3
7 Comments
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 36929119
you don't need admin right to create a file - just a permission to save the file on the folder where it will be saved temporarily
Admin is a big permission and to save a file its just a folder access and that should solve your problem at hand
0
 

Author Comment

by:Lighthouse325
ID: 36931272
Thank you for reply raqi0017.
However, remote users can't run EXCEL on the application server.
The system only allows local admin for the access, but we don't want to give them the credential.
Possible solutions we found are;
1. Grant local admin "Network Service"
2. Impersonate as local admin.
My question is why do we need local admin to run EXCEL.
And is there better solution?

Thanks,
KS
0
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 750 total points
ID: 36940806
impersonation is the best answer
you dont need admin rights as i mentioned in my post above but by default the asp.net application runs under very limited access and with that access the user cannot create a file in the folder
to solve this problem use impersonation and use the user for all the requests coming to the web server (this is the user under whose credentials the worker process is running and not the logged in user)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Lighthouse325
ID: 36943144
raqi0017,

We are going for the impersonation.
We tested with EXCEL2010 and got errors where adding books.

Windows server 2003
Visual studio 2005
Language: VB.Net

Program code
---------------------------------------------------------------------------------------------------------------------------   Dim objExcel As New Excel.Application
   Dim objBooks As Excel.Workbooks = objExcel.Workbooks
   'Open new excel book
   Dim objBook As Excel.Workbook = objBooks.Add                <-- getting an error
   Dim objSheets As Excel.Worksheet = objBook.Sheets("Sheet1")
---------------------------------------------------------------------------------------------------------------------------
So far, to work around this error, impersonating accout needs to be an administrator.
Appreciate your help!!
KS


0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 36943654
what is the exception thats coming
can ou please provide some details
0
 

Author Comment

by:Lighthouse325
ID: 36944221
Here is the exception;

Exception from HRESULT: 0x800A03EC
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC

Source Error:

Line 601:        'Dim objBooks As Excel.Workbooks = objExcel.Workbooks.Add(True)
Line 602:        'Open new excel book
Line 603:        Dim objBook As Excel.Workbook = objExcel.Workbooks.Add
Line 604:
Line 605:        Dim objSheets As Excel.Worksheet = objBook.Sheets("Sheet1")

Thanks,
KS
0
 

Author Closing Comment

by:Lighthouse325
ID: 36970869
Thank you for the advicem, raqi0017. Although we could never configure without assign the impersonating account as local admin, it basically solve it.
0

Featured Post

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.

Question has a verified solution.

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

Lately there has been a variety of news related to U.S. employment.  Stories about worker productivity, automobile and airline unions, low employment and foreign laborers have frequented the news.  Each story has good and bad attributes we might arg…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Suggested Courses

834 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