{"id":341,"date":"2019-02-21T13:29:57","date_gmt":"2019-02-21T19:29:57","guid":{"rendered":"https:\/\/sysadminnightmare.com\/?p=341"},"modified":"2019-02-22T11:45:41","modified_gmt":"2019-02-22T17:45:41","slug":"compare-ad-groups","status":"publish","type":"post","link":"https:\/\/sysadminnightmare.com\/index.php\/2019\/02\/21\/compare-ad-groups\/","title":{"rendered":"Compare AD Groups"},"content":{"rendered":"\n<p>Not sure how I missed this in the past, or have not had this come up before, but here is something I just had to use today.<\/p>\n\n\n\n<p>Comparing 2 AD Groups in Poweshell.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>diff (Get-ADGroupMember \"Group1\") (Get-ADGroupMember \"Group2\") -Property 'SamAccountName' -IncludeEqual<\/code><\/pre>\n\n\n\n<p>You will get 2 columns:<\/p>\n\n\n\n<p>SamAccountName            SideIndicator<\/p>\n\n\n\n<p>User                                    (== or &lt;= or =&gt;<\/p>\n\n\n\n<p>== in both<\/p>\n\n\n\n<p>&lt;= in first group<\/p>\n\n\n\n<p>=&gt; in Second group<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Not sure how I missed this in the past, or have not had this come up before, but here is something I just had to use today. Comparing 2 AD Groups in Poweshell. You will get 2 columns: SamAccountName SideIndicator User (== or &lt;= or =&gt; == in both &lt;=&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/sysadminnightmare.com\/index.php\/2019\/02\/21\/compare-ad-groups\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[2,7,8],"tags":[],"class_list":["post-341","post","type-post","status-publish","format-standard","hentry","category-admin","category-powershell-2","category-tech-tips-101"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2bgeE-5v","_links":{"self":[{"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/posts\/341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/comments?post=341"}],"version-history":[{"count":2,"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/posts\/341\/revisions"}],"predecessor-version":[{"id":348,"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/posts\/341\/revisions\/348"}],"wp:attachment":[{"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/media?parent=341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/categories?post=341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/tags?post=341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}