{"id":186,"date":"2015-07-27T16:58:30","date_gmt":"2015-07-27T20:58:30","guid":{"rendered":"http:\/\/passionwind.com\/techref\/?p=186"},"modified":"2015-07-27T16:58:30","modified_gmt":"2015-07-27T20:58:30","slug":"authenticate-user-to-security-group","status":"publish","type":"post","link":"http:\/\/techref.camellarry.com\/?p=186","title":{"rendered":"Authenticate User to Security Group"},"content":{"rendered":"<p><span style=\"font-family: 'courier new', courier, monospace;\"><\/span>Imports System.Security.Principal<\/p>\n<p>Public Class Form1<br \/>\nPublic id As WindowsIdentity = WindowsIdentity.GetCurrent()<br \/>\nPublic User As WindowsPrincipal = New WindowsPrincipal(id)<\/p>\n<p>Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load<br \/>\nDim flg As Boolean = User.IsInRole(&#8220;Domain\\Security Group&#8221;)<\/p>\n<p>Select Case flg<br \/>\nCase True<br \/>\nMsgBox(&#8220;I am a member of the group&#8221;)<br \/>\nCase False<br \/>\nMsgBox(&#8220;Not a member&#8221;)<br \/>\nEnd Select<\/p>\n<p>End<br \/>\nEnd Sub<\/p>\n<p>End Class<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Imports System.Security.Principal Public Class Form1 Public id As WindowsIdentity = WindowsIdentity.GetCurrent() Public User As WindowsPrincipal = New WindowsPrincipal(id) Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Dim flg As Boolean = User.IsInRole(&#8220;Domain\\Security Group&#8221;) Select Case flg Case True MsgBox(&#8220;I am a member of the group&#8221;) Case False MsgBox(&#8220;Not a member&#8221;) End Select End [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[9],"tags":[12,13,29,58,72,74,76,77,78,80],"class_list":["post-186","post","type-post","status-publish","format-standard","hentry","category-vb-net","tag-net","tag-active-directory","tag-example","tag-programming","tag-syntax","tag-tutorial","tag-vb","tag-vb-net","tag-visualbasic","tag-windows"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9t3oE-30","_links":{"self":[{"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/posts\/186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=186"}],"version-history":[{"count":4,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/posts\/186\/revisions"}],"predecessor-version":[{"id":236,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/posts\/186\/revisions\/236"}],"wp:attachment":[{"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}