Quantcast
Channel: Exchange 2013 – azure365pro.com
Viewing all 170 articles
Browse latest View live

Exchange Server C Drive Cleanup

$
0
0

Quick C drive cleanup of exchange servers log location periodically helps exchange server to maintain a healthy C drive Free Space. I always never recommend to move transport databases to different drives to keep things neat and lesser the number of drives to manage. We don’t see transport database issues or rapid growth nowadays in the newer version of servers.


\\EXCH1.azure365pro.com\c$\Program Files\Microsoft\Exchange Server\V15\Logging\HttpProxy\Mapi
\\EXCH1.azure365pro.com\c$\inetpub\logs\LogFiles\W3SVC1
\\EXCH1.azure365pro.com\c$\inetpub\logs\LogFiles\W3SVC2
\\EXCH1.azure365pro.com\c$\Program Files\Microsoft\Exchange Server\V15\Logging\NotificationBroker\Client
\\EXCH1.azure365pro.com\c$\Program Files\Microsoft\Exchange Server\V15\Logging\MapiHttp\Mailbox
\\EXCH1.azure365pro.com\c$\Program Files\Microsoft\Exchange Server\V15\Logging\HttpProxy\Eas

The post Exchange Server C Drive Cleanup appeared first on azure365pro.com.


Office 365 Mailbox not showing in Hybrid Exchange server

$
0
0

Newly created Mailbox not showing in Hybrid Exchange Server Control Panel.Not all administrators certainly know that they should not provision office 365 mailbox directly from the office 365 console. They should have used the Hybrid server to provision new cloud mailboxes.

User Created Directly on Active Directory and created a mailbox on Office 365 without using the hybrid server. Creating an issue on some mailboxes not visible in hybrid server

Below Commands will enable you to get the mailbox under Get-RemoteMailbox in Hybrid Exchange server.

Run on Azure AD Connect Server or Hybrid Exchange server with Active Directory Tools installed.

Please replace  domain / domain.com on 3 rd and 4th line with your appropriate domain names. You can get these info from a working mailbox.

$uid = read-host "Please enter username"
$mailnick = read-host "Please enter same username"
$tempmail = $uid+"@domain.mail.onmicrosoft.com"
$primarymail = $mailnick+"@domain.com"
Set-ADUser $uid -Clear homemdb, homemta, msExchHomeServerName, msExchPoliciesExcluded
Set-ADUser $uid -Add @{msExchRemoteRecipientType="4"}
Set-ADUser $uid -Add @{mailNickname="$mailnick"}
Set-ADUser $uid -Add @{msExchProvisioningFlags="0"}

Set-ADUser $uid -Add @{msExchModerationFlags="6"}
Set-ADUser $uid -Add @{msExchAddressBookFlags="1"}
Set-ADUser $uid -Replace @{targetaddress="$tempmail"}
Set-ADUser $uid -Replace @{msExchRecipientDisplayType="-2147483642"}
Set-ADUser $uid -Replace @{msExchRecipientTypeDetails="2147483648"}
Set-RemoteMailbox $uid -PrimarySMTPAddress $primarymail

The post Office 365 Mailbox not showing in Hybrid Exchange server appeared first on azure365pro.com.

.\MailboxSizeReport.ps1 for Exchange and Office 365

$
0
0

Script Supports – Exchange 2007, 2010, 2013 , 2016 & Office 365

.\MailboxSizeReport.ps1 Created a Mailbox Size Report for Exchange 2010 and Exchange 2013.

It can Generate CSV, Display all and Display with Wild Card.

Download the Script

clip_image001

Download the Script

It can collect below information in CSV

  • Display Name
  • Alias
  • SamAccountname
  • RecipientType
  • Recipient OU
  • Primary SMTP address
  • Email Addresses
  • Database
  • ServerName
  • TotalItemSize
  • ItemCount
  • DeletedItemCount
  • TotalDeletedItemSize
  • ProhibitSendReceiveQuota-In-MB
  • UseDatabaseQuotaDefaults
  • LastLogonTime
  • ArchiveName
  • ArchiveStatus
  • ArchiveQuota
  • ArchiveTotalItemSize
  • ArchiveTotalItemCount

Note: If the LastLogonTime and stats empty. User hasn’t logged on yet.

Please feel free to add comments for additions or customizations.

For Office 365 Admins –

Connect to Office 365 Power shell – Before running the script

https://technet.microsoft.com/en-us/library/jj984289(v=exchg.160).aspx

</pre>
<#

.Requires -version 2 - Runs in Exchange Management Shell or Open Powershell and Connect to Office365

.SYNOPSIS
.\MailboxSizeReport.ps1 - It Can Display all the Mailbox Size with Item Count,Database,Server Details

Or It can Export to a CSV file

Or You can Enter WildCard to Display or Export

Example 1

[PS] C:\>.\MailboxSizeReport.ps1

Mailbox Size Report
----------------------------

1.Display in Exchange Management Shell

2.Export to CSV File

3.Enter the Mailbox Name with Wild Card (Export)

4.Enter the Mailbox Name with Wild Card (Display)

5.Export to CSV File (OFFICE 365)

6.Enter the Mailbox Name with Wild Card (Export) (OFFICE 365)

Choose The Task: 1

Display Name Primary SMTP address TotalItemSize ItemCount
------------ -------------------- ------------- ---------
Tes433 Tes433@azure365pro.com
Test Test@azure365pro.com 335.9 KB (343,933 bytes) 40
Test X500 TestX500@azure365pro.com 6.544 KB (6,701 bytes) 3
Test100 test100@azure365pro.com 40.74 KB (41,719 bytes) 7
Test22 Test22@azure365pro.com 60.04 KB (61,483 bytes) 7
Test3 Test3@azure365pro.com 364.7 KB (373,503 bytes) 31
Test33 Test332@azure365pro.com 93.34 KB (95,585 bytes) 6
Test33 Test33@FSD.com 5.335 KB (5,463 bytes) 3
Test3331 Test3331@azure365pro.com 24.14 KB (24,720 bytes) 2
Test46 Test46@azure365pro.com 254 KB (260,071 bytes) 21

Example 2

[PS] C:\>.\MailboxSizeReport.ps1

Mailbox Size Report
----------------------------

1.Display in Exchange Management Shell

2.Export to CSV File

3.Enter the Mailbox Name with Wild Card (Export)

4.Enter the Mailbox Name with Wild Card (Display)

5.Export to CSV File (OFFICE 365)

6.Enter the Mailbox Name with Wild Card (Export) (OFFICE 365)

Choose The Task: 2
Enter the Path of CSV file (Eg. C:\Report.csv): C:\MailboxReport.csv

.Author
Written By: Satheshwaran Manoharan

Change Log
V1.0, 10/08/2014 - Initial version

Change Log
V1.1, 05/12/2016 - ProgressBar,Seperate Office 365 Options, QuotaLimits,EmailAddresses

Change Log
V1.2, 20/06/2019 - ArchiveName,ArchiveStatus,ArchiveState,ArchiveQuota,-Encoding UTF8,Bugfix -DB Quota,Bug fix Single object listing-DividebyZero

#>

Write-host "

Mailbox Size Report
----------------------------

1.Display in Exchange Management Shell

2.Export to CSV File

3.Export to CSV File (Specific to Database)

4.Enter the Mailbox Name with Wild Card (Export)

5.Enter the Mailbox Name with Wild Card (Display)

6.Export to CSV File (OFFICE 365)

7.Enter the Mailbox Name with Wild Card (Export) (OFFICE 365)"-ForeGround "Cyan"

#----------------
# Script
#----------------

Write-Host " "

$number = Read-Host "Choose The Task"
$output = @()
switch ($number)
{

1 {

$AllMailbox = Get-mailbox -resultsize unlimited

Foreach($Mbx in $AllMailbox)

{

$Stats = Get-mailboxStatistics -Identity $Mbx.distinguishedname -WarningAction SilentlyContinue

$userObj = New-Object PSObject

$userObj | Add-Member NoteProperty -Name "Display Name" -Value $mbx.displayname
$userObj | Add-Member NoteProperty -Name "Primary SMTP address" -Value $mbx.PrimarySmtpAddress
$userObj | Add-Member NoteProperty -Name "TotalItemSize" -Value $Stats.TotalItemSize
$userObj | Add-Member NoteProperty -Name "ItemCount" -Value $Stats.ItemCount

Write-Output $Userobj

}

;Break}

2 {
$i = 0

$CSVfile = Read-Host "Enter the Path of CSV file (Eg. C:\Report.csv)"

$AllMailbox = Get-mailbox -resultsize unlimited

Foreach($Mbx in $AllMailbox)

{

$Stats = Get-mailboxStatistics -Identity $Mbx.distinguishedname -WarningAction SilentlyContinue

if (($Mbx.UseDatabaseQuotaDefaults -eq $true) -and (Get-MailboxDatabase $mbx.Database).ProhibitSendReceiveQuota.value -eq $null)
{
$ProhibitSendReceiveQuota = "Unlimited"
}
if (($Mbx.UseDatabaseQuotaDefaults -eq $true) -and (Get-MailboxDatabase $mbx.Database).ProhibitSendReceiveQuota.value -ne $null)
{
$ProhibitSendReceiveQuota = (Get-MailboxDatabase $mbx.Database).ProhibitSendReceiveQuota.Value.ToMB()
}
if (($Mbx.UseDatabaseQuotaDefaults -eq $false) -and ($mbx.ProhibitSendReceiveQuota.value -eq $null))
{
$ProhibitSendReceiveQuota = "Unlimited"
}
if (($Mbx.UseDatabaseQuotaDefaults -eq $false) -and ($mbx.ProhibitSendReceiveQuota.value -ne $null))
{
$ProhibitSendReceiveQuota = $Mbx.ProhibitSendReceiveQuota.Value.ToMB()
}
if ($Mbx.ArchiveName.count -eq "0")
{
$ArchiveTotalItemSize = $null
$ArchiveTotalItemCount = $null
}
if ($Mbx.ArchiveName -ge "1")
{
$MbxArchiveStats = Get-mailboxstatistics $Mbx.distinguishedname -Archive -WarningAction SilentlyContinue
$ArchiveTotalItemSize = $MbxArchiveStats.TotalItemSize
$ArchiveTotalItemCount = $MbxArchiveStats.BigFunnelMessageCount
}

$userObj = New-Object PSObject

$userObj | Add-Member NoteProperty -Name "Display Name" -Value $mbx.displayname
$userObj | Add-Member NoteProperty -Name "Alias" -Value $Mbx.Alias
$userObj | Add-Member NoteProperty -Name "SamAccountName" -Value $Mbx.SamAccountName
$userObj | Add-Member NoteProperty -Name "RecipientType" -Value $Mbx.RecipientTypeDetails
$userObj | Add-Member NoteProperty -Name "Recipient OU" -Value $Mbx.OrganizationalUnit
$userObj | Add-Member NoteProperty -Name "Primary SMTP address" -Value $Mbx.PrimarySmtpAddress
$userObj | Add-Member NoteProperty -Name "Email Addresses" -Value ($Mbx.EmailAddresses.smtpaddress -join ";")
$userObj | Add-Member NoteProperty -Name "Database" -Value $mbx.Database
$userObj | Add-Member NoteProperty -Name "ServerName" -Value $mbx.ServerName
if($Stats)
{
$userObj | Add-Member NoteProperty -Name "TotalItemSize" -Value $Stats.TotalItemSize.Value.ToMB()
$userObj | Add-Member NoteProperty -Name "ItemCount" -Value $Stats.ItemCount
$userObj | Add-Member NoteProperty -Name "DeletedItemCount" -Value $Stats.DeletedItemCount
$userObj | Add-Member NoteProperty -Name "TotalDeletedItemSize" -Value $Stats.TotalDeletedItemSize.Value.ToMB()
}
$userObj | Add-Member NoteProperty -Name "ProhibitSendReceiveQuota-In-MB" -Value $ProhibitSendReceiveQuota
$userObj | Add-Member NoteProperty -Name "UseDatabaseQuotaDefaults" -Value $Mbx.UseDatabaseQuotaDefaults
$userObj | Add-Member NoteProperty -Name "LastLogonTime" -Value $Stats.LastLogonTime
$userObj | Add-Member NoteProperty -Name "ArchiveName" -Value ($Mbx.ArchiveName -join ";")
$userObj | Add-Member NoteProperty -Name "ArchiveStatus" -Value $Mbx.ArchiveStatus
$userObj | Add-Member NoteProperty -Name "ArchiveState" -Value $Mbx.ArchiveState
$userObj | Add-Member NoteProperty -Name "ArchiveQuota" -Value $Mbx.ArchiveQuota
$userObj | Add-Member NoteProperty -Name "ArchiveTotalItemSize" -Value $ArchiveTotalItemSize
$userObj | Add-Member NoteProperty -Name "ArchiveTotalItemCount" -Value $ArchiveTotalItemCount

$output += $UserObj
# Update Counters and Write Progress
$i++
if ($AllMailbox.Count -ge 1)
{
Write-Progress -Activity "Scanning Mailboxes . . ." -Status "Scanned: $i of $($AllMailbox.Count)" -PercentComplete ($i/$AllMailbox.Count*100)
}
}

$output | Export-csv -Path $CSVfile -NoTypeInformation -Encoding UTF8

;Break}

3 {
$i = 0

$CSVfile = Read-Host "Enter the Path of CSV file (Eg. C:\Report.csv)"
$Database = Read-Host "Enter the DatabaseName (Eg. Database 01)"

$AllMailbox = Get-mailbox -resultsize unlimited -Database "$Database"

Foreach($Mbx in $AllMailbox)

{

$Stats = Get-mailboxStatistics -Identity $Mbx.distinguishedname -WarningAction SilentlyContinue

if (($Mbx.UseDatabaseQuotaDefaults -eq $true) -and (Get-MailboxDatabase $mbx.Database).ProhibitSendReceiveQuota.value -eq $null)
{
$ProhibitSendReceiveQuota = "Unlimited"
}
if (($Mbx.UseDatabaseQuotaDefaults -eq $true) -and (Get-MailboxDatabase $mbx.Database).ProhibitSendReceiveQuota.value -ne $null)
{
$ProhibitSendReceiveQuota = (Get-MailboxDatabase $mbx.Database).ProhibitSendReceiveQuota.Value.ToMB()
}
if (($Mbx.UseDatabaseQuotaDefaults -eq $false) -and ($mbx.ProhibitSendReceiveQuota.value -eq $null))
{
$ProhibitSendReceiveQuota = "Unlimited"
}
if (($Mbx.UseDatabaseQuotaDefaults -eq $false) -and ($mbx.ProhibitSendReceiveQuota.value -ne $null))
{
$ProhibitSendReceiveQuota = $Mbx.ProhibitSendReceiveQuota.Value.ToMB()
}
if ($Mbx.ArchiveName.count -eq "0")
{
$ArchiveTotalItemSize = $null
$ArchiveTotalItemCount = $null
}
if ($Mbx.ArchiveName -ge "1")
{
$MbxArchiveStats = Get-mailboxstatistics $Mbx.distinguishedname -Archive -WarningAction SilentlyContinue
$ArchiveTotalItemSize = $MbxArchiveStats.TotalItemSize
$ArchiveTotalItemCount = $MbxArchiveStats.BigFunnelMessageCount
}

$userObj = New-Object PSObject

$userObj | Add-Member NoteProperty -Name "Display Name" -Value $mbx.displayname
$userObj | Add-Member NoteProperty -Name "Alias" -Value $Mbx.Alias
$userObj | Add-Member NoteProperty -Name "SamAccountName" -Value $Mbx.SamAccountName
$userObj | Add-Member NoteProperty -Name "RecipientType" -Value $Mbx.RecipientTypeDetails
$userObj | Add-Member NoteProperty -Name "Recipient OU" -Value $Mbx.OrganizationalUnit
$userObj | Add-Member NoteProperty -Name "Primary SMTP address" -Value $Mbx.PrimarySmtpAddress
$userObj | Add-Member NoteProperty -Name "Email Addresses" -Value ($Mbx.EmailAddresses.smtpaddress -join ";")
$userObj | Add-Member NoteProperty -Name "Database" -Value $mbx.Database
$userObj | Add-Member NoteProperty -Name "ServerName" -Value $mbx.ServerName
if($Stats)
{
$userObj | Add-Member NoteProperty -Name "TotalItemSize" -Value $Stats.TotalItemSize.Value.ToMB()
$userObj | Add-Member NoteProperty -Name "ItemCount" -Value $Stats.ItemCount
$userObj | Add-Member NoteProperty -Name "DeletedItemCount" -Value $Stats.DeletedItemCount
$userObj | Add-Member NoteProperty -Name "TotalDeletedItemSize" -Value $Stats.TotalDeletedItemSize.Value.ToMB()
}
$userObj | Add-Member NoteProperty -Name "ProhibitSendReceiveQuota-In-MB" -Value $ProhibitSendReceiveQuota
$userObj | Add-Member NoteProperty -Name "UseDatabaseQuotaDefaults" -Value $Mbx.UseDatabaseQuotaDefaults
$userObj | Add-Member NoteProperty -Name "LastLogonTime" -Value $Stats.LastLogonTime
$userObj | Add-Member NoteProperty -Name "ArchiveName" -Value ($Mbx.ArchiveName -join ";")
$userObj | Add-Member NoteProperty -Name "ArchiveStatus" -Value $Mbx.ArchiveStatus
$userObj | Add-Member NoteProperty -Name "ArchiveState" -Value $Mbx.ArchiveState
$userObj | Add-Member NoteProperty -Name "ArchiveQuota" -Value $Mbx.ArchiveQuota
$userObj | Add-Member NoteProperty -Name "ArchiveTotalItemSize" -Value $ArchiveTotalItemSize
$userObj | Add-Member NoteProperty -Name "ArchiveTotalItemCount" -Value $ArchiveTotalItemCount

$output += $UserObj
# Update Counters and Write Progress
$i++
if ($AllMailbox.Count -ge 1)
{
Write-Progress -Activity "Scanning Mailboxes . . ." -Status "Scanned: $i of $($AllMailbox.Count)" -PercentComplete ($i/$AllMailbox.Count*100)
}
}

$output | Export-csv -Path $CSVfile -NoTypeInformation -Encoding UTF8

;Break}

4 {
$i = 0
$CSVfile = Read-Host "Enter the Path of CSV file (Eg. C:\DG.csv)"

$MailboxName = Read-Host "Enter the Mailbox name or Range (Eg. Mailboxname , Mi*,*Mik)"

$AllMailbox = Get-mailbox $MailboxName -resultsize unlimited

Foreach($Mbx in $AllMailbox)

{

$Stats = Get-mailboxStatistics -Identity $Mbx.distinguishedname -WarningAction SilentlyContinue

if (($Mbx.UseDatabaseQuotaDefaults -eq $true) -and (Get-MailboxDatabase $mbx.Database).ProhibitSendReceiveQuota.value -eq $null)
{
$ProhibitSendReceiveQuota = "Unlimited"
}
if (($Mbx.UseDatabaseQuotaDefaults -eq $true) -and (Get-MailboxDatabase $mbx.Database).ProhibitSendReceiveQuota.value -ne $null)
{
$ProhibitSendReceiveQuota = (Get-MailboxDatabase $mbx.Database).ProhibitSendReceiveQuota.Value.ToMB()
}
if (($Mbx.UseDatabaseQuotaDefaults -eq $false) -and ($mbx.ProhibitSendReceiveQuota.value -eq $null))
{
$ProhibitSendReceiveQuota = "Unlimited"
}
if (($Mbx.UseDatabaseQuotaDefaults -eq $false) -and ($mbx.ProhibitSendReceiveQuota.value -ne $null))
{
$ProhibitSendReceiveQuota = $Mbx.ProhibitSendReceiveQuota.Value.ToMB()
}
if ($Mbx.ArchiveName.count -eq "0")
{
$ArchiveTotalItemSize = $null
$ArchiveTotalItemCount = $null
}
if ($Mbx.ArchiveName -ge "1")
{
$MbxArchiveStats = Get-mailboxstatistics $Mbx.distinguishedname -Archive -WarningAction SilentlyContinue
$ArchiveTotalItemSize = $MbxArchiveStats.TotalItemSize
$ArchiveTotalItemCount = $MbxArchiveStats.BigFunnelMessageCount
}

$userObj = New-Object PSObject

$userObj | Add-Member NoteProperty -Name "Display Name" -Value $mbx.displayname
$userObj | Add-Member NoteProperty -Name "Alias" -Value $Mbx.Alias
$userObj | Add-Member NoteProperty -Name "SamAccountName" -Value $Mbx.SamAccountName
$userObj | Add-Member NoteProperty -Name "RecipientType" -Value $Mbx.RecipientTypeDetails
$userObj | Add-Member NoteProperty -Name "Recipient OU" -Value $Mbx.OrganizationalUnit
$userObj | Add-Member NoteProperty -Name "Primary SMTP address" -Value $Mbx.PrimarySmtpAddress
$userObj | Add-Member NoteProperty -Name "Email Addresses" -Value ($Mbx.EmailAddresses.smtpaddress -join ";")
$userObj | Add-Member NoteProperty -Name "Database" -Value $mbx.Database
$userObj | Add-Member NoteProperty -Name "ServerName" -Value $mbx.ServerName
if($Stats)
{
$userObj | Add-Member NoteProperty -Name "TotalItemSize" -Value $Stats.TotalItemSize.Value.ToMB()
$userObj | Add-Member NoteProperty -Name "ItemCount" -Value $Stats.ItemCount
$userObj | Add-Member NoteProperty -Name "DeletedItemCount" -Value $Stats.DeletedItemCount
$userObj | Add-Member NoteProperty -Name "TotalDeletedItemSize" -Value $Stats.TotalDeletedItemSize.Value.ToMB()
}
$userObj | Add-Member NoteProperty -Name "ProhibitSendReceiveQuota-In-MB" -Value $ProhibitSendReceiveQuota
$userObj | Add-Member NoteProperty -Name "UseDatabaseQuotaDefaults" -Value $Mbx.UseDatabaseQuotaDefaults
$userObj | Add-Member NoteProperty -Name "LastLogonTime" -Value $Stats.LastLogonTime
$userObj | Add-Member NoteProperty -Name "ArchiveName" -Value ($Mbx.ArchiveName -join ";")
$userObj | Add-Member NoteProperty -Name "ArchiveStatus" -Value $Mbx.ArchiveStatus
$userObj | Add-Member NoteProperty -Name "ArchiveState" -Value $Mbx.ArchiveState
$userObj | Add-Member NoteProperty -Name "ArchiveQuota" -Value $Mbx.ArchiveQuota
$userObj | Add-Member NoteProperty -Name "ArchiveTotalItemSize" -Value $ArchiveTotalItemSize
$userObj | Add-Member NoteProperty -Name "ArchiveTotalItemCount" -Value $ArchiveTotalItemCount

$output += $UserObj
# Update Counters and Write Progress
$i++
if ($AllMailbox.Count -ge 1)
{
Write-Progress -Activity "Scanning Mailboxes . . ." -Status "Scanned: $i of $($AllMailbox.Count)" -PercentComplete ($i/$AllMailbox.Count*100)
}
}

$output | Export-csv -Path $CSVfile -NoTypeInformation -Encoding UTF8

;Break}

5 {

$MailboxName = Read-Host "Enter the Mailbox name or Range (Eg. Mailboxname , Mi*,*Mik)"

$AllMailbox = Get-mailbox $MailboxName -resultsize unlimited

Foreach($Mbx in $AllMailbox)

{

$Stats = Get-mailboxStatistics -Identity $Mbx.distinguishedname -WarningAction SilentlyContinue

$userObj = New-Object PSObject

$userObj | Add-Member NoteProperty -Name "Display Name" -Value $mbx.displayname
$userObj | Add-Member NoteProperty -Name "Primary SMTP address" -Value $mbx.PrimarySmtpAddress
$userObj | Add-Member NoteProperty -Name "TotalItemSize" -Value $Stats.TotalItemSize
$userObj | Add-Member NoteProperty -Name "ItemCount" -Value $Stats.ItemCount

Write-Output $Userobj

}

;Break}

6 {
$i = 0
$CSVfile = Read-Host "Enter the Path of CSV file (Eg. C:\Report.csv)"

$AllMailbox = Get-mailbox -resultsize unlimited

Foreach($Mbx in $AllMailbox)

{

$Stats = Get-mailboxStatistics -Identity $Mbx.distinguishedname -WarningAction SilentlyContinue

if ($Mbx.ArchiveName.count -eq "0")
{
$ArchiveTotalItemSize = $null
$ArchiveTotalItemCount = $null
}
if ($Mbx.ArchiveName -ge "1")
{
$MbxArchiveStats = Get-mailboxstatistics $Mbx.distinguishedname -Archive -WarningAction SilentlyContinue
$ArchiveTotalItemSize = $MbxArchiveStats.TotalItemSize
$ArchiveTotalItemCount = $MbxArchiveStats.BigFunnelMessageCount
}

$userObj = New-Object PSObject

$userObj | Add-Member NoteProperty -Name "Display Name" -Value $mbx.displayname
$userObj | Add-Member NoteProperty -Name "Alias" -Value $Mbx.Alias
$userObj | Add-Member NoteProperty -Name "SamAccountName" -Value $Mbx.SamAccountName
$userObj | Add-Member NoteProperty -Name "RecipientType" -Value $Mbx.RecipientTypeDetails
$userObj | Add-Member NoteProperty -Name "Recipient OU" -Value $Mbx.OrganizationalUnit
$userObj | Add-Member NoteProperty -Name "Primary SMTP address" -Value $Mbx.PrimarySmtpAddress
$userObj | Add-Member NoteProperty -Name "Email Addresses" -Value ($Mbx.EmailAddresses -join ";")
$userObj | Add-Member NoteProperty -Name "Database" -Value $Stats.Database
$userObj | Add-Member NoteProperty -Name "ServerName" -Value $Stats.ServerName
$userObj | Add-Member NoteProperty -Name "TotalItemSize" -Value $Stats.TotalItemSize
$userObj | Add-Member NoteProperty -Name "ItemCount" -Value $Stats.ItemCount
$userObj | Add-Member NoteProperty -Name "DeletedItemCount" -Value $Stats.DeletedItemCount
$userObj | Add-Member NoteProperty -Name "TotalDeletedItemSize" -Value $Stats.TotalDeletedItemSize
$userObj | Add-Member NoteProperty -Name "ProhibitSendReceiveQuota-In-MB" -Value $Mbx.ProhibitSendReceiveQuota
$userObj | Add-Member NoteProperty -Name "UseDatabaseQuotaDefaults" -Value $Mbx.UseDatabaseQuotaDefaults
$userObj | Add-Member NoteProperty -Name "LastLogonTime" -Value $Stats.LastLogonTime
$userObj | Add-Member NoteProperty -Name "ArchiveName" -Value ($Mbx.ArchiveName -join ";")
$userObj | Add-Member NoteProperty -Name "ArchiveStatus" -Value $Mbx.ArchiveStatus
$userObj | Add-Member NoteProperty -Name "ArchiveState" -Value $Mbx.ArchiveState
$userObj | Add-Member NoteProperty -Name "ArchiveQuota" -Value $Mbx.ArchiveQuota
$userObj | Add-Member NoteProperty -Name "ArchiveTotalItemSize" -Value $ArchiveTotalItemSize
$userObj | Add-Member NoteProperty -Name "ArchiveTotalItemCount" -Value $ArchiveTotalItemCount

$output += $UserObj
# Update Counters and Write Progress
$i++
if ($AllMailbox.Count -ge 1)
{
Write-Progress -Activity "Scanning Mailboxes . . ." -Status "Scanned: $i of $($AllMailbox.Count)" -PercentComplete ($i/$AllMailbox.Count*100)
}
}

$output | Export-csv -Path $CSVfile -NoTypeInformation -Encoding UTF8

;Break}

7 {
$i = 0
$CSVfile = Read-Host "Enter the Path of CSV file (Eg. C:\DG.csv)"

$MailboxName = Read-Host "Enter the Mailbox name or Range (Eg. Mailboxname , Mi*,*Mik)"

$AllMailbox = Get-mailbox $MailboxName -resultsize unlimited

Foreach($Mbx in $AllMailbox)

{

$Stats = Get-mailboxStatistics -Identity $Mbx.distinguishedname -WarningAction SilentlyContinue

if ($Mbx.ArchiveName.count -eq "0")
{
$ArchiveTotalItemSize = $null
$ArchiveTotalItemCount = $null
}
if ($Mbx.ArchiveName -ge "1")
{
$MbxArchiveStats = Get-mailboxstatistics $Mbx.distinguishedname -Archive -WarningAction SilentlyContinue
$ArchiveTotalItemSize = $MbxArchiveStats.TotalItemSize
$ArchiveTotalItemCount = $MbxArchiveStats.BigFunnelMessageCount
}

$userObj = New-Object PSObject

$userObj | Add-Member NoteProperty -Name "Display Name" -Value $mbx.displayname
$userObj | Add-Member NoteProperty -Name "Alias" -Value $Mbx.Alias
$userObj | Add-Member NoteProperty -Name "SamAccountName" -Value $Mbx.SamAccountName
$userObj | Add-Member NoteProperty -Name "RecipientType" -Value $Mbx.RecipientTypeDetails
$userObj | Add-Member NoteProperty -Name "Recipient OU" -Value $Mbx.OrganizationalUnit
$userObj | Add-Member NoteProperty -Name "Primary SMTP address" -Value $Mbx.PrimarySmtpAddress
$userObj | Add-Member NoteProperty -Name "Email Addresses" -Value ($Mbx.EmailAddresses -join ";")
$userObj | Add-Member NoteProperty -Name "Database" -Value $Stats.Database
$userObj | Add-Member NoteProperty -Name "ServerName" -Value $Stats.ServerName
$userObj | Add-Member NoteProperty -Name "TotalItemSize" -Value $Stats.TotalItemSize
$userObj | Add-Member NoteProperty -Name "ItemCount" -Value $Stats.ItemCount
$userObj | Add-Member NoteProperty -Name "DeletedItemCount" -Value $Stats.DeletedItemCount
$userObj | Add-Member NoteProperty -Name "TotalDeletedItemSize" -Value $Stats.TotalDeletedItemSize
$userObj | Add-Member NoteProperty -Name "ProhibitSendReceiveQuota-In-MB" -Value $Mbx.ProhibitSendReceiveQuota
$userObj | Add-Member NoteProperty -Name "UseDatabaseQuotaDefaults" -Value $Mbx.UseDatabaseQuotaDefaults
$userObj | Add-Member NoteProperty -Name "LastLogonTime" -Value $Stats.LastLogonTime
$userObj | Add-Member NoteProperty -Name "ArchiveName" -Value ($Mbx.ArchiveName -join ";")
$userObj | Add-Member NoteProperty -Name "ArchiveStatus" -Value $Mbx.ArchiveStatus
$userObj | Add-Member NoteProperty -Name "ArchiveState" -Value $Mbx.ArchiveState
$userObj | Add-Member NoteProperty -Name "ArchiveQuota" -Value $Mbx.ArchiveQuota
$userObj | Add-Member NoteProperty -Name "ArchiveTotalItemSize" -Value $ArchiveTotalItemSize
$userObj | Add-Member NoteProperty -Name "ArchiveTotalItemCount" -Value $ArchiveTotalItemCount

$output += $UserObj
# Update Counters and Write Progress
$i++
if ($AllMailbox.Count -ge 1)
{
Write-Progress -Activity "Scanning Mailboxes . . ." -Status "Scanned: $i of $($AllMailbox.Count)" -PercentComplete ($i/$AllMailbox.Count*100) -ErrorAction SilentlyContinue
}
}

$output | Export-csv -Path $CSVfile -NoTypeInformation -Encoding UTF8

;Break}

Default {Write-Host "No matches found , Enter Options 1 or 2" -ForeGround "red"}

}
<pre>

