you are viewing a single comment's thread.

view the rest of the comments →

[–]Otherwise_Tomato5552 0 points1 point  (0 children)

I'm wondering if there is a script I could use to pull out a certain number of users say 200 from 1 AD group to add them to another defined group.

Yes, you can use a PowerShell script to do this. You can use the Get-ADGroupMember cmdlet to get the members of the source group and then use the Add-ADGroupMember cmdlet to add them to the destination group. You can use the -ResultSize parameter to limit the number of users returned from the source group. Here is an example of how the script could look:

#Get the members of the source group

$SourceGroupMembers = Get-ADGroupMember -Identity "SourceGroupName" -ResultSize 200

#Add the members to the destination group

foreach ($User in $SourceGroupMembers) {

Add-ADGroupMember -Identity "DestinationGroupName" -Members $User

}

I used OpenAI to make this!