title: Bulk Deleting Mailboxes with PowerShell - Exchange 2016
body: <p>I am trying to delete 100+ mailboxes from our cloud hosted Exchange server with PowerShell, but I keep getting this error: </p>
  
  <p>The operation couldn't be performed because object '...' couldn't be found on '...'</p>
  
  <p>The blanks are obviously an object from the array and our Exchange server. I am pulling the objects (I have tried both Email Addresses and Display Names) from a .csv file with the header 'mailbox'. I have used Disable-Mailbox and Remove-Mailbox, to no avail.</p>
  
  <p>Here is my script:</p>
  
  <pre><code>Import-Csv "C:\temp\array.csv" | ForEach-Object {
      Remove-Mailbox -identity $_.mailbox -confirm:$false
  }
  </code></pre>
  
  <p>I have been Googling all day and I can't seem to find the reason why these objects, that are in fact mailboxes in our Exchange environment, can't be found.</p>