Win 7 Pro 32 bit, Class: WindowsPrincipal's method: IsInRole is throwing exception: "The trust relationship between this workstation and the primary domain failed."
Hi, In Win 7 Pro 32 bit, Class: WindowsPrincipal's method: IsInRole is throwing exception: "The trust relationship between this workstation and the primary domain failed." Situation is we have to identify whether user belongs to some user group (user group name passed as parameter) or not. Following code is working fine if system is connected to server, but in case its is disconnected from server, its is throwing exception for local and domain users. Are we missing something, or is there any work around. Code: try { WindowsPrincipal windowsPrinciple = new WindowsPrincipal(WindowsIdentity.GetCurrent()); isGroupUser = windowsPrinciple.IsInRole(@userGroup.ToString()); // this line is causing problem Group = userGroup; FullName = WindowsIdentity.GetCurrent().Name; } catch (Exception ex) { throw; } return isGmmpGroupUser;
June 28th, 2011 6:37pm

Hi Manish_Srivastava, This forum focus on Windows 7 usage-related questions, therefore, I recommend you ask this question in MSDN forum. Thanks for your understanding and cooperation! Regards, MiyaThis posting is provided "AS IS" with no warranties, and confers no rights. | Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
June 30th, 2011 11:21am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics