Quantcast
Channel: Mailbox – azure365pro.com

Copy Sent Items to Shared Mailboxes and delegates

$
0
0

From Exchange 2013 Cu9 or later versions of Exchange 2013 and Exchange Online (Office 365). When user sends emails using send as over a shared mailbox we have an option of saving sent items on the shared mailboxes. So that all sent items can be stored in a centralized location. make sure all the exchange 2013 servers in the environment running cu9 or later.

Lets see how to do that.

  • you cannot login to a shared mailbox directly.
  • Sent items are not stored when you do SendAs by default.
  • Mostly shared mailboxes are department mailboxes like HR, contact us, info mailboxes.

Creating a Shared Mailbox –

image

New-Mailbox commonmailbox -Database "*514" -Shared

image

Providing User2 Full access to the Common Mailbox (for the user to access all the content in that mailbox) –

image

Add-MailboxPermission Commonmailbox -User user2 -AccessRights FullAccess -InheritanceType All

image

To Remove the Mailbox Permission –

Remove-MailboxPermission -Identity ayla -User "Jim Hance" -AccessRights FullAccess –Inheritance

Providing User2 Send As to the Common Mailbox –

On-premises –

Add-ADPermission -Identity commonmailbox -User user3 -ExtendedRights "Send As"

Exchange Online –

Add-RecipientPermission -Identity "commonmailbox" -Trustee "user3" -AccessRights SendAs

image

By Default “From” is not enabled in Outlook Web App .  To Enable that – login to owa go for options. Check the options always show “from”

 

image

As default am sending as commonmailbox to my CEO.

image

Common mailbox – send as emails are not storing in sent items by default.

image

Lets see how to enable that –

set-mailbox commonmailbox -MessageCopyForSentAsEnabled $True

image

Good to know – For SendOnBehalf

set-mailbox commonmailbox -MessageCopyForSendOnBehalfEnabled

Now you can see the Sent items saved in the Common mailbox

image

 

 

 

The post Copy Sent Items to Shared Mailboxes and delegates appeared first on CareExchange.in.


Configuring Sent Items Behavior in Exchange 2016

$
0
0
  • Saving Sent Items can be on Shared Mailboxes Only (Converting Mailbox to Shared to Set-Mailbox MailboxName –Type Shared)
Get-Mailbox test2016-4 | Set-Mailbox -MessageCopyForSendOnBehalfEnabled:$true -MessageCopyForSentAsEnabled:$true

image

User1 do SendAs on Test2016-4 Mailbox

Now in Test2016-4  Sent Items you can see Items being saved. Which is not by default.

Enabling From in Outlook Web Access After Applying SendAs Permission in Shared mailbox delegation properties.

image

From –

image

Send As is Saved to SharedMailbox

image

The post Configuring Sent Items Behavior in Exchange 2016 appeared first on CareExchange.in.

Mail flow Stopped to External – SMTP Relay to Active Directory Site

$
0
0

image

Mail flow Stopped to External in Queue – SMTP Relay to Active Directory Site

Intermittent Emails are not sent to External World.

Queue Error  –  “451 4.4.0 primary target IP address responded with “451 5.7.3 Cannot achieve Exchange Server authentication.”

Solution  –

Two Mailbox Servers in the Environment .

One of the Exchange Server IP was added to Relay Connectors of the other Exchange Server.
Eventually Breaking the Exchange Authentication . Causing Any email submitted to 2 mailbox server cannot transmit/pass it to the other Exchange server in the environment as its trying to communicate using the relay connector.

Removing the Exchange Server IP from the relay connector of the other exchange server . Restarting the Exchange Transport Service from the non-working Exchange server.

Bringing back the exchange server authentication to work. Mail flow came back to normal

The post Mail flow Stopped to External – SMTP Relay to Active Directory Site appeared first on CareExchange.in.

Resource Pressure in Exchange Server

$
0
0

Let me explain about the current situation .

–  Exchange Transport Service Keeps Crashing

“Windows Could not Start the Microsoft Exchange Transport Service on Local Computer. Error 1053 – The Service did not respond to the start or Control request in a timely Fashion.”

image_thumb1

– Queue Database Will rapidly increase and Transport service will stop.

Queue Database Default Location –

"C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue"

And We can see the resource pressure / Back pressure event in Exchange Server  –

I strongly feel if we can understand the event properly and spend some time on it . We can reach a solution . or any Transport Service Event if you don’t receive this one.

Log Name:      Application
Source:        MSExchangeTransport
Event ID:      15004
Task Category: ResourceManager
Level:         Warning
Computer:      EX01.careexchange.in
Description:
The resource pressure increased from Medium to High.

The following resources are under pressure:
Version buckets = 366 [High] [Normal=80 Medium=120 High=200]

The following components are disabled due to back pressure:
Inbound mail submission from Hub Transport servers
Inbound mail submission from the Internet
Mail submission from Pickup directory
Mail submission from Replay directory
Mail submission from Mailbox server
Mail delivery to remote domains
Content aggregation
Mail resubmission from the Message Resubmission component.
Mail resubmission from the Shadow Redundancy Component

