In order to move all email accounts and data from IMAP or POP3 Zimbra Server in Linux box machine to Exchange Server 2007, we need to create a .CSV file with the following columns:
- SourceIdentity: The e-mail account that the user has in the IMAP/POP3 Server
- SourceServer: The name or IP of the IMAP/POP3 Server
- SourceLoginID: the account user name used to connect on the IMAP/POP3 server
- SourcePassword: the user’s password
- TargetIdentity: the Exchange Server 2007 identity will receive the data from the previous IMAP/POP3 Server settings
Here is the script:
#!/bin/bash
clear
echo "Processing account, please wait.............................."
USERS=`su - zimbra -c 'zmprov -l gaa'`
#Assume that domain name is test.com
exchange="@test.com"
echo "SourceIdentity,SourceServer,SourceLoginID,SourcePassword,TargetIdentity" > export_users.csv
for ACCOUNT in $USERS
do
SourceIdentity=`echo $ACCOUNT`
#Assume that domain name is xyz.com for Linux box and Zimbra
SourceServer=`echo "xyz.com"`
SourceLoginID=`echo $ACCOUNT | awk -F@ '{print $1}'`
SourcePassword=`echo "P@ssw0rd"`
TargetIdentity=`echo -n $ACCOUNT | awk -F@ '{print $1}'`
TargetIdentity=${TargetIdentity}${exchange}
if [ $SourceLoginID == "admin" ] || [ $SourceLoginID == "spam" ] || [ $SourceLoginID == "ham" ] || [ $SourceLoginID == "virus-quarantine" ]
then
echo "Skipping system account, $ACCOUNT..."
else
echo "$SourceIdentity,$SourceServer,$SourceLoginID,$SourcePassword,$TargetIdentity" >> export_users.csv
fi
done
Now, we can use this CSV file in Microsoft Transporter Suite to import users to Exchange 2007.
Hope enjoy using this script. Please leave your comments or questions. I will try to answer as soon as possible.
Thanks,
Khosro Taraghi
How about a csv file of all emails in the same machine.
ReplyDeleteIt works, great work.
ReplyDeletecan you suggest me linux basic shell script books, online or PDF files
Great post with helpful information. For more information, visit our website.
ReplyDelete123.hp.com || 123.hp.com/setup || 123HP Setup || hp.com/setup || hp.com/123 || 123.hp.com setup || 123 HP Printer Setup || 123 HP Printer Support || 123 HP Setup Install || 123hpcom || 123 HP Printer Install || 123hpcomsetup || 123 HP Printer Setup || 123HP Install || hpcom/123 || 123hpcominstall || 123HP Setup || 123 HP Smart App || Install 123 HP || HP 123 Setup