Click here to Skip to main content
15,894,270 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDynamic Menus using IHierarchicalDataSource Pin
neilbelfast20-Nov-07 12:08
neilbelfast20-Nov-07 12:08 
QuestionEncryption password Pin
mehran.asg20-Nov-07 11:21
mehran.asg20-Nov-07 11:21 
AnswerRe: Encryption password Pin
Hesham Amin20-Nov-07 12:07
Hesham Amin20-Nov-07 12:07 
AnswerRe: Encryption password Pin
Michael Sync20-Nov-07 15:46
Michael Sync20-Nov-07 15:46 
AnswerRe: Encryption password Pin
John-ph20-Nov-07 18:51
John-ph20-Nov-07 18:51 
QuestionDeclarativeCatalogPart Pin
TheEagle20-Nov-07 10:35
TheEagle20-Nov-07 10:35 
QuestionGridview Printing Pin
danielleroy20-Nov-07 8:31
danielleroy20-Nov-07 8:31 
QuestionNeed help impersonating a user Pin
dalge20-Nov-07 5:23
dalge20-Nov-07 5:23 
I am developing a web application of which I am scanning all computers in our intranet. During the scan of each computer, I am attempting to determine if they have certain services installed or running so I will need to execute these as an administrator. I am trying to impersonate the domain administrator in the web.config and not having much luck. Here is what I put in the web.config file:

<system.web>
<identity impersonate ="true" userName ="DOMAIN\Admin" password ="password"/>

during my initialization of the web app, I am connecting to a SQL Server 2005 express database file and deleting records in case there were any left from the previous run. My code is as follows:

Dim conn As New System.Data.SqlClient.SqlConnection
Dim cmd As New System.Data.SqlClient.SqlCommand
Dim strDate As String = Now.AddHours(-3).ToString
With conn
.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("NetworkConnectionString").ConnectionString
.Open() 'Failed Line
End With

When I have the line in the web config shown above, I get an error on the failed line in code that says:

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

Based on this message, I would assume that I need to have a profile for the domain admin on the machine running the web server, which it has. Right now, the web server is on my local machine but will be eventually installed on our company's web server but I want to get this working before copying it up. All code in the web app is written in VB.NET.

If anyone has any suggestions, I would appreciate it very much. This is my first attempt at impersonation and the code I've tried to implement was from web sites specific in ASP.NET/VB.NET.

Thanks for any help!

David
GeneralRe: Need help impersonating a user Pin
dalge20-Nov-07 5:28
dalge20-Nov-07 5:28 
GeneralRe: Need help impersonating a user Pin
Pete O'Hanlon20-Nov-07 11:19
mvePete O'Hanlon20-Nov-07 11:19 
QuestionAJAX Confirm Button Extender Pin
Sarfaraj Ahmed20-Nov-07 5:12
Sarfaraj Ahmed20-Nov-07 5:12 
AnswerRe: AJAX Confirm Button Extender Pin
M_Menon20-Nov-07 6:13
M_Menon20-Nov-07 6:13 
GeneralRe: AJAX Confirm Button Extender Pin
Sarfaraj Ahmed20-Nov-07 6:28
Sarfaraj Ahmed20-Nov-07 6:28 
AnswerRe: AJAX Confirm Button Extender Pin
SABhatti20-Nov-07 6:40
SABhatti20-Nov-07 6:40 
GeneralRe: AJAX Confirm Button Extender Pin
Sarfaraj Ahmed20-Nov-07 8:29
Sarfaraj Ahmed20-Nov-07 8:29 
AnswerRe: AJAX Confirm Button Extender Pin
SABhatti20-Nov-07 10:30
SABhatti20-Nov-07 10:30 
QuestionSettings is not a member of my Pin
JMUREKEZI20-Nov-07 4:58
JMUREKEZI20-Nov-07 4:58 
AnswerRe: Settings is not a member of my Pin
Not Active20-Nov-07 11:47
mentorNot Active20-Nov-07 11:47 
GeneralRe: Settings is not a member of my Pin
JMUREKEZI21-Nov-07 4:02
JMUREKEZI21-Nov-07 4:02 
QuestionExecute a SSIS package from aspx Pin
srinandan..20-Nov-07 4:04
srinandan..20-Nov-07 4:04 
AnswerRe: Execute a SSIS package from aspx Pin
Michael Sync20-Nov-07 4:52
Michael Sync20-Nov-07 4:52 
QuestionWebconfig + SQL Server 2003 Pin
Ibuprofen20-Nov-07 3:37
Ibuprofen20-Nov-07 3:37 
AnswerRe: Webconfig + SQL Server 2003 Pin
Michael Sync20-Nov-07 4:43
Michael Sync20-Nov-07 4:43 
GeneralRe: Webconfig + SQL Server 2003 Pin
Ibuprofen21-Nov-07 4:26
Ibuprofen21-Nov-07 4:26 
QuestionReport Problem Pin
macca2420-Nov-07 3:30
macca2420-Nov-07 3:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.