The following resources are in normal state:
Queue database and disk space (“C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue\mail.que”) = 77% [Normal] [Normal=95% Medium=97% High=99%] Queue database logging disk space (“C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue\”) = 77% [Normal] [Normal=95% Medium=97% High=99%] Private bytes = 5% [Normal] [Normal=71% Medium=73% High=75%] Physical memory load = 64% [limit is 94% to start dehydrating messages.] Submission Queue = 0 [Normal] [Normal=2000 Medium=4000 High=10000] Temporary Storage disk space (“C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp”) = 77% [Normal] [Normal=95% Medium=97% High=99%]

 

Aspects of the Event in my case – Things are Normal – Its not the disk or disk space issue .

if things are not normal below – Free some space or – Change the location of the queue database

Queue database and disk space = 77% [Normal]

Queue database logging disk space  = 77% [Normal]

Private bytes = 5% [Normal]

Physical memory load = 64% [Normal]

Submission Queue = 0 [Normal] [Normal]

Temporary Storage disk space = 77% [Normal]

Version buckets = 366 [High]

Restarted the server. Still no change.

Stopped the Transport Services – Cleared the Queue Folder data to a different location and started the service. (Risk of Losing Emails if Queue is not 0 or Not Processed Mails)

Now we have tried recreating the transport Database. still Same issue seems to be re-appearing. (Queue Database will rapidly increase and transport service will stop)

Now we need to check what’s been getting submitted to the transport database making it grow large.

Lets see Message Tracking Logs –

get-messagetrackinglog -resultsize unlimited -start "01/12/2017 00:00:00" | select sender, subject, recipients,totalbytes | where {$_.totalbytes -gt "1048576"}

Oh Shit. Some Crazy Guy Sent a 2 GB file as attachment. Oh wait . Why Exchange Allowed it ?

image_thumb3

Get-TransportConfig | fl

MaxSendSize – unlimited

MaxReceiveSize – unlimited

Set-TransportConfig –Maxsendsize 30MB –MaxReceiveSize 30MB

Restarted Transport Service.

image_thumb5

Now Seeing the user Mailbox – Respective Message is not in the Outbox. Respective Message is in the Sent Item

Disabled the Mailbox Temporarily – Before Disabling always –  Make sure Deleted Mailboxes retention is not Set to 0” in Mailbox Database properties.

Cleared Transport Database and temp folder and things are now normal .

Now Waited for few hours. Re-Enabled the mailbox

Things were normal . Removed the 2 GB email anyways from the mailbox – Don’t ask me why I removed. but I removed it.

At last it was some movie clips . Sent by User.  Be curious about the Max Send Size . It can really Screw up things big time. Can’t blame the end user.

The post Resource Pressure in Exchange Server appeared first on CareExchange.in.

Outlook Web App X-OWA-Error ExAssertException

$
0
0

Once installing Exchange 2016 Cu8 on Windows Server 2012 R2 gave error on OWA.

ECP will work if administrator doesn’t have a mailbox. else even ecp will throw the same error.

image

An unexpected error occurred and your request couldn’t be handled.
X-ClientId: F554643C29C44C22B59A1DF6E706EB91
request-id bd391bdf-5057-4d0e-8a4d-c5a4f42f22d2
X-OWA-Error Microsoft.Exchange.Diagnostics.ExAssertException
X-OWA-Version 15.1.1415.2
X-FEServer EXCH2016
X-BEServer EXCH2016

Search for Event 2004 to make sure you are having issues with the auth certificate-

Log Name:      Application
Source:        MSExchange OAuth
Event ID:      2004
Task Category: Configuration
Level:         Warning
Computer:      EXCH2016.careexchange.in
Description:
Unable to find the certificate with thumbprint A9BBA1727F285CD86EB5785DF47C0A19DA997280 in the current computer or the certificate is missing private key. The certificate is needed to sign the outgoing token.

Solution –

  • Creating a new Exch Auth Certificate.  Resolved the issue.

Ran below , Saw Auth certificate missing.

Get-ExchangeCertificate (Get-AuthConfig).CurrentCertificateThumbprint


Created a new certificate . Change to your default domain on the end of the command.

New-ExchangeCertificate -KeySize 2048 -PrivateKeyExportable $true -SubjectName "cn=Microsoft Exchange Server Auth Certificate" -FriendlyName "Microsoft Exchange Server Auth Certificate" -DomainName "careexchange.in"

Say no to Replace SMTP Certificate.

image

Run

Set-AuthConfig –PublishCertificate
Set-AuthConfig –ClearPreviousCertificate

Then run

Get-ExchangeCertificate (Get-AuthConfig).CurrentCertificateThumbprint

verified auth certificate created successfully.  Do iis reset.  wait for few hours if its a large environment. it should resolve the same.

image

Run below if still issue persists.

  • Locate bin folder and run updatecas.ps1 and updateConfigfile.ps1 resolved for few others.

image

Other things i have tried –

  • Took Backup – Tried Removing msExchCanaryData0/1/2. No luck

image

  • Uninstall and re install the server. No Luck

