Accessing mapped drives when impersonating in ASP.NET

喜欢而已 提交于 2019-12-03 09:07:42
Scott

No, but you can use a symbolic link instead. Mklink /d will create a directory link.

You can only access mapped drives that were created by the user being impersonated.

So if you were to impersonate user X then map the share (e.g., via net use) then that share will be visible for as long as the impersonation is in effect.

You can determine which mapped drives are currently accessible via DriveInfo.GetDrives(). Drives with a DriveType of Network are accessible in the current security context.

kite

I tried the mklink solution from Scott, and it is not working with ASP.NET.

As for answer from arnshea: it is not working at all; I even impersonated with the domain administrator, and all permissions set to everyone, iuser and network service.

So the only solution: when you design your web application you must decide whether you want to save to network resource and use the UNC protocol for that.

A mapped network drive does not work with ASP.NET for regular file operations.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!