This post originated from an RSS feed registered with .NET Buzz
by Steve Hebert.
Original Post: Fun with NAS devices and IIS
Feed Title: Steve Hebert's Development Blog
Feed URL: /error.htm?aspxerrorpath=/blogs/steve.hebert/rss.aspx
Feed Description: .Steve's .Blog - Including .Net, SQL Server, .Math and everything in between
I keep running into an interesting condition with an EMC NAS device.Part of our web front-end reads and writes files to an external EMC NAS device shared among the clustered web servers.When using a Samba-based NAS device, we configure IIS to run under a username / password that also exists on the NAS device.We then impersonate the account settings in ASP.NET using the web.config file. At this point, we can read/write to the device using UNC paths. (This solution is documented on MSDN several times, with the best code example I've found here - even though it's classic ASP).
This works great on the Samba device, but it does not work on the EMC device.
Hereâs the kicker â in order to get the EMC device working, we must pass the UNC along with username and password to WNetAddConnection2A.Even worse, we occasionally get a âFatal Network Errorâ exception thrown when doing reads and writes. My guess on this one is that an existing open connectionâs access token is invalidated by a subsequent call to WNetAddConnection2A by another IIS thread.I wonder if this explains why Windows Explorer refuses to allow different authentication credentials once youâve successfully mapped a drive to a given server?