tisdag 14 april 2015

Copy Computers from group to other group

A small headache can ruin your day, you want to do a simple thing but cant do this in the standard Active Directory GUI

This is a small Powershell script that can help you on the way'

Run this command on the server that have the active directory cmdlet

$source = Get-ADGroupMember -Identity GROUP1
foreach ($S in $source)
{
    Add-ADGroupMember -Identity GROUP2 -Members $s.SamAccountName

}

What the script does is Copy members in GROUP1 and import them in GROUP2

Remember that the two groups must be in the same domain.

Good luck
/P

Inga kommentarer:

Skicka en kommentar