The post .\MailboxSizeReport.ps1 for Exchange and Office 365 appeared first on azure365pro.com.

Database availability group must have quorum error

$
0
0

Decommissioning set of old Exchange 2013 servers had to export few mailboxes and
decommission them.But mailboxes are not mounting saying quorum not found. but for me the simplest way is to remove the Database Availability group completely and mount the databases and take the required data out via pst and decommission the same. So this might not be suitable for all scenarios.


Failed to mount database "MDB03". Error: An Active Manager operation failed. Error: An Active Manager operation
encountered an error. To perform this operation, the server must be a member of a database availability group, and the
database availability group must have quorum. Error: Unable to read from the cluster database. This may occur if the
server has recently been removed from the database availability group. [Server: MBEX01.azure365pro.com]
+ CategoryInfo : InvalidOperation: (MDB03:ADObjectId) [Mount-Database], InvalidOperationException
+ FullyQualifiedErrorId : [Server=MBEX02,RequestId=c41e871c-49e5-4a78-877f-51738b965ee1,TimeStamp=6/2/2020
6:11:51 AM] [FailureCategory=Cmdlet-InvalidOperationException] 7E29F70A,Microsoft.Exchange.Management.SystemConfig
urationTasks.MountDatabase
+ PSComputerName : mbex02.azure365pro.com

