Powershell

Exchange Migration – Restart Apppool

Here is a gret script that restarts the Autodiscover Apppool every 5 minutes until there isn’t any mailboxes left on the oldserver. This one works for Exchange 2016 and 2013 Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn; do{ $i = 1 $mail = (get-mailbox -server “kakster-oldexchange”).count Restart-WebAppPool MSExchangeAutodiscoverAppPool Write-host “Restarting AppPool” -ForegroundColor GREEN “Waiting for 3 minutes” Start-Sleep -Seconds 300 …

Office 365 Migration

Greate cmdlets to use during exchange migration This powershell cmdlet requieres that you are connected to exchange online. It will list the status of all mailboxes beeing synced. Get-MigrationUser -Status Syncing | Get-MigrationUserStatistics | ft Identity, PercentageComplete, State, TotalItemsInSourceMailboxCoun t, BytesTransferred, EstimatedTotalTransfersize Another cmd-let that gives some more detailed look Get-MoveRequestStatistics -identity e-mailaddress Replace emailaddress …

Automatic reboot and correct logoff for citrix

In addition to the Remote Desktop reboot i’ve created one for citrix as well. This customer had two catalogs, and thay didn’t want the second machine catalog to be rebooted each day. Replace the $XACatalogName with you own. [code language=”Powershell”] Add-PSSnapin citrix.* $XACatalogName = "XenApp Production Servers" $MessageSubject = "Reboot Schedule" $MessageBody = "You have …