Les scripts de sauvegarde et recouvrement pour Exchange

Avec l’arrivée de solutions en ligne, je me suis penché sur les problématiques que ce type d’environnement pouvait poser en termes de disponibilité pour le contenu de vos boîtes aux lettres.
Après la préparation du plan de recouvrement dont nous avons parlé la semaine dernière, nous allons voir ici les scripts à utiliser.
Le script suivant permet de sauvegarder une boîte aux lettres ou l’ensemble des boîtes aux lettres d’une entreprise. Il vous suffit de recopier les instructions suivantes dans un fichier texte que vous renommerez Backup-MSOnlineUserMailbox.ps1. Procédez de même pour le script de restauration.
#
# Microsoft BPOS Script
#
# NAME: Backup-MSOnlineUserMailbox.ps1
#
# AUTHOR: Arnaud Alcabez
# DATE : 19/07/2010
#
# COMMENT: Use this script to backup an online user mailbox
#
#
#
==============================================================================================
cls
# Enlarge the console to display location results
mode con cols=180
# Load the Exchange Transporter Cmdlets if there are not loaded
$ExCmd = $False
$Modules = Get-PSSnapIn
ForEach ($_.Name in $Modules) {if ($_.Name -eq "Microsoft.Exchange.Transporter") { $ExCmd = $True
}}
If ($ExCmd -eq $False) {Add-PSSnapin Microsoft.Exchange.Transporter}
If ($ExCmd -eq $False) {Write-Host "Note: Exchange Online Cmdlets loaded..."}
Write-Host
Write-Host '┌─────────────────────────────────────────────────â”'
-ForegroundColor white -BackgroundColor darkred
Write-Host '│ │' -ForegroundColor white -BackgroundColor darkred
Write-Host '│ Enter your Exchange Online Admin ID account │' -ForegroundColor white
-BackgroundColor darkred
Write-Host '│ │' -ForegroundColor white -BackgroundColor darkred
Write-Host '└─────────────────────────────────────────────────┘'
-ForegroundColor white -BackgroundColor darkred
Write-Host
# Get the login ID for the BPOS admin account
$Credlogin = Read-Host 'Administrator Login ID'
$Credpwd = Read-Host 'Password' -AsSecureString
Write-Host
Write-Host
Write-Host '┌─────────────────────────────────────────────────â”'
-ForegroundColor white -BackgroundColor darkblue
Write-Host '│ │' -ForegroundColor white -BackgroundColor darkblue
Write-Host '│ Backup service for mailbox users on the │' -ForegroundColor white -BackgroundColor
darkblue
Write-Host '│ EMEA Datacenter for Microsoft Online Services │' -ForegroundColor white
-BackgroundColor darkblue
Write-Host '│ │' -ForegroundColor white -BackgroundColor darkblue
Write-Host '└─────────────────────────────────────────────────┘'
-ForegroundColor white -BackgroundColor darkblue
Write-Host
#Enter the usermailbox or (none) to check all mailboxes
$Usrbal = Read-Host 'Enter the user mailbox to backup or press [Enter] for all mailboxes'
Write-Host
# To automate the script, delete previous lines, modify the variables above, and remove the dash
# $CredLogin = “admin@masociete.com”
# $Credpwd = “Password1”
# $UsrBal = “”
# Form the BPOS encrypted credential information and store it in a variable to be passed to upcoming commands
$Cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList
$Credlogin, $Credpwd
If ($Usrbal -Eq "")
{
$balnb=Get-MSOnlineUser -Enabled -Credential $cred
Write-Host '*** WARNING *** There are' $balnb.Count 'mailboxes to backup' -ForegroundColor white
-BackgroundColor darkred
Write-Host
$Reponse = Read-Host 'INFO: The backup of all mailboxes can take several hours. Are you sure? [Y/N]'
Write-Host
If ($Reponse.ToUpper() -ne "Y")
{
Write-Host "INFO: The command is cancelled by the user"
Write-Host
Break
}
}
If ($Usrbal -Eq "")
{
$Colusers = Get-MSOnlineUser -Credential $cred -Enabled -ResultSize 10000
ForEach($User in $Colusers){
Write-Host 'INFO: Backup of' $User.Identity
Get-XsHostedExchangeMailboxdata -sourceserver "red002.mail.emea.microsoftonline.com"
-sourcelocation "https://red002.mail.emea.microsoftonline.com/exchange" -sourceidentity $User.Identity
-sourceadmincredential $cred | export-transporterbinary -targetfilepath . -targetfileprefix $User.Identity
}
Write-Host
}
Else {
Write-Host 'INFO: The backup of' $usrbal 'mailbox is starting. (This process can take several minutes).
Please, stand by...'
Get-XsHostedExchangeMailboxdata -sourceserver "red002.mail.emea.microsoftonline.com"
-sourcelocation "https://red002.mail.emea.microsoftonline.com/exchange" -sourceidentity $Usrbal
-sourceadmincredential $cred | export-transporterbinary -targetfilepath . -targetfileprefix $Usrbal
Write-Host 'INFO: The backup of' $usrbal 'is finished.'
Write-Host
}
Nous sommes ouverts à tous les thèmes portant sur les services, les solutions et les technologies informatiques d'entreprise. Notre seule condition sera la qualité de votre contribution, quel que soit votre thème de prédilection, actualités, annonces, lancements, stratégie, tutoriaux, trucs et astuces, bonnes pratiques... cette liste n'étant pas exhaustive, stay tuned, au plaisir de collaborer.
libérez le potentiel de vos données !Découvrez SQL Server 2012, la plate-forme de gestion et d’analyse de l’information la plus complète du marché. Analyses décisionnelles plus rapides et très haute disponibilité… libérez le potentiel de vos données !Découvrez comment libérez le potentiel de vos données !
Ressources Informatiques
Actualités Informatiques
BYOD : Sécuriser les terminaux mobiles avec Exchange 19/04/2012 | Consumérisation | Exchange Server
Les challenges de la haute disponibilité avec Exchange 2010 16/04/2012 | Haute Disponibilité | Exchange Server
Les points clés d’une architecture Exchange 2010 13/04/2012 | Architecture | Exchange Server
Vade Retro protège les messageries dans le cloud 08/03/2012 | Cloud Computing | Messagerie
WriteThat.name pour Outlook en beta publique 25/01/2012 | Exchange Server | Outlook
A la une d'Exchange Magazine : Consumérisation, Exchange SP2 et Lync 23/01/2012 | Lync | Exchange Server
Exchange Server Service Pack 2 est disponible 07/12/2011 | Cloud Computing | Exchange Server
Exchange 2010 virtualisé sur EMC VNX : Mode d'emploi 30/11/2011 | EMC | Exchange Server
WriteThat.Name arrive sur Outlook 18/11/2011 | Exchange Server | Google
Refresh IT migre les messageries vers Office 365 08/11/2011 | Cloud Computing | Exchange Server
Mise à jour automatique de votre carnet d'adresses avec WriteThat.Name 13/09/2011 | Administrateur | Déploiement
San Francisco adopte Exchange Online 23/05/2011 | Cloud Computing | Exchange Server
Les solutions Radware certifiées Exchange Server 2010 23/05/2011 | Exchange Server | Messagerie
La migration vers Exchange 2010 expliquée par Microsoft 19/05/2011 | Evènement | Exchange Server
ESET renforce son anti-spams pour Exchange 12/05/2011 | Administrateur | Exchange Server
Vidéos Informatiques
Travail Collaboratif Présentation du Dell XPS 13
Travail Collaboratif Premiers déploiements massifs de SharePoint Workspace en 2012
Cloud computing « Le cloud ne doit pas être une aire de non-droit »
Windows Server Du script PowerShell à l’interface web avec Poshboard
Liens Informatiques
Ressources iT Pro
1er Guide thématique dédié à la mise œuvre d’un Cloud PrivéIT Pro Magazine | 12 pages
Guide de protection des environnements Hyper-VITPro Magazine | 4 pages
Guide d’optimisation & synchronisation des données SharePointAvepoint | 18 pages
Booster les performances des plates-formes virtuelles ?Diskeeper | 12 pages
IT Pro Magazine Spécial Windows 8IT Pro Magazine | 60 pages
Le guide du stockage signé IT Pro MagazineIT Pro Magazine | 16 pages
Testez Acronis Backup & Recovery 11 Virtual EditionAcronis | 2 pages





















