{"id":3351,"date":"2014-08-28T21:12:40","date_gmt":"2014-08-28T19:12:40","guid":{"rendered":"http:\/\/dollarunderscore.azurewebsites.net\/?p=3351"},"modified":"2017-06-05T21:26:16","modified_gmt":"2017-06-05T19:26:16","slug":"is-this-ad-group-still-used","status":"publish","type":"post","link":"https:\/\/p0wershell.com\/?p=3351","title":{"rendered":"Is this AD group still used?"},"content":{"rendered":"<p>That&#8217;s a pretty hard question to answer, and it depends on <em>how<\/em> the group is used.<\/p>\n<p>But one way of verifying this is to check when any of it&#8217;s members logged on last time. There is an obvious risk that the group is not used for anything in particular but it still might have users\/computers in it, but it might give you a hint.<\/p>\n<p>I therefor wrote an advanced function that can help you with this.<\/p>\n<p>It&#8217;s pretty straight forward to use, just write:<br \/>\n[PowerShell]<br \/>\nGet-ADGroupLastUsed -Identity &#8220;Domain Admins&#8221; -Recursive<br \/>\n[\/PowerShell]<\/p>\n<p>The &#8220;Recursive&#8221;-switch makes it resolve the members in all child groups. It works for both user and computer objects.<\/p>\n<p>This can be pretty useful in certain scenarios, and I hope it might be of use for you too!<\/p>\n<p><strong><em>The code is available at <a href=\"https:\/\/p0wershell.com\/wp-content\/uploads\/2017\/06\/Get-ADGroupLastUsed.ps1_.txt\" target=\"_blank\">this link<\/a>.<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>That&#8217;s a pretty hard question to answer, and it depends on how the group is used. But one way of verifying this is to check when any of it&#8217;s members logged on last time. There is an obvious risk that the group is not used for anything in particular but it still might have users\/computers [&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,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[831,21],"tags":[411,851],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3Zj0A-S3","_links":{"self":[{"href":"https:\/\/p0wershell.com\/index.php?rest_route=\/wp\/v2\/posts\/3351"}],"collection":[{"href":"https:\/\/p0wershell.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p0wershell.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p0wershell.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/p0wershell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3351"}],"version-history":[{"count":0,"href":"https:\/\/p0wershell.com\/index.php?rest_route=\/wp\/v2\/posts\/3351\/revisions"}],"wp:attachment":[{"href":"https:\/\/p0wershell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p0wershell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p0wershell.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}