문제

I am trying to verify whether the logged in user exists in a AD group or distribution list. I tried to use WindowsIdentity but that does not give me proper results. If I add a user to the DL and then check whether the user is in the DL, it gives me incorrect results.

I restarted my IIS and even cleared my browser cookies and cache, but no luck. Where does the IsInRole() function verifies for the user role. In AD or on local machine....? I tried to remove myself from local machine group too, but it still authorizes me for that group. Any help would be appreciated.

도움이 되었습니까?

해결책

If you are using .NET 3.5, you can consider to use Principal.IsMemberOf() in System.DirectoryServices.AccountManagement. I tried it and it works with AD security group as well as DL. More details about how to programming with groups can be found here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top