The post Outlook Web App X-OWA-Error ExAssertException appeared first on azure365pro.com.

Creating a simple booking system using Resource mailbox in Exchange 2013

$
0
0

Simple booking system Requirement –

  • Visit to a location.
  • Meeting should be auto accepted.
  • Should not be Double booked.
  • Should inform the user that the response is from a automated booking system.
  • One Delegate should be able to Add/Move/Cancel the meeting

Lets see how to create it –  Login to EAC and Create a Room Mailbox

image

AutoAccept is set below –

image

  • Should not be Double booked.

Uncheck – Allow Repeating Meetings

  • Should inform the user that the response is from a automated booking system.

Add a note — Response is provided by our automated booking system.

 

image

One Delegate should be able to Add/Move/Cancel the meeting

Add full access – to the delegate as below.

Now delegate can add the calendar of this mailbox to his outlook and manage it .

image

Any Meeting request sent to the resource mailbox

image

The post Creating a simple booking system using Resource mailbox in Exchange 2013 appeared first on azure365pro.com.

Exchange 2007 to Exchange 2013 Mailbox Migration is very Slow

$
0
0

Lets see what we need to check.

  • Check whether CPU/RAM is overloaded on Exchange 2007 or Exchange 2013.If its overloaded add some CPU/RAM or check any unwanted process is taking up the CPU ,try to overcome the load.
  • Check Any backups running – Stop them
  • Check Any backup service taking too much load on the server.
  • Any File level anti virus running on the server (disable them)

image 

Now verified Both the source and target is not overloaded. what’s next ?

Check the event viewer on both the Source and target machines. Verify Mailbox Replication Service doesn’t throw any error.If there is any error try to fix it.

Now check what’s really happening in the mailbox move.

Open Exchange Management Shell –

Get-MoveRequest | Get-MoveRequestStatistics -IncludeReport | fl Id*,Report

To export all the Move mailbox report details to CSV –

Get-MoveRequest | Get-MoveRequestStatistics -IncludeReport | fl >C:\Movelogs.txt

You can find some logs like this –

8/7/2015 7:34:06 AM [CAREEXCHANGE] Relinquishing job because of large delays due to unfavourable server health or budget limitations.

Try disabling on the NICs on both the ends –

netsh int tcp set global chimney=disabled
netsh int tcp set global rss=disabled
netsh int tcp set global autotuninglevel=disabled

If this doesn’t help.

Check whether NIC on both the machines are using updated drivers ,Else Check on the the Vendor site for any new drivers.

You can go to device manager to view these details. Always restart the server after updating the NIC drivers.

image

Try downloading the latest driver if available and update it.

Still no luck and you didn’t  see any great improvement.

Browse for the below file on Exchange 2013 –

C:\Program Files\Microsoft\Exchange Server\V15\Bin\MsExchangeMailboxReplication.exe.config

Try Changing – ExportBufferSizeKB = 10240 from 512

Restart Microsoft Exchange Mailbox Replication Service.

See what happens.

image

I can guarantee this should resolve 95 % of slow mailbox migration issues.

The post Exchange 2007 to Exchange 2013 Mailbox Migration is very Slow 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 much scenarios as possible.

Good backup Available

Best option is restoring from Backup software’s like Symantec 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 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 databases 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 have increased where the server or storage undergoes a intermittent failure new exchange version 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 its not gracefully dismounted or disconnected from storage or server or anti virus removes sometimes hold the log files mistakenly. lets 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 –  Database is healthy and its in a good shape. It couldn’t mount as its 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 –  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 it 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 a 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 Temporary mailbox to send and receive emails or Use Old data to look 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"

Lets 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 its 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 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 its minimal.

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

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

Recovery Databases  –

when its comes to recovery databases,you have to understand about database swapping as well.if you repaired a 500 Gb databases and your temporary database is 5 gb. there is no point in merging 500 gb recovery database with 5 gb temporary database. Also the outlook will always wants 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 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@careexchanged.in

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

New-MailboxRestoreRequest -SourceDatabase "RDB" -SourceStoreMailbox 3965757c-f9f4-4c8d-a8c2-56a410257b52 -TargetMailbox vaishika@careexchanged.in -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.careexchange.in/Microsoft.Exchange.MailboxReplicationService mail.careexchange.in(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.careexchange.in

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 folder you can run a repair on the mailbox

New-MailboxRepairRequest -Mailbox vaishika@careexchanged.in -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 –

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 –

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

Another Case _ 12/Feb/2019

[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
|—-|—-|—-|—-|—-|—-|—-|—-|—-|—-|
……………………………………………

Operation completed successfully in 0.219 seconds.

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

The post How to restore Exchange Databases from a Storage failure 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.

Convert IMCEAX NDR to X500 Value with Reference Table

$
0
0

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 = Read-host -prompt 'enter IMCEAEX full value'
$x = $x -replace "IMCEAEX-_", "X500:/" -replace "\+20", " " -replace "\+28", "(" -replace "\+29", ")" -replace "_", "/" -replace "\+2E","." -replace '@.*', ";cls;Write-output $x

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





Latest Images