T
tshad
I am trying to access my log files and am running into a permissions
problem.
I am doing the following:
******************************************************************
private void PopulateSiteBox()
{
drpSiteBox.Items.Clear();
string FILE_PATH = @"\\" +txtMachine.Text +
@"\C$\windows\System32\LogFiles\";
Trace.Warn("FILE_PATH = " + FILE_PATH);
DirectoryInfo di = new DirectoryInfo(FILE_PATH);
foreach(FileSystemInfo fsi in di.GetFileSystemInfos())
{
if(fsi.Name.StartsWith("W3"))
drpSiteBox.Items.Add(fsi.Name);
}
}
*********************************************************************
The error I am getting is on the GetFileSystemInfos() call. This is trying
to access:
FILE_PATH = \\sam\C$\windows\System32\LogFiles\
To get the W3... folder to get the name of the folder the ex040920.log is
in.
I tried to audit the folder LogFiles setting the success and failure to all
and to everyone. I wanted to find out what user is trying to access the
folder. I am not sure what user the asp.net is using.
The error I get is:
*****************************************************************************
Access to the path "\\tfs\C$\windows\System32\LogFiles\" is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path
"\\tfs\C$\windows\System32\LogFiles\" 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.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access.
******************************************************************************
As I said I did try to set the permissions to everyone to solve the problem
(temporarily). This is only on my WXP Pro machine so I am not concerned
with anyone getting access to my machine.
What do I need to set to make this work?
Thanks,
Tom.
problem.
I am doing the following:
******************************************************************
private void PopulateSiteBox()
{
drpSiteBox.Items.Clear();
string FILE_PATH = @"\\" +txtMachine.Text +
@"\C$\windows\System32\LogFiles\";
Trace.Warn("FILE_PATH = " + FILE_PATH);
DirectoryInfo di = new DirectoryInfo(FILE_PATH);
foreach(FileSystemInfo fsi in di.GetFileSystemInfos())
{
if(fsi.Name.StartsWith("W3"))
drpSiteBox.Items.Add(fsi.Name);
}
}
*********************************************************************
The error I am getting is on the GetFileSystemInfos() call. This is trying
to access:
FILE_PATH = \\sam\C$\windows\System32\LogFiles\
To get the W3... folder to get the name of the folder the ex040920.log is
in.
I tried to audit the folder LogFiles setting the success and failure to all
and to everyone. I wanted to find out what user is trying to access the
folder. I am not sure what user the asp.net is using.
The error I get is:
*****************************************************************************
Access to the path "\\tfs\C$\windows\System32\LogFiles\" is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path
"\\tfs\C$\windows\System32\LogFiles\" 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.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access.
******************************************************************************
As I said I did try to set the permissions to everyone to solve the problem
(temporarily). This is only on my WXP Pro machine so I am not concerned
with anyone getting access to my machine.
What do I need to set to make this work?
Thanks,
Tom.