Removed all the Database Copies.

Using the configuration only switch and removed the mailbox servers from the DAG.
So that it will clear the DAG related entries from active directory.But this will not remove the dag member from real Cluster. Which we have to manually.

Remove-DatabaseAvailabilityGroupServer -ConfigurationOnly -MailboxServer SRV-HO-MBEX02 -Identity DAG2

As its a IP Less DAG,We cannot use the cluster manager to evice them. You got to use powershell.
To Evict the DAG Members.

Get-ClusterNode Node1 | Remove-ClusterNode -Force
Get-ClusterNode Node2 | Remove-ClusterNode -Force

Once the DAG Members are removed and it doesn’t have configuration on active directory. Now the databases will try to mount as a stand alone server.On reboot Databases mounted without DAG membership.

Now removed the DAG. using below commands. I have done the same steps when the cluster is completely messed up and none of the recovery options worked and we had to bring up the databases stand alone without DAG membership. Unless you understand the environment completely and don’t use this procedure without proper understanding of clusters and DAG attributes stored on Active Directory. It may cause real Damage to the environment.

The post Database availability group must have quorum error appeared first on azure365pro.com.

Replacing Send Connector Certificate

$
0
0

A special Rpc error occurs on server EXCH1: These certificates are tagged with following Send Connectors : Outbound to Office 365. Removing and replacing certificates from Send Connector would break the mail flow. If you still want to proceed then replace or remove these certificates from Send Connector and then try this command.

