Thursday, March 17, 2011

GroupWise To Exchange 2010 Part 1

Over the course of 2010 I was responsible for Migrating 4,000+ GroupWise accounts to Exchange 2010SP1. I would like to share a little over view of the project and some of the scripts I wrote.

While most of the setup of our Exchange environment was setup by a local consulting company I was responsible for the data migration, Blackberry migration, and the roll-out of office 2010 from office 2000 & 2003. while planning and prep work took about a year the actual roll-out /  cut over was to be over the course of a weekend yes 48+hrs to move 90 days of email calendar data. A combination of Quest Software's GroupWise Migrator for Exchange and a set of PowerShell Scripts allowed for such a successful cut-over aka the ripping of the band-aid approach.

Our environment  already had  Active Directory deployed and was the primary method of authentication, the only thing that NDS was used for GroupWise authentication. in order to do most of the mass operations I wrote 5 different Powershell scripts to handle this that would work off the CSV's that the Quest tool would output and use for the migration. The first script would Mail Enable an account on a random database, enable their archive on a random database if they had one, and set the mailbox limitations based off of a classification that was assigned to the user. Error logging was also incorporated into the script to allow us to fix any AD account.

Tomorrow I will will share my scripts used to set the primary email address and to set the visablity of the account to the address book.


Till next time.


#Created By Matt Karel Copyrighted Sept 2010
Add-PSSnapin Microsoft.Exchange.Management.Powershell.E2010 -ErrorAction SilentlyContinue
#Create new object to generate random numbers
$Rand=new-object System.Random

#Build 1d array of DB
$Databases=("DB1_A"),("DB1_B"),("DB2_A"),("DB2_B"),("DB3_A"),("DB3_B"),("DB4_A"),("DB4_B"),("DB5_A"),("DB5_B"),("DB6_A"),("DB6_B")

$ArchiveDatabases=("MBX1_Archive1"),("MBX1_Archive2"),("MBX2_Archive1"),("MBX2_Archive2"),("MBX3_Archive1"),("MBX3_Archive2")

$Errorfile = New-Item -type file "Enable-Mailbox ErrorLog.txt" -Force
$Error.Clear() #Clears the Error Variable that stores Error Information

# Import the CSV file   modify the path to your file here
#$csv = Import-CSV "C:\PS-Scripts\CSVs\BHGPO4.csv"
$CSVPath= read-host "Enter the Path to the Quest CSV here"
$csv = Import-CSV $CSVPath
# Your domain name
$domain = 'domain.local"

# Mailbox Database to create mailboxes in (format is server\StorageGroup\Database Name)
#$database = 'SERVER\StorageGroup\Database'

#Function Section
Function EnableMailbox {
    Trap {
        Add-Content -Path "$Errorfile" -Value "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        add-content -Path "$Errorfile" -Value "Error Enabling Mailbox $UserID "
        add-content -Path "$Errorfile" -Value  $Error[0].ToString()
        add-content -Path "$Errorfile" -Value ""
        Write-Host "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        Write-Host $Error[0].ToString()
        Continue
        }
     Enable-Mailbox -Identity "$domain\$UserID" -Database "$DB" -PrimarySmtpAddress "$Email" -Alias "$Alias" -ErrorAction Stop
}
Function EnableArchive {
    Trap {
        Add-Content -Path "$Errorfile" -Value "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        add-content -Path "$Errorfile" -Value "Error Enabling Archive $UserID "
        add-content -Path "$Errorfile" -Value $Error[0].ToString()
        add-content -Path "$Errorfile" -Value ""
        Write-Host "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        Write-Host $Error[0].ToString()
        Continue
        }
     Enable-Mailbox -Identity "$domain\$UserID" -Archive -ArchiveDatabase "$ArchiveDB" -ErrorAction Stop
}
Function ModifyCASMailbox {
    Trap {
        Add-Content -Path "$Errorfile" -Value "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        add-content -Path "$Errorfile" -Value "Error Set-CasMailbox $UserID "
        add-content -Path "$Errorfile" -Value $Error[0].ToString()
        add-content -Path "$Errorfile" -Value ""
        Write-Host "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        Write-Host $Error[0].ToString()
        Continue
        }
     Set-CASMailbox -Identity "$domain\$UserID" -ActiveSyncEnabled:$ActiveSync -ErrorAction Stop
}
Function TestForMBX {
   
     $MBXExists=Get-Mailbox -Identity "$domain\$UserID" -ErrorAction SilentlyContinue
     If($MBXExists){
        Return $true
     }Else{
        Return $false
     }
}

