Reputation: 4495
after performing a Get-ADObject query i got two PSObjects (for 2 separate OUs), lets call them $query1 and $query2, which contain Member-Objects of type
Selected.Microsoft.ActiveDirectory.Management.ADObject
Now i want to merge those two PSObjects, $query1 and $query2, into one single PSObject that contains the ADObjects of both queries but i don't really know how to do such a thing.
Upvotes: 3
Views: 11409
Reputation: 37730
I tested this quickly with arrays and it should work with a collection of AD object (just don't have time to test that right now). If it does not, let me know, there is a more explicit if more verbose method.
$combined = @()
$combined += $query1
$combined += $query2
Upvotes: 10