title: Purging deleted external user from AzureAD / Office 365 fails with UserNotFoundException
body: <p>I am trying to purge a deleted user from Office 365 / AzureAD. The way to do this seems to be <a href="https://docs.microsoft.com/en-us/powershell/module/msonline/remove-msoluser?view=azureadps-1.0" rel="nofollow noreferrer"><code>Remove-MsolUser</code></a> with the <code>-RemoveFromRecycleBin</code> flag.</p>
  
  <p>I can retrieve the user with </p>
  
  <pre><code>Get-MsolUser -All -ReturnDeletedUsers | ? {$_.userPrincipalName -eq $USERNAME}
  </code></pre>
  
  <p>When I try to remove it with</p>
  
  <pre><code>Remove-MsolUser -UserPrincipalName $USERNAME -RemoveFromRecycleBin
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>Remove-MsolUser : User Not Found in the Microsoft Online directory Deleted Users container.  User:
  xxxxxx#EXT#@yyyyyyyyy.
  In Zeile:1 Zeichen:1
  + Remove-MsolUser -UserPrincipalName $USERNAME -RemoveFromRecycleBin
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : OperationStopped: (:) [Remove-MsolUser], MicrosoftOnlineException
      + FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.UserNotFoundException,Microsoft.Online.Admini
     stration.Automation.RemoveUser
  </code></pre>
  
  <p><a href="https://support.microsoft.com/en-us/help/3019157/remove-msoluser-user-not-found-error-when-you-try-to-remove-a-user-fro" rel="nofollow noreferrer">https://support.microsoft.com/en-us/help/3019157/remove-msoluser-user-not-found-error-when-you-try-to-remove-a-user-fro</a> states </p>
  
  <blockquote>
    <p>This problem occurs if the user who is performing the action is not a global admin. </p>
  </blockquote>
  
  <p>However my using <strong>is</strong> global admin.</p>