# Loop through the CSV and create a new user & mailbox for each line found
foreach ($Record in $csv){
    $DB=$Databases[$Rand.Next(1,12)] #Get a random database
    $Email=$Record.TargetAddress
    $UserID=$Record.Userid
    $Class=$Record.Class
    $PO=$Record.PostOffice
    $DisplayName=$Record.DisplayName
   
    $Temp=(Get-Culture).TextInfo.ToTitleCase((($UserID).ToLower())) #Drop the user id to Title Case
    $Alias=$Temp.substring(0,$Temp.length -1)+$Temp.substring($Temp.length -1,1).ToUpper() #Use the Temp Var to set Alias var with the first and last char to caps.
   
    $Temp=(Get-Culture).TextInfo.ToTitleCase((($Email).ToLower())) #Drop the Email id to Title Case
    $EmailDomain=$Temp.substring($Temp.IndexOf("@")).ToLower()
    $Email=$Temp.substring(0,$Temp.length -15)+$Temp.substring($Temp.length -15,1).ToUpper()+$EmailDomain #Use the Temp Var to set Alias var with the first and last char to caps.

   
               Switch ($Class){
                1 {
                    $MB_Size_Warn="1.8GB"
                    $MB_Size_ProhibitSend="2GB"
                    $Archive=$TRUE
                    $ActiveSync=$FALSE
                    $RetentionPolicy=$null
                    $ArchiveDB=$ArchiveDatabases[$Rand.Next(1,6)]
                    $ArchiveQuota="50GB" #Exchange Default
                    $ArchiveWarnQuota="45GB" #Exchange Default
                   }
                 1a {
                    $MB_Size_Warn="1.8GB"
                    $MB_Size_ProhibitSend="2GB"
                    $Archive=$TRUE
                    $ActiveSync=$FALSE
                    $RetentionPolicy="Default Archive-Enabled Retention Policy"
                    $ArchiveDB=$ArchiveDatabases[$Rand.Next(1,6)]
                    $ArchiveQuota="50GB" #Exchange Default
                    $ArchiveWarnQuota="45GB" #Exchange Default
                   }
                 2 {
                     $MB_Size_Warn="921MB"
                     $MB_Size_ProhibitSend="1GB"
                     $Archive=$TRUE
                     $ActiveSync=$FALSE
                     $RetentionPolicy="Default Archive-Enabled Retention Policy"
                     $ArchiveDB=$ArchiveDatabases[$Rand.Next(1,6)]
                     $ArchiveQuota="1GB"
                     $ArchiveWarnQuota="900MB"
                   }
                 3 {
                     $MB_Size_Warn="720MB"
                     $MB_Size_ProhibitSend="800MB"
                     $Archive=$TRUE
                     $ActiveSync=$FALSE
                     $RetentionPolicy="Default Archive-Enabled Retention Policy"
                     $ArchiveDB=$ArchiveDatabases[$Rand.Next(1,6)]
                     $ArchiveQuota="800MB"
                     $ArchiveWarnQuota="720MB"
                   }
                 4 {
                     $MB_Size_Warn="180MB"
                     $MB_Size_ProhibitSend="200MB"
                     $Archive=$FALSE
                     $ActiveSync=$FALSE
                     $RetentionPolicy="Default No Archive Retention Policy"
                   }

            }
                           
                If($Archive -eq $FALSE){
                    If (TestForMBX){
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -RetentionPolicy "$RetentionPolicy"
                        ModifyCASMailbox
                    }
                    Else{
                        EnableMailbox
                        Start-Sleep -m 200
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -RetentionPolicy "$RetentionPolicy"
                        ModifyCASMailbox
                    }
                }
                   
                If($Archive -and $Class -eq "1") {
                    If (TestForMBX){
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -ArchiveQuota "$ArchiveQuota" -ArchiveWarningQuota "$ArchiveWarnQuota" -RetentionPolicy $null -ErrorAction Continue
                        ModifyCASMailbox
                    }
                    Else{                                           
                        EnableMailbox
                        Start-Sleep -m 200
                        EnableArchive
                        Start-Sleep -m 200
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -ArchiveQuota "$ArchiveQuota" -ArchiveWarningQuota "$ArchiveWarnQuota" -RetentionPolicy $null -ErrorAction Continue
                        ModifyCASMailbox
                    }
                }
                elseif($Archive -and $Class -ne "1"){
                    If (TestForMBX){
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -ArchiveQuota "$ArchiveQuota" -ArchiveWarningQuota "$ArchiveWarnQuota" -RetentionPolicy "$RetentionPolicy" -ErrorAction Continue
                        ModifyCASMailbox
                    }
                    Else{
                        EnableMailbox
                        Start-Sleep -m 200
                        EnableArchive
                        Start-Sleep -m 200
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -ArchiveQuota "$ArchiveQuota" -ArchiveWarningQuota "$ArchiveWarnQuota" -RetentionPolicy "$RetentionPolicy" -ErrorAction Continue
                        ModifyCASMailbox
                    }
                }

        }

