Most efficient way exclude dynamic groups from policy script

I'm trying to figure out the easiest way to exclude dynamic groups from my policy scripts.

My goal is to exclude dynamic groups from policy scripts I have in place that restrict access.

I tried this first:

#Close out if dynamic group
$groupName = $DirObj.Get("Name")
dynamicGroup = (get-qadgroup $groupName -DontUseDefaultIncludedProperties -IncludedProperties edsadgconditionslist).edsadgconditionslist
if ($dynamicGroup) {return}

I thought this would be less expensive

#Close out if dynamic group
$DirObj.GetInfoEx(@("accountNameHistory"), 0)
$dynamicGroup = $DirObj.Get("accountNameHistory")
if ($dynamicGroup){return}

At the beginning of my script I have:

if($Request.Class -ne "group"){return}

I'd like the next line to be

if (group is dynamic group){return}

Parents Reply Children
No Data