Office 365: Refresh Hybrid configuration procedure

There can be situation where you need completely remove an re-create your Hybrid configuration which can seem challenging from required actions point of view. Procedure below describe steps needed to be done in order if you want remove and create Hybrid Configuration for example if you receiving following error when running Hybrid Configuration Wizard:

Execution of the Set-FederatedOrganizationIdentifier cmdlet has thrown an exception. This may indicate invalid parameters in your hybrid configuration settings.
 Federation trust "yourfederateddomain/Configuration/Deleted Objects/Microsoft Federation Gateway DEL:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" wasn't found. Make sure you have typed it correctly.
 at Microsoft.Exchange.Management.Hybrid.RemotePowershellSession.RunCommand(String cmdlet, SessionParameters parameters, Boolean ignoreNotFoundErrors)

That particular procedure is written for Exchange 2013/Office 365 Wave 15 configuration, but it works pretty well for Exchange 2010/Wave 15 Hybrid.

Clean-up

  1. Execute following command on you on-premise Exchange 2013 server (that command is not available on Exchange 2010, if your Hybrid server is Exchange 2010, just skip that step):
    Remove-HybridConfiguration
  2. Remove existing organization relationships from both on-premise and O365 (you can use that command, if you have just single relationship on each side):
    Get-OrganizationRelationship | Remove-OrganizationRelationship
  3. Continue reading

Office 365 PowerShell connection script

If you working with Office 365 PowerShell on daily basis, you may find that it is taking too much time to connect your Office 365 console, especially if you working with multiple tenants. You have to note usernames, passwords for all of the tenants and copy/paste them every time you want to make connection. Below you will find description, how to make it “single command” task.

Because that script will give access to your tenant without typing any username/password, I would suggest that you should not implement that on any public machine. Make sure that you are only person who can execute connection script.

OK, let’s start.

First of all we need to create addition file where encrypted tenant’s password will be stored. As an example create directory “O365Connections” on your C: drive and then create folder “keys” in it.

Start PowerShell prompt and type following command:

Read-Host -Prompt "Enter your tenant password" -AsSecureString | ConvertFrom-SecureString | Out-File "C:\O365Connections\keys\tenant1.key"

Continue reading

Re-connection of Exchange 2007 Mailbox

Sometimes during migration of Mailboxes – especially in cross-forest migrations, some of mailboxes may become corrupted. Mailboxes can fail test Test-MapiConnectiviy, user maybe unable to login into mailbox using OWA or messages just not coming in and not going out.

General solution here is disconnect and then connect mailbox again. You only should keep in mind that when you disconnecting Mailbox all Email addresses will be deleted so there is need to note all of them before disconnection.

Following script will do the work:
Continue reading

MS Exchange 2007 Mailbox Statistics

Lets say you need to get information about all mailbox users in your Microsoft Exchange 2007 organisation. Quotas, mailbox size, item count, time when users logged in last time…

It is easy!

Don’t forget to use following in multi-domain environment : $AdminSessionADSettings.ViewEntireForest=$True

Query for Exchange Management Shell:

Get-Mailbox -ResultSize 'Unlimited' -IgnoreDefaultScope | Select DisplayName, Identity, Database, @{label="IssueWarning(MB)";e={(Get-Mailbox $_).IssueWarningQuota.Value.ToMb()}},@{label="ProhibitSend(MB)";e={(Get-Mailbox $_).ProhibitSendQuota.Value.ToMb()}},@{label="ProhibitSendReceive(MB)";e={(Get-Mailbox $_).ProhibitSendReceiveQuota.Value.ToMb()}},@{label="Uses Database Quota Defaults";e={(Get-Mailbox $_).UseDatabaseQuotaDefaults}}, @{label="TotalSize (MB)";e={(get-mailboxstatistics $_).TotalItemSize.Value.toMB()}}, @{label="Item Count";e={(get-mailboxstatistics $_).ItemCount}}, @{label="Last Logon";e={(get-mailboxstatistics $_).LastLogonTime}}| Export-CSV -Path ".\ExchangeStats.csv"