Showing posts with label Exchange. Show all posts
Showing posts with label Exchange. Show all posts

Monday, March 6, 2017

Exchange DAG Failover Report - CollectOverMetrics.ps1

Below is my quick command that requires no customization to run on any installation:

  • Get-DatabaseAvailabilityGroup |%{ .\CollectOverMetrics.ps1 -DatabaseAvailabilityGroup "$($_.name)" -StartTime ((get-date).AddDays(-365)) -EndTime ((get-date)) -MergeCSVFiles}

Note that this script is located in the "Scripts" directory of your Exchange v15 installation. 

Thursday, December 24, 2015

Migrating Public Folders Exchang 2007 to 2013

There are lots of great blogs out there on how to do the overall migration of Public folders from previous versions of Exchange to 2013, but few of them detailed how to deal with a few choice issues that I encountered in a recent migration that I performed.


For a good, detailed, checklist of how to do the migration, see any of the following:






My migration was for 50,000 folders, and about 130GB of data.


The issues that I ran into were (but not limited to):

  •     Needing a System Attendant mailbox on each server hosting Public Folders
  •     Spaces at the end of the names of folders
  •     Invalid characters in the Alias attribute, and
  •     Invalid SMTP email addresses in Mail-Enabled Public Folders

Each of these had to be fixed before I could start the migration.


System Attendant Mailbox required

This is actually fairly well documented, but I had missed it and the symptoms in no way pointed me to the root cause of the problem.

Basically, each server that hosts a Public Folder requires this System Attendant mailbox.  In my case I had no Mailbox Databases on the PF servers.

The symptom is that in the detailed log of the PublicFolderMigrationRequest indicated "

Transient Error: MapiExceptionUnknownUser: Unable to make connection to the server. (hr=0x80004005, ec=1003)


This was resolved by creating a mailbox database on each server, and then also restarting the "Microsoft Exchange System Attendant" service.  That created the system attendant ID automatically.


Spaces at the end of a folder name


The first problem was identified when I ran the command


Get-PublicFolder -Recurse | Export-CSV C:\PFs\2010_PFStructure.csv -NoTypeInformation

  This was easy to fix following this article:


The issue with this simple script is that the script in this article runs against all folders.


Get-PublicFolder -Identity "\" -Recurse -ResultSize Unlimited | Foreach { Set-PublicFolder -Identity $_.Identity -Name $_.Name.Trim() }


To improve this, I modified the command to skip folders that did not need to be updated.  Speeds up the command significantly. I also added a log file entry for each folder being processed.

$Logfile = "Fix-Trimmed-Names-001.log"
Get-PublicFolder -Identity "\" -recurse -ResultSize Unlimited | %{
  write-host "Scanning $($_.identity)";
  add-content $logfile -value "Scanning $($_.identity)";
  if ($_.name -ne $_.name.trim() ) {
    write-host "fixing [$($_.name)]" -foregroundcolor yellow;
    add-content $logfile -value "fixing [$($_.name)]"
    Set-PublicFolder -Identity $_.Identity -name $_.name.trim()
  }
}


 Invalid characters in the Alias attribute

 The Alias property of a Public Folder cannot contain Spaces, Periods, Commas, @, and even an Apostrophe.   The following script removed these characters.  (Note that the script is a little rough, but you can figure it out).


[PS] >type .\Fix-Alias-001.ps1
$Names = get-mailpublicfolder -resultsize unlimited |?{$_.Alias -like "* *"}
#$Names = get-mailpublicfolder -resultsize unlimited |?{$_.Alias -like "*.*"}

foreach ($name in $Names) {
  $newAlias = $name.alias
  $newAlias = $newAlias.replace(" ","_")
  $newAlias = $newAlias.replace("@","&")
  $newAlias = $newAlias.replace("(","{")
  $newAlias = $newAlias.replace(")","}")
  $newAlias = $newAlias.replace(",","~")
  $newAlias = $newAlias.replace(".","~")
  $newAlias = $newAlias.replace("'","~")
  set-mailpublicfolder -identity $name.identity -alias "$newalias"
}


Invalid SMTP email addresses in Mail-Enabled Public Folders

 This seems to have occurred for reasons similar to the Alias issue.  I was told that the users did not intentionally create Public Folders as Email-Enabled, therefore, rather than dig into fixing each of the mailboxes to change teh SMTP name, we elected to simply run a "Disable-MailPublicFolder" against each of the mail-enabled public folders.   End of issue.

Thursday, January 22, 2015

How to recreate missing Arbitration User Accounts

Recreate and enable missing arbitration user accounts and mailboxes in Exchange Serve

These are a couple of article explaining the process of recreating and enable missing arbitration users and mailboxes.
It addresses the issue of lost or deleted system mailboxes and how to get them back.

Thursday, November 20, 2014

Exchange: Beware of Disk with 4-kilobyte Sector Size

Beware of Disk with 4-Kilobyte Sector Size!

Microsoft reference:
Support requires that all copies of a database reside on the same physical disk type. For example, it is not a supported configuration to host one copy of a given database on a 512-byte sector disk and another copy of that same database on a 512e disk. Also be aware that 4-kilobyte (KB) sector disks are not supported for any version of Microsoft Exchange and 512e disks are not supported for any version of Exchange prior to Exchange Server 2010 SP1.

Hyper-V gothcha:
http://jeffreypersson.wordpress.com/2014/04/17/microsoft-exchange-server-2010-dag-on-vhdx/

"Continuous replication - block mode has been terminated. Error: the log file sector size does not match the current volume's sector size (-546)"