$cert = Get-ExchangeCertificate -Thumbprint XXXXXX 
$tlscertificatename = "<i>$($cert.Issuer)<s>$($cert.Subject)"
Set-SendConnector "Outbound to Office 365" -TlsCertificateName $tlscertificatename

The post Replacing Send Connector Certificate appeared first on azure365pro.com.

Simulate backup in a Exchange Server to Clear Logs

$
0
0

Simulating backup in a Exchange Server to Clear Logs happens sometimes when the backup stops working and the disk is about to get full. This is the only easy way to clear backups without backing up the exchange server using native disk shadow. Its a way to tell exchange server to mark these logs for deletion to gain space on the disk without enabling circular logging.


diskshadow

add volume d:

begin backup

create

end backup

The post Simulate backup in a Exchange Server to Clear Logs appeared first on azure365pro.com.

Export all distribution Group and all members in Exchange and Office 365

$
0
0

In some situations, we have to Export all the Distribution group/Unified Groups and all the members of it to a CSV file. There is no command let available to retrieve the distribution group and distribution group members in bulk. The pipeline won’t work in this case.

NEW

****2021 Export all Unified Groups as well***

**** Export all the Distribution group and Distribution Group managers as well***

***Export all the Dynamic Distribution group and Dynamic Distribution Group managers as well***

