Basic commands of PowerShell

  1. Get-Mailbox -Identity * | ft name, alias #gives column name and an alias for all the list of emails available
  2. Get-Mailbox | sort Alias |ft Name, alias #sorts record by an alias
  3. Get-Mailbox -Identity “rajan.maharjan” | fl #give all columns for individual identity- rajan.maharjan
  4. get-MailboxMessageConfiguration -Identity rajan.maharjan | fl #to get email configuration detail
  5. get-MailboxMessageConfiguration -Identity rajan.maharjan | fl signatureHTML #to get email signature for particular user/email
  6. $newString = $oldString -replace “OLD_TEXT_GOES_HERE”, “NEW_TEXT_TO_REPLACE_WITH” #to replace text
  7. #to add HTML format email signature in office 365
    1. $sig = Get-Mailbox -Identity “rajan.maharjan”
    2. Set-MailboxMessageConfiguration -Identity $sig.Alias -DefaultFontName ‘Arial’ -AutoAddSignature $true -AutoAddSignatureOnReply $true -SignatureHtml “DYNAMIC_HTML_CODE_WITH_VARIABLE_VALUE_FROM_$sig”
    3. Write-host $sig.Alias ‘Signature Added’

Leave a Reply

Your email address will not be published. Required fields are marked *