Turns out that the issue is that the VHDX files are the default settings of 4096 PhysicalSectorSize.

But it is not supported on Exchange DAG database volumes! 4KB sector disks are not supported on Exchange Server as a whole!

This also counts for Exchange 2013!

IBM SAN gotcha:

http://windowsitpro.com/blog/how-flawed-firmware-can-really-give-your-dag-some-replication-headaches







Thursday, May 1, 2014

SMTP MX record SPF Wizard

Use the following site to audit and assist in the creation of a valid SPF record for your email domain:

http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/



Sunday, March 30, 2014

MEC 2014 Notes


Resources:

Friday, March 28, 2014

Exchange 2013 SP1, New Install

Problem:

Error message pops up when attempting to edit user.
















The issue was created by my having changed the default OU for the creation of new users.

Fix:
Return the default location for Users:
redirusr "cn=Users,dc=domain,dc=local"

 

Exchange 2013: Remote host said: 451 4.7.0 Temporary server error.

Exchange 2013 SP1, New install

Problem:
Exchange 2013: Remote host said: 451 4.7.0 Temporary server error. Please try again later. PRX2

The server used were a multi-role server and found as this is a bug in the program.

The fix:

1. Create host file entries on the server with two names: server,server.domain.local

2. Restart “Microsoft Frontend Transport” and “Microsoft Exchange Transport” services

Thursday, September 19, 2013

Links for Exchange Info and Procedures

Exchange 2013 Info

Exchange 2013 Procedures:

Thursday, September 12, 2013

Exchange SSL Certs and DNS configurtion(s)

This article discusses how to deal with the fact that you can no longer get a 3rd party SSL Certificate for an internal domain.

The issue is that 3rd party Certs will not allow non-verifiable Certs after Oct 2016.  Essentially, that means that you should now configure your Exchange environment (2007/2010/2013) to not depend on Certs for internal names.

The solution is too simple.  Just configure your DNS server to implement a "Split-DNS-Horizon".
Note that this also works perfectly for auto-configuring your Outlook clients, regardless of whether they are connected internally or externally.

For this example, lets assume that your internal domain is domain.local, and that your email domain is domain.com

The easiest and simplest trick is to configure an entry in your internal DNS servers, to point autodiscover.domain.com to the internal IP address of your CAS server.

The best way to do this is to create a new DNS Zone with the name "autodiscover.domain.com", and then create an unnamed entry ("@") pointing to your internal CAS server(s). 


This way, it does not interfere with all of your existing DNS records for the "domain.com" zone, such as www, etc. 

So now, with this configuration, all that you need for a 3rd party SSL Cert is the "domain.com" name.  

Additional Reference:

Tuesday, September 10, 2013

Public Folder Migration Exchange 2003 to 2010

Public Folder Migration Exchange 2003 to 2010

 


Also, Form 2007/2010 to 2013, here are the Microsoft tools:

Wednesday, August 21, 2013

Office 365 - How to connect Powershell to Office 365 Service

How to connect Powershell to the Office365 Server, so that you can administer a Hybrid environment.

Issue the following commands:
  • Set-ExecutionPolicy Unrestricted
  • $cred = Get-Credential
    (Enter your Tenant Login to Office365)
  • $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection
    (Note: You may get a redirection as this command is executed:
    WARNING: Your connection has been redirected to the following URI:
    "
    https://pod51042psh.outlook.com/powershell-liveid?PSVersion=3.0 ")
  • Import-PSSession $Session
Before issuing this command, following are the Modules that were loaded:
PS>Get-Module
ModuleType Name                                ExportedCommands
---------- ----                                ----------------
Manifest   Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Cheomputer, Clear-Content...}
Manifest   MSOnline                            {Add-MsolForeignGroupToRole, Add-MAdd-MsolRoleMember,...


After issuing a successful connection to the Office365 Service, you now have the following:
PS C:\Windows\system32> Get-Module
ModuleType Name                                ExportedCommands
---------- ----                                ----------------
Manifest   Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Co...}
Manifest   Microsoft.PowerShell.Security       {ConvertFrom-SecureString, ConvertTo-Secu...
Manifest   Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Manifest   MSOnline                            {Add-MsolForeignGroupToRole, Add-MsolGroupMember, ...
Script     tmp_fhnxmnma.xiw                    {Add-AvailabilityAddressSpace, Add-Distribution...


This module adds 469 new commands.

http://help.outlook.com/en-us/140/cc952755.aspx

Friday, July 26, 2013

Office 365 - Change your default email domain

Office 365 - Change your default email domain

After you set up your custom domain in Office 365 (like mycompany.ca, for example), you can change the default domain that appears for new email addresses when you Add users.

To change the default domain:
  1. Go to your organization’s Office 365 profile:
  2. Go to Admin => Office 365
  3. In the upper right, click your organization’s name
 
  1. Click Edit.
  2. Choose a new default domain from the list of domains, and then save your changes.
http://office.microsoft.com/en-ca/office365-suite-help/change-your-default-domain-HA102818532.aspx

Monday, April 22, 2013

Exchange 2010 Mailbox Sizes, formated output

Here is the command to output a formatted table with the Mailbox size formatted to be human readable.
 
[PS] C:\Users\adminpds>get-mailboxstatistics -server ex-002 |Sort-Object TotalItemSize -Descending |Select-Object Displayname,  itemcount, TotalItemSize, database |ft Displayname,itemcount,@{n="Total Size (MB)";e={"{0:N0}" -f $_.TotalItemSize.Value.ToMB()};a="right"}, database