DisplayName
Alias
RecipientType
Recipient OU
Primary SMTP address
Distribution Group
Distribution Group Primary SMTP address
Distribution Group Managers
Distribution Group OU
Distribution Group Type
Distribution Group Recipient Type
Not Allowed from the Internet

I have written a script that will make Exchange Administrators’ life Easy to export distribution group and its members.

Requires Exchange Management Shell – For Option 9 and 10 you will need Exchange Online Shell

.\DistributionGroupMemberReport.ps1 – It Can Display all the Distribution Group and its members on a List

Or It can Export to a CSV file

Download the Script

Browse the Shell to the Appropriate Location

Run it as above

The output of the CSV file looks like Below

You can add some more entries if required

image

Download the Script

How to use this Script for Office 365 – 

Local desktop. PowerShell – Run as Administrator

image

Make Sure your Execution Policy is set to RemoteSigned or Unrestricted

Set-ExecutionPolicy RemoteSigned

my Case is unrestricted.

To Get Execution Policy Status

Get-ExecutionPolicy

image

Connect-ExchangeOnline

Now Run the Script – It should work.

 

The post Export all distribution Group and all members in Exchange and Office 365 appeared first on azure365pro.com.

How to restore Exchange Databases from a Storage failure

$
0
0

We should look for options when “Exchange Databases are not mounting”

  • Good backup Available.
  • No Backup – Exchange mailbox Databases are down.
  • Mounting a blank database – Keeping the messaging alive until you repair the exchange databases.
  • Soft recovery and Repairing the Exchange Databases
  • Recovery Databases

Have tried to include as many scenarios as possible.

Good backup Available

The best option is restoring from Backup software like Symantec / veeam / veritas / avamar which is the best option to have minimal downtime. but make sure you have to retain the live data whichever is on the existing drives – As you will lose data from the Backup taken time to the Storage Failure time.

if you have a good backup First Restore from the Backup get the production running. Then you can create a recovery database and repair the broken databases and merge them with your production.

you may have to take a copy or rename the database file before restoring using the backup software as they can overwrite the database files residing on the existing drives.

No Backup – Exchange mailbox Databases are down

Some Organizations start depending on DAG. Backup less solutions. Still, there are chances where your Database didn’t failover due to a network issue or various other reasons. Try forcing the failover. Check you can access the storage and bring that back. The stability of the databases has increased where the server or storage undergoes an intermittent failure new exchange versions cure themselves in few scenarios when it comes to database copies.

If you don’t have a backup, repairing the existing databases takes time approximately 5-10 Gb per hour. Totally depends on the IOPS/processor. if you don’t have a backup always take a copy of the broken databases. so that even if your repair is interrupted you don’t lose hope, you can copy it again for recovery purposes. Before that, There are various ways to get your databases healthy, 5-10 GB per hour is the worst-case scenario.

You got to check the health of the database, Where Exchange cannot connect back to a database again. if it’s not gracefully dismounted or disconnected from storage or server or anti-virus removes sometimes hold the log files mistakenly. let’s see how to check the health of the databases.

Open PowerShell

Locate to the .\eseutil.exe, Default location –

cd "C:\Program Files\Microsoft\Exchange Server\V15\Bin"

To check the status of the Exchange database :

locate to the bin folder to check the health of the exchange database

.\eseutil.exe /mh "D:\log files\Mailbox Database\Mailbox Database.edb"

there are two results, It may say clean or dirty, will go through both.

showing CLEAN SHUTDOWN – The database is healthy and it’s in a good shape. It couldn’t mount as it’s not able to understand the existing sequence of the log files.

Removing all the logs files from the logs files location and Mount the database. It should generate a new series of log files and mounting the database gracefully.

image

To get log file Location –

Get-mailboxdatabase | fl Name,*path

To force mount the databases –

Get-mailboxdatabase "Database Name" | Mount-database –Force

showing Dirty SHUTDOWN – The database is not in a good state (worst case), if the database sizes are massive, you cannot keep the environment down until the databases are repaired. here is the trick of mounting a blank database to keep the environment active going with a blank mailbox. and repair the broken databases and swap them again then merge them. if you don’t want to mount a blank database. skip it.

Mounting a blank database – Keeping the messaging alive until you repair the exchange databases.

  • Stop Microsoft Exchange Search Service
  • Stop Microsoft Exchange Search Host Controller Service

image

Now you can rename the database folder. Create an identical folder.

image

Mounting the store will force the creation of an empty database.

image

As soon as you mount a blank database in the messaging environment. Outlook will prompt for a restart. Once the outlook is restarted.

Users get an option of getting into a Temporary mailbox to send and receive emails or Use Old data to look at their cached PST if they are in Outlook cache mode.

image

if health check shows dirty –

.\eseutil.exe /mh "D:\log files\Mailbox Database\Mailbox Database.edb"

Let’s see how we can handle the broken database. you can see a row called “logs required”

Check the required logs are available or not. in my case, it’s 6079 – 6104

image

Check if you have the logs available

image

if you have the logs available – Make sure you got the .chk file in the same location. If you don’t have the required log files skip this step.

You can try running the soft recovery –  (/r)

Have the database and log files in the default location

If you cannot have in the default location use /D for database location, /s for checkpoint file location, /l for the log file location.

if you don’t mention it. it will take the default location

“/a” is for – even if some log files are missing it will try to get the database to a good shape (Data loss will be there)

E01 – Go to the log file location check how it starts E00 or E01 or E02

.\eseutil.exe /r e01 /l "D:\log files\Mailbox Database" /d "D:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database\Mailbox Database.edb" /a

Check the status after the soft Recovery – If its showing Clean Shutdown – You can mount the database, if it doesnt , you can always move the logs and try mounting it as the databases are in clean shutdown.

If its not in Clean shutdown . Even after soft recovery Process

Repairing the Exchange Database : (5 to 8 GB /hour) (Exchange 2010 and later versions are much faster)

.\eseutil.exe /p "D:\Databases\Mailbox Database\Mailbox Database.edb"

It will repair the database with 98% of success – Where data loss will be there in the corrupted portion of it. Mostly it’s minimal.

