best business builder

Bulk convert AD groups

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…or 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.

Consider the aforementioned Domain Local to Global conversion. As the astute reader will know, a Domain Local to Global conversion isn’t 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 here.

01
02
03
04
05
06
07
08
09
10
# Get all the groups in the OU we're targeting
$groups = Get-ADGroup -Filter * -SearchBase "OU=File Shares,OU=Groups,DC=Contoso,DC=com"
# Recurse through each group
Foreach ($group in $groups) {
  # Make it universal
  $group | Set-ADGroup -GroupScope 2
  # Make it global
  $group | Set-ADGroup -GroupScope 1
}

Got a project that needs expert IT support?

From Linux and Microsoft Server to VMware, networking, and more, our team at CR Tech is here to help.

Get personalized support today and ensure your systems are running at peak performance or make sure that your project turns out to be a successful one!

CONTACT US NOW
best vpn deal