Primary Group IDs are the RIDs for the Domain groups. The full list is here: Interesting Windows Computer & Active Directory Well-Known Security Identifiers (SIDs).
515 – Domain Computers
516 – Domain Controllers (writable)
521 – Domain Controllers (Read-Only)
This information helps filter computer objects to return only the desired computer type.
https://adsecurity.org/?p=873515 – Domain Computers
516 – Domain Controllers (writable)
521 – Domain Controllers (Read-Only)
This information helps filter computer objects to return only the desired computer type.
example
Get-ADComputer -Filter {PrimaryGroupID -eq 515} | where {$_.name -like "?????xw*" -or $_.name -like "DESKTOP*"} | select name | sort name | out-file $outputFile