LogonUser works only for my domain

只谈情不闲聊 提交于 2019-11-29 07:52:09

You should try calling GetLastError right after LogonUser fail to see if any error information is given.

http://msdn.microsoft.com/en-us/library/ms679360(VS.85).aspx

There may be some issue with calling GetLastError from c#.
Look here for more information on this : http://blogs.msdn.com/adam_nathan/archive/2003/04/25/56643.aspx

Is there a trust between your two domains? If not, LogonUser will fail.

As Joel says you need trust between the domains.

You also need to be carefull with respect to the security context of the process doing the delegation, and which domain the machine you are running on is in.

Both the machine and the user account of the process must be trusted for delegation, by the domain that you are trying to access.

This means that your code should be running on the domain that you are trying to access.

Hope this helps

Shiraz

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