Query for specific group membership, export to csv

I currently have a one liner that uses get-aduser to query for users that have not logged in and then I do some filtering. I have managed to get the memberof attribute to display correctly in a csv file. I would like to be able to sort on specific group membership. I orginally thought about splitting group membership into separate columns but I thought this might result in inconsistent results. How would I go about creating some custom columns in my csv file and doing boolean evaluation of specific group membership? If any more experienced powershell users have some better ideas than this, I would appreciate any help. I have about five groups that I want to be able to sort with.

$Date = (Get-date).AddMonths(-26).Date
get-aduser -Filter {(memberOf -ne “DN of group name”)} -Properties DisplayName,SamAccountName,GivenName,Surname,StreetAddress,State,LastLogonDate,Created,EmailAddress,memberof,lastlogontimestamp -SearchBase “targetOU” -SearchScope Subtree -Server FQDN of server| Select DisplayName,SamAccountName,GivenName,Surname,StreetAddress,State,LastLogonDate,Created,EmailAddress,@{name=‘MemberOf’; expression={ ($.MemberOf | ForEach { ($ -split ‘,’)[0] -replace ‘CN=’,‘’}) -join ‘,’}},@{N=‘LastLogonTimestamp’; E={[DateTime]::FromFileTime($.LastLogonTimestamp)}} | where-object {$.lastlogontimestamp -lt $Date} | export-csv file path -NoTypeInformation

I figured something out on this, no help needed.

Jesse,
how did you manage to solve your issue?
Thanks