9 comments:

  1. Thanks IBAGEEK for sharing such a valuable information to migrate from Groupwise to Exchange server. I have found here a very easy to use application to perform migration process efficiently: http://groupwise-exchange.blogspot.in/

    The tool provides two options to move the GroupWise mailboxes to MS Exchange server mailboxes. Users can move either single or multiple mailboxes at a time.

    ReplyDelete
  2. Hi IBAGEEK,

    Thanks for sharing the detailed read but the migration method you mentioned is time taking and risky. That’s why I prefer to use third party tools for migration or conversion. GroupWise to exchange Migrator by Stellar is a good option to save your time and energy both but off course you have to pay for it , but to make your process risk free this is the best option which is very secure and easy to use.
    http://exchange.stellarservertools.com/groupwise-to-exchange.php

    ReplyDelete
  3. Migrating from one platform to another is really very tedious and complex job. However, there are some third party applications available which have simplified the process of migration. Recently, we have migrated our 24500 mailboxes from GroupWise 8.0 to MS Exchange 2010 Server successfully with the help of a tool that we found here: - http://www.recoverydeletedfiles.com/groupwise-exchange-migration.html


    ReplyDelete
  4. Groupwise to Microsoft Exchange Migration software is a complete, simple and cost effective solution that helps the organizations to move from existing Groupwise messaging systems to MS Exchange Server messaging systems quickly: Visit here: http://www.groupwisetopst.net

    ReplyDelete
  5. Novell GroupWise is email client program, for migration of Novell GroupWise to MS Outlook PST using an efficient GroupWise to Outlook software. This tool easily extract all GroupWise files and transfer the same into accessible Oulook PST format. See more at: https://softcart.wordpress.com/groupwise-to-exchange-migrator/

    ReplyDelete
  6. Migrating from one platform to another is really very tedious and complex job. However, there are some third party applications available which have simplified the process of migration. Recently, we have migrated our 24500 mailboxes from GroupWise 8.0 to MS Exchange 2010 Server successfully with the help of a tool that we found here :- http://www.recoverfilesdata.com/migrate-groupwise-exchange.html

    ReplyDelete
  7. I found one more cool reference for GroupWise to Exchange migration, you can even have a look on that.This tool is easy to use and most importantly secure :- http://www.mannatsoftware.com/stellar-phoenix-groupwise-to-exchange.html

    ReplyDelete
  8. To migrate GroupWise mailboxes into MS Exchange server, I would like to suggest GroupWise to Exchange Migration an excellent solution for quick and accurate migration of mailboxes from GroupWise to Exchange server.
    Read more : http://www.softmagnat.com/groupwise-to-exchange.html

    ReplyDelete
  9. I am really happy to read this website posts which contains lots of valuable facts, thanks for providing these statistics.Currency Exchange In San Francisco

    ReplyDelete