I have a CSV containing 150 - 200 AD logon names (SAMAccountNames?) and I need to loop through each user and clear their mailboxes.
I can do that using this command
Search-Mailbox -Identity "<MailboxOrMailUserIdParameter>" -DeleteContent -force
But the issue is that I need to be able to use the AD logon names, as I don't have the Identity?