Once the repair process is completed. We can see the database to Clean shutdown.

I would recommend getting the mailboxes moved to a different database as soon as possible, to be on the safer side. also the Microsoft supportability point of view.

Recovery Databases  –

when it comes to recovery databases, you have to understand database swapping as well. if you repaired 500 Gb databases and your temporary database is 5 GB. there is no point in merging the 500 GB recovery database with a 5 GB temporary database. Also, the outlook will always want the old database back in place to overcome the initial prompt when you have a temporary database mounted. As you dismount the blank database and mount the repaired database as a primary and smaller database on the recovery. So that merging can be done quicker and simpler.

Creating a recovery database with existing database –

New-MailboxDatabase -Recovery -Name RDB -Server mail -EdbFilePath "C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Recover\Mailbox Database.edb" -LogFolderPath "C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Recover"

image

Merge them for one mailbox –

New-MaiboxRestoreRequest -SourceDatabase "RDB" -SourceStoreMailbox "vaishika sathesh" -TargetMailbox vaishika@azure365pro.com

If you have different users with the same display name – the below command should help you.

New-MailboxRestoreRequest -SourceDatabase "RDB" -SourceStoreMailbox 3965757c-f9f4-4c8d-a8c2-56a410257b52 -TargetMailbox vaishika@azure365pro.com -SkipMerging StorageProviderForSource

Merge them in bulk –


Foreach ($mailbox in Get-MailboxStatistics -Database RDB)

{

New-MailboxRestoreRequest -SourceDatabase RDB -SourceStoreMailbox $mailbox.DisplayName -TargetMailbox $mailbox.DisplayName

}

Known Errors :

he call to 'net.tcp://mail.azure365pro.com/Microsoft.Exchange.MailboxReplicationService mail.azure365pro.com(15.0.620.24 caps:3F)'
failed. Error details: must be logging in with GUIDs, not legDN
Parameter name: owner.
+ CategoryInfo : NotSpecified: (:) [New-MailboxRestoreRequest], CommunicationErrorTransientException
+ FullyQualifiedErrorId : 436EF2E5,Microsoft.Exchange.Management.RecipientTasks.NewMailboxRestoreRequest
+ PSComputerName : mail.azure365pro.com

Resolution –

Use


Foreach($mailbox in Get-MailboxStatistics -Database RDB)

{

New-MailboxRestoreRequest -SourceDatabase RDB -SourceStoreMailbox $mailbox.DisplayName -TargetMailbox $mailbox.DisplayName -SkipMerging StorageProviderForSource

}

Now Consider Database Repair Failed –

Mount a blank database.

Go to the cached outlook – Export to PST via Outlook.

Create a new Outlook Profile – Import PST

Other options – you can consider 3rd party solutions for EDB to PST conversion.
After repairing the databases if users have issues in accessing the folder you can run a repair on the mailbox

New-MailboxRepairRequest -Mailbox vaishika@azure365pro.com -CorruptionType ProvisionedFolder,SearchFolder,AggregateCounts,Folderview

Known issues –

Issue :

Unable to submit online integrity check request for database Mailbox Database. Failure:An unexpected error occurred

while trying to submit the request. Detailed error information follows

Microsoft.Mapi.MapiExceptionInvalidParameter: MapiExceptionInvalidParameter: Queue online isinteg request failed.

(hr=0x80070057, ec=-2147024809)

Resolution –

The database is in bad share after repair – Create a new database and move them

Issue :

Log Name:      Application
Source:        MSExchangeIS
Event ID:      2006
Level:         Error
Description:
Microsoft Exchange Information Store worker process (12584) has encountered an unexpected database error (Illegal duplicate key) for database ‘Mailbox Database’ with a call stack of
at Microsoft.Exchange.Server.Storage.PhysicalAccessJet.JetTableOperator.Insert(IList`1 columns, IList`1 values, Column identityColumnToFetch, Boolean unversioned, Boolean ignoreDuplicateKey, Object& identityValue)
at Microsoft.Exchange.Server.Storage.PhysicalAccessJet.JetInsertOperator.ExecuteScalar()
at Microsoft.Exchange.Server.Storage.PhysicalAccess.DataRow.Insert(IConnectionProvider connectionProvider)
at Microsoft.Exchange.Server.Storage.StoreCommonServices.ObjectPropertyBag.Flush(Context context)
at Microsoft.Exchange.Server.Storage.LogicalDataModel.Item.Flush(Context context)
at Microsoft.Exchange.Server.Storage.LogicalDataModel.Message.Flush(Context context)
at Microsoft.Exchange.Server.Storage.LogicalDataModel.Message.SaveChanges(Context context)
at Microsoft.Exchange.Server.Storage.LogicalDataModel.TopMessage.SaveChanges(Context context, SaveMessageChangesFlags flags)
at Microsoft.Exchange.Protocols.MAPI.MapiMessage.SaveChangesInternal(MapiContext context, MapiSaveMessageChangesFlags saveFlags, ExchangeId& newMid)

Log Name:      Application
Source:        MSExchangeIS
Event ID:      1046
Level:         Error

