MikeTWebb
MikeTWebb

Reputation: 9279

"The specified network name is no longer available" error using LogonUser() in advapi32.dll DLL Import

I have a C# MVC3 .Net web app using .Net framework 4.0. Within our code we DLLImport advapi32.dll and use the LogonUser() method to Impersonate() a user in order to do FileIO on a shared drive on our network. This has been working just fine until yesterday. Now it only work intermittently. We get the "The specified network name is no longer available" error. However, when navigating to the shared drive, it works fine. I've talked to our Windows group and the account we are using to access the shares is not locked. As I said, it actually does work every once in awhile. This is a show stopper for us.

Upvotes: 0

Views: 2462

Answers (1)

MikeTWebb
MikeTWebb

Reputation: 9279

We found the issue. The Network team upgraded the version of Active Directory to 2008 R2 Program Level on one of the the clustered servers housing the shared drive. Somehow this disrupted the credentials of the service account we are using. Resetting the service account password updated the service account object in Active Directory. After this, everything worked. Strange but true....

If anybody has insight into why this might have happened, feel free to comment

Upvotes: 1

Related Questions