![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | programmatically passing network credentials during file IO I'm writing a quick and dirty admin tool to check 308 servers for the Last Modified date of a specific file that exists in the same place on all 308 servers. Using the System.IO namespace objects to access FileInfo, I am getting a System.IO.IOException "Logon failure: unknown user name or bad password. " I want to pass a good user/pass combo using command-line arguments (no issues there) but I can't figure out how to get System.IO to use the user/pass specified when accessing the UNC's. Any ideas? Two workarounds I'm considering: 1) have the admin use RunAs... to execute the tool 2) Map an unused drive letter using different, valid credentials, check the file, then delete the drive mapping, rinse and repeat (Ugh, I know) Obviously, it'd be much nicer to specify a user/pass in my code when calling the FileInfo methods, but I can't find anything in the .Net docs that indicate this is possible. Cheers, Alan |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Trouble with remote file access and passing credentials in Powershell | PowerShell | |||
| Programmatically opening a file in its native program | .NET General | |||
| Re: copy-item + passing credentials | PowerShell | |||
| Programmatically (Win32/MFC) checking the status of mapped network | Vista General | |||
| Disable passing RDP inital credentials | Vista networking & sharing | |||