Description:
Unexpected error encountered in critical block. Location:(Microsoft.Exchange.Diagnostics.LID), scope: (MailboxShared), callstack: (   at Microsoft.Exchange.Server.Storage.StoreCommonServices.Context.OnCriticalBlockFailed(LID lid, CriticalBlockScope criticalBlockScope)
at Microsoft.Exchange.Server.Storage.StoreCommonServices.Context.CriticalBlockFrame.Dispose()
at Microsoft.Exchange.Server.Storage.LogicalDataModel.TopMessage.SaveChanges(Context context, SaveMessageChangesFlags flags)
at Microsoft.Exchange.Protocols.MAPI.MapiMessage.SaveChangesInternal(MapiContext context, MapiSaveMessageChangesFlags saveFlags, ExchangeId& newMid)
Log Name:      Application
Source:        MSExchangeIS
Event ID:      1002
Level:         Error

Description:
Unhandled exception (Microsoft.Exchange.Server.Storage.Common.DuplicateKeyException: JetTableOperator.Insert —> Microsoft.Isam.Esent.Interop.EsentKeyDuplicateException: Illegal duplicate key
at Microsoft.Isam.Esent.Interop.Server2003.Server2003Api.JetUpdate2(JET_SESID sesid, JET_TABLEID tableid, Byte[] bookmark, Int32 bookmarkSize, Int32& actualBookmarkSize, UpdateGrbit grbit)
at Microsoft.Exchange.Server.Storage.PhysicalAccessJet.JetTableOperator.Insert(IList`1 columns, IList`1 values, Column identityColumnToFetch, Boolean unversioned, Boolean ignoreDuplicateKey, Object& identityValue)

Resolution –

The database is in bad shape after repair – Create a new database and move them

Another Scenario –

[PS] C:\Program Files\Microsoft\Exchange Server\V14\Bin>eseutil.exe /r e05 /l “E:\Mailbox\Logs\VW” /d “G:\Mailbox\VW\VW.edb” /a

Extensible Storage Engine Utilities for Microsoft(R) Exchange Server
Version 14.02
Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating RECOVERY mode…
Logfile base name: e05
Log files: E:\Mailbox\Logs\VW
System files: <current directory>
Database Directory: G:\Mailbox\VW\VW.edb

Performing soft recovery…
Restore Status (% complete)

0 10 20 30 40 50 60 70 80 90 100
|—-|—-|—-|—-|—-|—-|—-|—-|—-|—-|
………………………………………….X

Operation terminated with error -1216 (JET_errAttachedDatabaseMismatch, An outstanding database attachment has been detected at the start or end of r

[PS] C:\Program Files\Microsoft\Exchange Server\V14\Bin>eseutil.exe /r e05 /l “E:\Mailbox\Logs\VW” /d “G:\Mailbox\VW\VW.edb” /a /i

Extensible Storage Engine Utilities for Microsoft(R) Exchange Server
Version 14.02
Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating RECOVERY mode…
Logfile base name: e05
Log files: E:\Mailbox\Logs\VW
System files: <current directory>
Database Directory: G:\Mailbox\VW\VW.edb

Performing soft recovery…
Restore Status (% complete)

0 10 20 30 40 50 60 70 80 90 100
|—-|—-|—-|—-|—-|—-|—-|—-|—-|—-|
……………………………………………

The operation completed successfully in 0.219 seconds.

Sometimes Even after showing Completed. Couldn’t see the database coming to a clean shutdown.

 

 

 

The post How to restore Exchange Databases from a Storage failure appeared first on azure365pro.com.


External Forwarding without Mail Contact

$
0
0

In some scenarios. if forwarding needs to be enabled for numerous mailboxes and you don’t want to create mail contacts for them in the microsoft exchange server.

Ideal scenario going to mailbox properties enable forwarding and choose a mail contact. let’s see how to create forwarding without a mail contact.

Forwarding without mail contacts can be enabled through remote domains. By default, AutoforwardEnabled to set to false.

Get-RemoteDomain default | fl Name,AutoForwardEnabled

Instead of enabling for all domains, it’s wise to enable for specific domains only. So that you have control over it. Still, it varies scenario by scenario.

New-RemoteDomain azure365pro.com -DomainName azure365pro.com

by default when you add a remote domain autoforwardenabled to set to true

Get-RemoteDomain azure365pro.com | fl Name,AutoForwardEnabled

Now you can set forwarding without adding a mail contact like below. These forwarding will not be visible in the exchange control panel (ECP) interface.

Set-Mailbox username -DeliverToMailboxAndForward $false -ForwardingSmtpAddress forwardingmailbox@azure365pro.com

Removing remote domain if it’s not required.

The post External Forwarding without Mail Contact appeared first on azure365pro.com.

Convert IMCEAX NDR to X500 Value with Reference Table

$
0
0

Issue Happens after PST import or Office 365 Group renaming primary smtp address in a hybrid environment

Delivery has failed to these recipients or groups:

“Deleted User/Re created user/Click on it to get the Custom Address
The email address you entered couldn’t be found. Please check the recipient’s email address and try to resend the message. If the problem continues, please contact your helpdesk.

Diagnostic information for administrators:

Generating server: HSEXC0022.AZURE365PRO.COM

IMCEAEX-

_o=HOSTING_ou=Exchange+20Administrative+20Group+20+28FYDIBOHF23SPDLT+29_cn=Recipients_cn=6cc028b24cc44923a56cf0a89d4857ca-pradeep+40careexc@HOSTING.LOCAL

Remote Server returned ‘550 5.1.1 RESOLVER.ADR.ExRecipNotFound; not found’


Original message headers:


Received: from HSEXC0022.AZURE365PRO.COM (10.129.150.20) by


HSEXC0022.AZURE365PRO.COM (10.129.150.21) with Microsoft SMTP Server (TLS) id


15.0.847.32; Sun, 12 Jul 2015 10:12:19 +0400


Received: from HSEXC0012.AZURE365PRO.COM ([fe80::425:f61f:d5c9:3fb7]) by


HSEXC0012.AZURE365PRO.COM ([fe80::425:f61f:d5c9:3fb7%15]) with mapi id


15.00.0847.030; Sun, 12 Jul 2015 10:12:20 +0400


Content-Type: application/ms-tnef; name=”winmail.dat”


Content-Transfer-Encoding: binary


Reference IMCEAX to X500 –


IMCEAEX-


_o=HOSTING_ou=Exchange+20Administrative+20Group+20+28FYDIBOHF23SPDLT+29_cn=Recipients_cn=d8d4ee95a3bc4778a40wbeb269c518dfb-Ramakrishna+20Redd@HOSTING.LOCAL

Converted Value –


X500:/o=HOSTING/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=d8d4ee95a3bc4778a40beb269c518dfb-Ramakrishna Redd

Reference X500 – VALUE
_ /
+20 Blank Space
+28 (
+29 )
@domain.com To be removed
+40 @
+2E .
+2C ,
+5F _
%3d =

Here is the scenario – I had to remove 200 Mail Contacts and get them created as Mailboxes in 1000 User Environment. As soon as i delete the contacts its going to throw me an IMCEAX error, To Overcome this situation i had to export all them in advance, Had the X500 addresses ready, and Added them to the mailboxes created.


via Powershell


To Export the CSV –


 
 Get-MailContact -ResultSize Unlimited -OrganizationalUnit "Azure365pro.com/Emps" | Select-Object Name,Alias,PrimarySmtpAddress,LegacyExchangeDN | Export-Csv C:\legacyDN.csv 
 

Format the CSV into below format using Excel-


Name,Alias,PrimarySmtpAddress,LegacyExchangeDN
Melissa Melora ,Melissa,melissa@Azure365pro.com,X500:/o=HOSTING/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=5a186ad20a2b4aaeb44258a723a95054-Melissa Melora


Import it


Import-csv c:\Scripts\legacyDN.csv | foreach { set-mailbox -identity $_.PrimarySmtpAddress -EmailAddresses @{Add= $_.legacyexchangeDN}} 

Name,Alias,PrimarySmtpAddress,LegacyExchangeDN
Melissa Melora ,Melissa,melissa@Azure365pro.com,X500:/o=HOSTING/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=5a186ad20a2b4aaeb44258a723a95054-Melissa Melora



To Add it via ADUC – Using Attribute Editor


Open Active Directory Users and Computers – View – Advanced Features


image

Add the X500 Address address which is converted.


image

Click Ok, Apply , OK,


Powershell Sample to Convert


$x = "enter IMCEAEX full value"

$x = $x -replace "IMCEAEX-_", "X500:/" -replace "\+20", " " -replace "\+28", "(" -replace "\+29", ")" -replace "_", "/" -replace "\+2E","." -replace '@.*'

 

$x

 

If you have this with an office 365 group – (In my case users on-prem with group writeback having this issue. So added below waited for group writeback to give out this value)

Set-UnifiedGroup -Identity "test@azure365pro.com" -EmailAddresses @{add="X500:/o=NT5/ou=00000000000000000000000000000000/cn=CCE74E2284B1CF4CADDDDDD14FFDF9"}

The post Convert IMCEAX NDR to X500 Value with Reference Table appeared first on azure365pro.com.

Viewing all 170 articles
Browse latest View live