param( $Location, [Switch]$DSK, [Switch]$LAP ) $DSKFILTER="${Location}DSK*" $LAPFILTER="${Location}LAP*" if ($DSK){ Get-ADComputer -Filter { (Enabled -eq $true) -and ((Name -like $DSKFILTER)) } } elseif ($LAP) { Get-ADComputer -Filter { (Enabled -eq $true) -and ((Name -like $LAPFILTER)) } } else { Get-ADComputer -Filter { (Enabled -eq $true) -and ((Name -like $DSKFILTER) -or (Name -like $LAPFILTER)) } }