Link to home
Start Free TrialLog in
Avatar of Kelly Garcia
Kelly GarciaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

New-MoveRequest Exchange 2010 Powershell

Hi All,

I have this powershell script, which is part of a larger GUI that's been developed:

$mailboxtomigrate = get-mailbox -ResultSize Unlimited | Get-MailboxStatistics | where {$_.TotalItemSize -ge "4GB"} | Select-Object DisplayName,TotalItemSize, ItemCount, Database, TotalDeletedItemSize,DeletedItemCount, LastLoggedOnUserAccount, LastLogonTime, LastLogoffTime 

$global:m = $mailboxtomigrate.displayname
		

$m | % {
			try {

			New-MoveRequest -Identity $_ -TargetDatabase $TargetDatabase -WhatIf 
				}
			catch {
			
			write-host “Caught an exception:” -ForegroundColor Red
			write-host “Exception Type: $($_.Exception.GetType().FullName)” -ForegroundColor Red
			write-host “Exception Message: $($_.Exception.Message)” -ForegroundColor Red
					}

Open in new window


I have these two requirements for the script;

2- you should also run a check prior to migration that destination mail store has enough space to move the (mailbox or mail boxes) by calculating the total used size on destination + ( migrating mailbox)

3- you should check that there is always 200gb free on the destination mail store after migration is completed

How do I achieve this?

Thank you in advance.
ASKER CERTIFIED SOLUTION
Avatar of Jian An Lim
Jian An Lim
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial