954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Access to administrative shares programatically

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?

Seten
Junior Poster
168 posts since Oct 2005
Reputation Points: 9
Solved Threads: 11
 
Do you have an idea how is the best way to overcome this problem?


Not at this moment :)

I have a little doubt about Active Directory's part in your problem. Have you tried changing log files ACL?

Teme64
Veteran Poster
1,031 posts since Aug 2008
Reputation Points: 218
Solved Threads: 203
 

Not at this moment :)

I have a little doubt about Active Directory's part in your problem. Have you tried changing log files ACL?

I would like to do it, but on next checks they (admins) will renew it due to security standards. Therefore modify of existing setup is not an option for me.

Seten
Junior Poster
168 posts since Oct 2005
Reputation Points: 9
Solved Threads: 11
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: