title: Get the subject of a recieved email in PowerShell
body: <p>So I'm checking for an approach on a problem I have. </p>
  
  <p>I have an e-mail from my school (Office 365) and I wanted to print the email subject of each email that's located in my inbox with PowerShell. </p>
  
  <p>I already have found the method to lay a connection </p>
  
  <pre><code>$UserCredential = Get-Credential 
  $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://smtp.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
  function Connect-O365 {
      $session365 = New-PSSession `
                      -ConfigurationName Microsoft.Exchange `
                      -ConnectionUri "https://smtp.office365.com/powershell-liveid/" `
                      -Credential $UserCredential
                      -Authentication Basic `
                      -AllowRedirection 
      Import-Module (Import-PSSession $session365 -AllowClobber) -Global
  }
  </code></pre>
  
  <p>And have found the <code>Get-Mailbox</code> cmdlet. </p>
  
  <p>The problem now however is that I haven't found any real examples or methods that continue to help me printing the email subjects. </p>
  
  <p>I have done quite some research and didn't manage to find something like:</p>
  
  <pre><code>Get-Mailbox -Identity "user" |Select-MailBox * |Where-Object $_.MailBoxName = "Inbox"
  </code></pre>
  
  <p>Is this not possible or do I have to use another method? </p>