Powershell- Testing multiple group identities.

Hi, Im new to scripting and need help with testing multiple groups. For example, below in the first block, for $Adage, I want to test for “Adage_app” and “Adage_Users”. How do i properly test both on the same line? The second block is just to show you how I will output the results to the screen.

# Check for interesting groups before we remove group memberships

$Adage = Test-Group -Identity “Adage_app” -User $UserObject

$BusObjects = Test-Group -Identity “App_Horizon_BowBusObjTS01_BusinessObjects” -User $UserObject

$Dolphins = Test-Group -Identity “App_Horizon_Dolphins2.0” -User $UserObject

# Return object with user name and archive path

$ReturnObject = New-Object -TypeName PSObject

$ReturnObject | Add-Member -MemberType NoteProperty -Name Name -Value $UserObject.Name

$ReturnObject | Add-Member -MemberType NoteProperty -Name SamAccountName -Value$UserObject.SamAccountName

$ReturnObject | Add-Member -MemberType NoteProperty -Name HasInPlaceHolds -Value ([Boolean]($MailboxObject.InPlaceHolds))

submitted by /u/luis71097
[link] [comments]

Leave a Reply