Here you go. Make sure "get-aduser -filter {logoncount -gt 1} -searchscope subtree -searchbase "dc=domain,dc=com" | foreach {$account = $_.samaccountname" is on a single line when you run this. Best to save it as a ps1 file from the text editor. The "dc=domain,dc=com" is your domain name. So if the domain you want to run this on is random.local, the values in the quotes will be "dc=random,dc=local" .
For your subdomain, you'll need to add another dc= in there, so double.random.local is "dc=double,dc=random,dc=local"
I set it up so it will prompt you for the UPN suffix. Do not use the @, just the random.com part. The script will put the @ in there.
You may also need to be logged in as the Domain Administrator for the domain you run this on. I got some errors when I ran this as a regular user that was a member of the Domain Admins group. It ran fine as the default domain administrator account, though.