473,394 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Access Denied to use WMI getting remote resource

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.ThrowExcept ionForHRInternal(Int32 errorCode, IntPtr errorInfo) +0
System.Management.ManagementScope.InitializeGuts(O bject 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.RaisePostBackEven t(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection 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
Jun 7 '07 #1
3 7050
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

LSystem.Runtime.InteropServices.Marshal.ThrowExcep tionForHRInternal
L>
Jun 7 '07 #2
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" <ne*****@msn.comwrote in message
news:a2***************************@msnews.microsof t.com...
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

LSystem.Runtime.InteropServices.Marshal.ThrowExcep tionForHRInternal
L>

Jun 7 '07 #3
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

LI changed the processModel back to machine from system. system runs
Las localsystem with high permissions while machine runs as low
Lprivilege user account.
L>
LSorry, I don't understand that guy meaning, what is the processModel
Land
Lwhere he changed the permission?
LThanks
L"Michael Nemtsev" <ne*****@msn.comwrote in message
Lnews:a2***************************@msnews.microso ft.com...
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

LSystem.Runtime.InteropServices.Marshal.ThrowExce ptionForHRInternal
L>

Jun 7 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rene' Nielsen | last post by:
Context: Running Windows 2003 Server on an intranet. A web is configured with an anonymous access account that is a domain account that has been granted the desired access to a file on another...
3
by: buran | last post by:
Dear ASP.NET Programmers, I am trying to save a new created Word document, but getting the following the error. I granted the necessary rights to the ASPNET user, but I'm still getting this...
0
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
1
by: Duffman | last post by:
Hi, I have what seems to be a common problem, but the solutions I've found don't seem to work. I would like to use a web service to create a file at a UNC location in a shared file. Currently...
0
by: berkeleydb_user | last post by:
Guys On my development machine I have a very simple app that takes input from user from asp, runs some macros in excel and spits out the result back on asp page. This works perfectly well on my...
1
by: TerrenceJ | last post by:
Hi there I've configure our SBS 2003 server to allow remote access and Outlook over internet. The mail works fine, but when I try remote access, I am asked for username and password, which I...
3
by: Simon | last post by:
Hi All, I'm hoping someone will have some words of wisdom for me regarding MS Clustering on Windows 2003. I have a service that runs on a cluster. During invocation it's supposed to...
0
by: royan | last post by:
Help please! I have the same problem which this post ...
0
by: Mike | last post by:
When I run my asp.net web app, I keep getting the error message 'Access Denied'. I have all of my web apps running as a particular user id and password which is set in the web.config file but when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.