PC Review


Reply
Thread Tools Rate Thread

Access Denied to use WMI getting remote resource

 
 
LamSoft
Guest
Posts: n/a
 
      7th Jun 2007
I have the access denied on my ASP.NET C# program while deploy my project from my PC (WinXP) to Server 2003
The program works fine on my PC but get access denied on Server 2003.

However the program works fine on Windows Server 2003 while trying to use WMI to get resource from the itsself computer, just has the problem while remoting to other computer.

I did put the permission of all security to "Everyone" on "Windows Managment and Instrustmentation" in Component Service, or even put the ASP.NET account is as a group of Administrators and no help, did I do anything wrong? Thank you.

Here is the stack trace:
[UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))]
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) +0
System.Management.ManagementScope.InitializeGuts(Object o) +784
System.Management.ManagementScope.Initialize() +216
System.Management.ManagementScope.Connect() +5
_Default.showUserList(String password, String server) +293
_Default.btnSubmit_Click(Object sender, EventArgs e) +58
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102



Here is some of the code in "Default.aspx"

Protected Sub showUserList(ByVal password As String, ByVal server As String)
If server = "" Then
MS = New ManagementScope("\\.\root\cimv2")
MS.Connect()
objQuery = New System.Management.ObjectQuery("Select Name from Win32_UserAccount")
Else
conn.Username = "administrator"
conn.Password = password
MS = New ManagementScope("\\" & server & "\root\cimv2", conn)
MS.Connect()
objQuery = New System.Management.ObjectQuery("Select Name from Win32_UserAccount")
End If
.........
End Sub
 
Reply With Quote
 
 
 
 
Michael Nemtsev
Guest
Posts: n/a
 
      7th Jun 2007
Hello LamSoft,

Maybe this helps http://dotnetjunkies.com/Forums/Show...x?PostID=11159
guys discussed the same problem

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

L> System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal
L>


 
Reply With Quote
 
LamSoft
Guest
Posts: n/a
 
      7th Jun 2007
I changed the processModel back to machine from system. system runs as
localsystem with high permissions while machine runs as low privilege user
account.

Sorry, I don't understand that guy meaning, what is the processModel and
where he changed the permission?
Thanks

"Michael Nemtsev" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello LamSoft,
>
> Maybe this helps
> http://dotnetjunkies.com/Forums/Show...x?PostID=11159
> guys discussed the same problem
>
> ---
> WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
> http://spaces.live.com/laflour
> Team blog: http://devkids.blogspot.com/
>
> "The greatest danger for most of us is not that our aim is too high and we
> miss it, but that it is too low and we reach it" (c) Michelangelo
>
> L> System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal
> L>
>



 
Reply With Quote
 
Michael Nemtsev
Guest
Posts: n/a
 
      7th Jun 2007
Hello LamSoft,

MSDN will help u http://msdn2.microsoft.com/en-us/library/7w2sway1.aspx

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

L> I changed the processModel back to machine from system. system runs
L> as localsystem with high permissions while machine runs as low
L> privilege user account.
L>
L> Sorry, I don't understand that guy meaning, what is the processModel
L> and
L> where he changed the permission?
L> Thanks
L> "Michael Nemtsev" <(E-Mail Removed)> wrote in message
L> news:(E-Mail Removed)...
L>
>> Hello LamSoft,
>>
>> Maybe this helps
>> http://dotnetjunkies.com/Forums/Show...x?PostID=11159 guys
>> discussed the same problem
>>
>> ---
>> WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
>> http://spaces.live.com/laflour
>> Team blog: http://devkids.blogspot.com/
>> "The greatest danger for most of us is not that our aim is too high
>> and we miss it, but that it is too low and we reach it" (c)
>> Michelangelo
>>
>> L> System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal
>> L>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access to the resource was denied with Cal shares and Win Live IDs Graham Martin Microsoft Outlook Calendar 1 16th Feb 2009 04:58 PM
Very annoying error: Access to the path is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity Jay Microsoft ASP .NET 2 20th Aug 2007 08:38 PM
Access Denied to Network Resource =?Utf-8?B?QnJ1Y2UgTWFtb250?= Windows XP Networking 0 11th Mar 2007 05:30 PM
HTTP 401.3 - Access denied by ACL on resource Sosh123 Microsoft ASP .NET 0 2nd Jun 2005 09:55 AM
you have been denied access to some resource in dcomcnfg Microsoft Windows 2000 Security 0 30th Oct 2003 04:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:53 PM.