Showing posts with label exchange 2013. Show all posts
Showing posts with label exchange 2013. Show all posts

Tuesday, 16 August 2016

Pull Name, SMTP, OU and last logon time from Exchange 2013

This script enables you to pull together the Name, Primary SMTP Address, Organizational Unit and Last Logon Time information.  This information can be useful if you are trying to find out which mailboxes are being used or not.  This script has been tested on Exchange 2013 only.  


Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, PrimarySMTPAddress, OrganizationalUnit, @{label="LastLogonTime";expression={(Get-MailboxStatistics $_).LastLogonTime}}



Tuesday, 5 January 2016

Retention Policy Powershell Commands

I've recently been working on applying retention policies to mailboxes and we've been doing a granular roll-out to the users.  I've been using some Powershell commands to track who has the policy applied and who hasn't.

The following command will list all users who have a retention policy applied to their mailbox:
Get-Mailbox -filter 'RetentionPolicy -like "*"' | Select-Object Name, RetentionPolicy

You can export that to a CSV if need be by using:

 Get-Mailbox -filter 'RetentionPolicy -like "*"' | Select-Object Name, RetentionPolicy | Export-CSV C:\directory\file.csv


To identify which users don't have a retention policy applied to their mailbox the following command will assist:

Get-Mailbox -filter 'RetentionPolicy -eq $null' | Select-Object Name, RetentionPolicy

Again to export that to CSV you would use:

Get-Mailbox -filter 'RetentionPolicy -eq $null' | Select-Object Name, RetentionPolicy | Export-CSV C:\Directory\file.csv 

Wednesday, 23 December 2015

Clearing out move requests

When you perform a successful mailbox migration, either from another version of Exchange or from another mailbox database the move request is "left" behind as such and should be cleared out as part of good housekeeping.

My favourite command for doing this is:

Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest

Monday, 2 November 2015

Exchange 2013 Active Directory property ‎homeMDB‎ is not writeable on recipient

When trying to migrate users from Exchange 2007 to Exchange 2013 you may see the following error below:

 Error:MigrationPermanentException: Active Directory property ‎'homeMDB‎' is not writeable on recipient ‎'domain.local/users/employee.smith‎'. --> Active Directory property ‎'homeMDB‎' is not writeable on recipient ‎'domain.local/users/employee.smith‎'.
With many Exchange issues the solution is to set the correct permissions to allow Exchange to migrate the mailbox.

To resolve this issue follow these steps:



  1. Launch Active Directory
  2. Click on View and select Advanced Features


  3. Now location the users mailbox you are having the issue with and select properties
  4. Now click on the security tab
  5. Next select Advanced


         
  6. Now place a tick in the "Include inheritable permissions from this objects parents" box and click OK
  7. It may take a few minutes for this change to take effect but once it has you should be able to migrate the users mailbox without any problems. 




  • Wednesday, 28 October 2015

    Unable to sync phone to Exchange

    If you've been following my blog for the last few weeks you'll have heard me talk about the Exchange 2013 migration project I've been working on.  Well we hit another snag in the migration the other day around the users mobile phones not syncing to the new mailbox server after moving to Exchange 2013.

    At first we thought it was just one or two users but it transpired that over 80 users were affected!! After investigating whether or not ActiveSync was working as expected (it was) we turned our attention to looking at an issue within the users accounts.

    It turned out that the 80 users were all a member of a protected group within Active Directory and weren't getting the correct permissions to sync their phones as per Microsoft's best practices.

    In order to get to that stage I used some PowerShell queries which I thought were quite interesting so I'm sharing.

    I used the following command to query Active Directory for all users that had the "AdminCount" attribute set to something greater than 0.  If set to 1 it indicates the user is either a member of a protected group or has been:


    Import-Module ac* 
    Get-ADuser -filter {admincount -gt 0} -Properties admincount -ResultSetSize $null | export-csv c:\\onyx\document.csv

    To find out which groups within the Active Directory environment I was working in were considered a Protected Group I ran the following query:

    Import-Module ac*
    Get-ADgroup -LDAPFilter "(admincount=1)" | select name 

    From there I was able to check the groups individually to see which ones contained, if any, the users that were having issues with their phones.  All the affected users were a member of the "Print Operators" group. Mystery solved!



    Friday, 23 October 2015

    Get Mailbox Move Progress

    I've recently been involved in an email migration from Exchange 2007 to Exchange 2013 and in order to monitor the progress of the mailbox moves I've been using Powershell commands, the two I've used are:

    Get-MoveRequestStatistics -MoveRequestQueue "Mailbox Database 1"| Sort PercentComplete

    This results in giving the Display Name, StatusDetail, TotalMailboxSize, TotalArchiveSize and PercentComplete of each mailbox move to that Exchange 2013 database.



    The other one that I've found useful is:

    Get-MoveRequestStatistics -MoveRequestQueue "Mailbox Database 1"| Where-Object {$_.StatusDetail -eq "Copying Messages"} | Sort PercentComplete

    This is just a variation on the first query but it only shows the mailboxes that are currently copying messages to the Exchange 2013 environment.



    Just remember a watched kettle never boils though! lol 

    Wednesday, 21 October 2015

    Powershell Query to Analyze your Mailbox Movement

    I've recently been doing an Exchange 2007 to Exchange 2013 migration and wanted to find out the kind of speed the mailbox moves were taking.  I used the below Powershell script to pull out the MB transfer speed per minute:


    Get-MoveRequest | Where { $_.Status -eq “Completed” } | Get-MoveRequestStatistics | Select DisplayName,TotalMailboxSize,TotalMailboxItemCount,@{n=”Speed MB/min”; e={ [int]($_.BytesTransferred.ToMB() / $_.TotalInProgressDuration.TotalMinutes) }}