"select Name,Path from Win32_Share" permissions required by ASP.NET to return paths,

Posted: 09-02-2008, 02:33 AM

I'm tripping over ASP.NET local machine permissions with the followin
on an inside the firewall app
List<SharePathEntry> allLocalShares = new List<SharePathEntry>(); //
container for share=local path string pair
WqlObjectQuery objectQuery = new WqlObjectQuery ("select Name,Path fro
Win32_Share��)
ManagementScope scope = new ManagementScope(@\\.\root\cimv2); //[1
scope.Options.Impersonation = ImpersonationLevel.Impersonate; //[1
scope.Options.EnablePriveleges = true; //[1
ManagementObjectServer searcher = ne
ManagementObjectSearcher(scope,objectQuery)
foreach(ManagementObject share in searcher.Get()

object objName = share["Name"]
object objPath = share["Path"]
if(null!=objName

if(null!=objPath

AllLocalShares.Add(new SharePathEntry(objName.ToString()
objPath.ToString())

els

// non-null Name returned, null Path retruned only when running totall
[ 3 ] under ASP.NET...[ 4



[ 1 ] I've tried with and without these
[ 2 ] I'm running as admin when I hit webservice that uses this objec
[ 3 ] If I run webservice in F5 debug mode, works normally and ca
trace above
[ 4 ] If I run as webservice, condition [4] occurs
[ 5 ] If I run as webservice, then attach debug to asp.net process,
can trace above and see [4] occur
[ 6 ] Same code behind object running under NETWORK_SERVICE credential
on same local machine works normally
[ 7 ] I've randomly tried permissions as follows
Local Security Polic
LocalPolicies:User Rights Assignment : Profile system performanc
(Added ASP.NET) : does not fix the problem
LocalPolicies:User Rights Assignment : Perform volume maintenance task
(Added ASP.NET) : does not fix the problem
Full permissions granted to ASP.NET in security tab for
Computer Management: Services and Applications: WMI Control
Properties : Security : Root : CIMV2 and WMI : does not fix the proble

The only thing that has worked so far is to add asp.net account t
local administrators, run as admin. This is a dedicated/private insid
the firewall application, so OK-ish, but I'm hoping to just add th
required permission to asp.net account as is

--
developers2008

"select Name,Path from Win32_Share" permissions required by ASP.NET to return paths,


Responses to ""select Name,Path from Win32_Share" permissions required by ASP.NET to return paths,"

 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

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 On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabled permissions for "Everyone" but denied "change permissions" ed Windows Vista Security 0 07-11-2007 07:42 PM
"Open command prompt here" and "Copy as path" Moody Marco Windows Vista Performance & Maintenance 10 05-04-2007 04:41 PM
Help: SyncToy 1.4 in "Echo" mode doesn't auto-select/Copy "New" fi JeremyMoskowitz(MVP) Windows XP Photos 0 11-24-2006 08:21 PM
"Allow users to connect remotely to this computer" checkbox and "Select Remote Users..." button are both disabled in "Remote" tab R. G. Windows XP Work Remotely 2 04-08-2004 06:24 PM
"Select" or "Select all" sticks or stays on Jeffrey Evans Windows XP Performance & Maintenance 0 12-15-2003 08:15 PM