{"id":2353,"date":"2017-08-29T21:31:40","date_gmt":"2017-08-29T21:31:40","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=2353"},"modified":"2023-05-12T13:26:24","modified_gmt":"2023-05-12T18:26:24","slug":"bulk-convert-ad-groups","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=2353","title":{"rendered":"Bulk convert AD groups"},"content":{"rendered":"<p>With the advent of Windows PowerShell, performing bulk tasks just gets easier and easier. Consider a scenario where you have a bunch of Domain Local groups that you need to convert to Global\u2026or any other type of conversion. This is a task that can take a large amount of time to complete manually, even with copious amounts of coffee and House of Cards on the TV. Fortunately, a few lines of PowerShell can make short work of this.<\/p>\n<p>Consider the aforementioned Domain Local to Global conversion. As the astute reader will know, a Domain Local to Global conversion isn\u2019t a one-step process. Each group must first be converted to Universal. Why this caveat exists is far too detailed to discuss here, but Microsoft have a pretty ok writeup of it\u00a0<a title=\"Group scope\" href=\"https:\/\/technet.microsoft.com\/en-us\/library\/cc755692(v=ws.10).aspx\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<div>\n<div id=\"highlighter_607714\" class=\"syntaxhighlighter  powershell\">\n<p><span style=\"color: #008000;\"># Get all the groups in the OU we&#8217;re targeting<\/span><\/p>\n<p><span style=\"color: #0000ff;\">$groups = Get-ADGroup -Filter * -SearchBase &#8220;OU=File Shares,OU=Groups,DC=Contoso,DC=com&#8221;<\/span><\/p>\n<p><span style=\"color: #008000;\"># Recurse through each group<\/span><br \/>\n<span style=\"color: #0000ff;\">Foreach ($group in $groups) {<\/span><\/p>\n<p><span style=\"color: #0000ff;\">\u00a0\u00a0<span style=\"color: #008000;\"># Make it universal<\/span><\/span><br \/>\n<span style=\"color: #0000ff;\">\u00a0\u00a0$group | Set-ADGroup -GroupScope 2<\/span><span style=\"color: #0000ff;\">\u00a0<span style=\"color: #008000;\">\u00a0<\/span><\/span><\/p>\n<p><span style=\"color: #0000ff;\"><span style=\"color: #008000;\">\u00a0 # Make it global<\/span><\/span><br \/>\n<span style=\"color: #0000ff;\">\u00a0\u00a0$group | Set-ADGroup -GroupScope 1<\/span><br \/>\n<span style=\"color: #0000ff;\">}<\/span><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>With the advent of Windows PowerShell, performing bulk tasks just gets easier and easier. Consider a scenario where you have a bunch of Domain Local groups that you need to convert to Global\u2026or any other type of conversion. This is a task that can take a large amount of time to complete manually, even with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,59],"tags":[],"class_list":["post-2353","post","type-post","status-publish","format-standard","hentry","category-ad","category-powershell"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2353"}],"version-history":[{"count":3,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2353\/revisions"}],"predecessor-version":[{"id":3356,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2353\/revisions\/3356"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}