Powershell

[EXO] Various ways to grab all SMTP address from mailbox

 

[EXO] Identifying Validation Errors

$errors = (Get-MsolContact –ObjectID <Object_ID>).Errors $errors | foreach-object {“nService: ” + $_.ErrorDetail.Name.split(“/”)[0]; “Error Message: “+ $_.ErrorDetail.ObjectErrors.ErrorRecord.ErrorDescription} $errors = (Get-MsolGroup –ObjectID <Object_ID>).Errors $errors | foreach-object {“nService: ” + $_.ErrorDetail.Name.split(“/”)[0]; “Error Message: “+ $_.ErrorDetail.ObjectErrors.ErrorRecord.ErrorDescription} $errors = (Get-MsolUser -UserPrincipalName “<User_ID>”).Errors $errors | foreach-object {“`nService: ” + $_.ErrorDetail.Name.split(“/”)[0]; “Error Message: ” + $_.ErrorDetail.ObjectErrors.ErrorRecord.ErrorDescription} Get-MsolUser -HasErrorsOnly -All | ft DisplayName,UserPrincipalName,@{Name=”Error”;Expression={($_.errors[0].ErrorDetail.objecterrors.errorrecord.ErrorDescription)}}   →

[EXO][EX2010] Removing dual mailboxes

Ensure you have a user mailbox backup prior to starting the following process as there is potential risk of data loss.  Options are to have a third party solution to perform a mailbox backup or export to PST (see new-mailboxexport cmdlet). Capture relevant information from on-premise exchange and exchange online. Grab the mailbox information (primary   →

[EX2010][EXO] Forwarding Address Export and Import

 

Single mailbox export to PST file

Add member of a role group which has the Mailbox Import Export role

Export primary mailbox:

  Export archive mailbox:

  More details https://docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/New-MailboxExportRequest?redirectedfrom=MSDN&view=exchange-ps

[PS][EX2010] E-mails Recieved per day of Month Report

.Synopsis E-mail Counting Script v1 by ELAU 10/10/19 – Script counts emails received for each day of the current month .DESCRIPTION – Script pulls days of the month and counts number of emails received for each day of the current month or days specified into a HTML report. – Script allows option to e-mail report   →

[PS] [EX2010] Recoverable Folder Size Report

Recoverable Folder Size Report v1 Crawls all mailboxes and pulls the recoverableitemsquota size Displays top 10 in HTML report Full CSV report is generated E-mails report with full report

 

[EX2010][PS] Recover mail items from Exchange

How do I recover an item after its been deleted? So long as the recoverable items purge duration has not exceeded, you can run the below command to pull e-mails. For more specific searchquery, reference Advanced Query Syntax (AQS).

Email  Meetings  Tasks  Notes  Docs  Journals  Contacts  IM   

[PS] Enable TLS 1.2 as default in Powershell

Check Supported protocol [Net.ServicePointManager]::SecurityProtocol [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12   Change Net Frame to use TLS 1.2 Set-ItemProperty -Path ‘HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319’ -Name ‘SchUseStrongCrypto’ -Value ‘1’ -Type DWord Set-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319’ -Name ‘SchUseStrongCrypto’ -Value ‘1’ -Type DWord  

[EX2010] Litigation Hold (Legal Hold)

Litigation Hold (Legal Hold) Used to preserve mailbox and electronically stored information in anticipation of legal proceedings, investigations, and unspecified reasons. Organizations may be required to inform when a user is placed on litigation hold. Specifications: Requires Discovery Management or Legal Hold Mgmt (RBAC) to place a mailbox in legal hold Option to enable or   →