Hello,
I created an application, that scans remote IIS servers/websites and get their location of log files. I need to check the amount of the log files. Obviously the log files are located in default location (customer decision :D ). Problem is that those locations are not as shared folders, so I need to access them via IPC (administrative shares).
Logs are mostly located here (depends on ID of website):
"\\servername\c$\windows\system32\logfiles\w3c... " .
The location is correct as I can add the folder path to explorer and open the location from any server.
It is an Active Domain environment and my account is on each server in Administration group. I run the application under my own account. On server where I am logged, it works without any problems (locally).
I tried impersonating it, but as it looks like, the ActiveDomain politics probably disabled my account. So I cannot do proper testing on what works or not.
...
DirectoryInfo theFolder = new DirectoryInfo(path);
foreach (FileInfo thefile in theFolder.GetFiles())
{
average_sizeKB+=thefile.Length;
}
I need only simple file listening.
Do you have an idea how is the best way to overcome this problem?