Category Powershell

Exchange Online Mailbox Counts

Exchange Online Mailbox counts – PowerShell Command Get-exomailbox -resultsize unlimited |select DisplayName, UserPrincipalName, Alias, PrimarySmtpAddress, RecipientTypeDetails, EmailAddresses |export-csv “c:\MonthlyReport\AllMailboxescount.csv” -Notypeinformation

DAG Management CMDlets

DAG Management PowerShell Commands Get DAG Status Get-DatabaseAvailabilityGroup <dag name> -Status | fl StartDagServerMaintenance.ps1 script to put the DAG member in maintenance mode .\StartDagServerMaintenance.ps1 -serverName <server name> StopDagServerMaintenance.ps1 script to take the DAG member out of maintenance mode .\StopDagServerMaintenance.ps1 -serverName…

Mailbox Import Export CMDlets

Mailbox Import \ Exports PowerShell Commands Export a Mailbox to PST New-MailboxExportRequest -Mailbox user@domain.org -FilePath “\\path\user.pst” Get Mailbox Export Requests Get-MailboxExportRequest | Get-MailboxExportRequestStatistics Remove Mailbox Export Requests Get-MailboxExportRequest | Remove-MailboxExportRequest Export Mailbox to PST New-MailboxExportRequest -Mailbox user@domain.org -FilePath “\\path\user.pst” Import Mailbox…

Managing Mailbox Permissions CMDlets

Managing Mailbox Permissions PowerShell Commands Grant Send on Behalf of Permissions Set-Mailbox ‘user@domain.com’ -GrantSendOnBehalfTo ‘user@domain.com’ Add Editor permissions Add-MailboxFolderPermission -Identity ‘user@domain.com’ -User ‘user@domain.com’ -AccessRights Editor Add Reviewer permissions (what if) Set-MailboxFolderPermission -Identity ‘user@domain.com’ -User ‘user@domain.com’ -AccessRights Reviewer -whatif Getting Mailbox Folder…

Resource Rooms and Calendars CMDlets

Exchange Resource Rooms and Calendars PowerShell CMDlets Disable Double Booking of Meeting Rooms Set-CalendarProcessing -Identity ‘room’ -AllowConflicts:$false Disable Double Booking on all Meeting Rooms Get-Mailbox | where {$_.ResourceType -eq “Room” } | Set-CalendarProcessing -AllowConflicts:$false Get Status of Meeting Rooms Calendars Get-CalendarProcessing…

Managing Groups CMDlets

Managing Exchange Groups PowerShell CMDlets Get Distribution Group Get-DistributionGroup -identity ‘user@domain.com’ | fl Get Distribution Group Members and export to a text file Get-DistributionGroupMember -Identity ‘group@domain.com’ | ft name, primarysmtpaddress > c:\path\file.txt Get Distribution Group information Get-DistributionGroup -Identity ‘group@domain.com’ |…

Exchange Mail Queue Management CMDlets

Exchange Mail Queue Management PowerShell CMDlets Get Message Queue information Get-transportserver | Get-Queue –SortOrder: -MessageCount Get Queue Details Get-Queue –Server <server name> | Sort-Object -Property Messagecount | FT Identity, DeliveryType, NextHopDomain, Status, MessageCount, LastRetryTime, LastError -autosize Move Messages to Another Working…

Message Tracking CMDlets

Exchange Message Tracking PowerShell CMDlets Search by Message ID Get-ExchangeServer | get-messagetrackinglog -MessageID “<messageID>” -Start “5/16/2012 12:01:00 AM” -End “5/16/2012 11:59:00 PM” | fl Timestamp,ClientIp,ClientHostname,ServerIp,ServerHostname,Source,EventId,MessageId, @{Name=”Recipients”;Expression={$_.recipients}},@{Name=”Recipientstatus”;Expression={$_.recipientstatus}},TotalBytes,MessageSubject,Sender,ReturnPath,MessageLantency Search by Sender Get-ExchangeServer | get-messagetrackinglog -sender user@domain.com -Start “11/15/2012 12:00:00 AM” -End “11/16/2012…

Exchange Event Logs CMDlets

Exchange Event Log Powershell CMDlets To view only the Exchange-related services that are currently running Get-Service *exch* | Where-Object {$_.Status -eq ‘Running’} The following example retrieves the services from every Exchange server in the organization: Get-ExchangeServer | ForEach-Object {Get-Service *exch*…