Advertisement
D0cEvil

Exchange Online - Quarantine Checking

Dec 6th, 2022
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PowerShell 0.44 KB | Cybersecurity | 0 0
  1. ## Authentication
  2.  
  3. Import-Module ExchangeOnlineManagement
  4.  
  5. $UserPrincipalName = Read-Host "Please put your UserPrincipalName"
  6. Connect-IPPSSession -UserPrincipalName $UserPrincipalName
  7.  
  8. # File location
  9.  
  10. $file = Get-Content "C:\auth_domains.txt"
  11.  
  12. # Loop for read file
  13.  
  14. Foreach ($line in $file) # no komments..
  15. {
  16.    Get-QuarantineMessage -SenderAddress "$line" | Out-File C:\quarantined_messages.txt -Append
  17.    #Write-Output $line
  18.    
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement