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




I'm tripping over ASP.NET local machine permissions with the following
on an inside the firewall app:
List<SharePathEntry> allLocalShares = new List<SharePathEntry>(); // a
container for share=local path string pairs
WqlObjectQuery objectQuery = new WqlObjectQuery ("select Name,Path from
Win32_Share&#65533;&#65533;) ;
ManagementScope scope = new ManagementScope(@\\.\root\cimv2); //[1]
scope.Options.Impersonation = ImpersonationLevel.Impersonate; //[1]
scope.Options.EnablePriveleges = true; //[1]
ManagementObjectServer searcher = new
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());
}
else
{
// non-null Name returned, null Path retruned only when running totally
[ 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 object
[ 3 ] If I run webservice in F5 debug mode, works normally and can
trace above.
[ 4 ] If I run as webservice, condition [4] occurs.
[ 5 ] If I run as webservice, then attach debug to asp.net process, I
can trace above and see [4] occur.
[ 6 ] Same code behind object running under NETWORK_SERVICE credentials
on same local machine works normally.
[ 7 ] I've randomly tried permissions as follows:
Local Security Policy
LocalPolicies:User Rights Assignment : Profile system performance
(Added ASP.NET) : does not fix the problem.
LocalPolicies:User Rights Assignment : Perform volume maintenance tasks
(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 problem

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


--
developers2008
.



Relevant Pages

  • Re: solving the problem of spsearch
    ... the service to run if I put my service account into the local machine ... After a lot of tinkering with COM launch permissions (which didn't ... to get the search service to run without error. ...
    (microsoft.public.sharepoint.windowsservices)
  • Power User in Win2k Pro/XP Pro/Terminal Server users
    ... are touching so you can go and change the permissions on ... Does anyone know how to create a local machine group ... Does anyone know how to create a Win2k Server group ...
    (microsoft.public.win2000.security)
  • Re: Cant set permissions
    ... >>to use a NTFS partition on one of them to back up data from the other. ... >>want to set permissions so that only the user of the PC doing the backup can ... >>unable to search anything other than the local machine. ...
    (microsoft.public.windowsxp.network_web)
  • Re: How can I Disable JIT Debugger for my builds?
    ... I'm not sure how much you know about .Net permissions but they are ... What you need to do is convince the newtork admins to grant your file share ... This FullTrust only affects the .Net security, ... > everything to the local machine and the DirectX builds worked immediately! ...
    (microsoft.public.win32.programmer.directx.managed)