Sunday, July 1, 2018
Lync BackUP Powershell Script
Lync BackUP Powershell Script
This Script is to take the Back up of Lync using Power Shell Script .
$BackupPath = "C:BackupLync" ( Change the Backup path according to yours)
$FileStore = "Lync01.Contoso.comLyncshare" ( Change File store according to Yours)
$Pool = "lyncpool01.Contoso.Com" ( Change the pool name)
$SQLinstance = "lyncrtc.Contoso.com tc" ( Change te Sql instance )
$RemoteLocation = "lync02C$BackupLync" ( Change the Back Up Location)
md $BackupPath"backup_$((get-date).toString(ddMMyyyy))"
Export-CsConfiguration -FileName $BackupPath"backup_$((get-date).toString(ddMMyyyy))"Config.zip
Export-CslisConfiguration -FileName $BackupPath"backup_$((get-date).toString(ddMMyyyy))"CsLISconfig.zip
CD "C:Program FilesCommon FilesMicrosoft Lync Server 2010Support"
./DBImpExp.exe /hrxmlfile:"$BackupPath"backup_$((get-date).toString(ddMMyyyy))"UserData.xml" /sqlserver:$SQLinstance
CD "C:Program FilesMicrosoft Lync Server 2010ResKit"
Import-Module .RgsImportExport.ps1
Export-CsRgsConfiguration -Source applicationserver:$Pool �FileName $BackupPath"backup_$((get-date).toString(ddMMyyyy))"RGSconfig.zip
md $BackupPath"backup_$((get-date).toString(ddMMyyyy))"FileStore
xcopy /E /C /H /K /O $FileStore $BackupPath"backup_$((get-date).toString(ddMMyyyy))"FileStore > $BackupPath"backup_$((get-date).toString(ddMMyyyy))"FileStoreFileStoreFileCopyList.txt
Get-CsTopology -AsXML | Out-File $BackupPath"backup_$((get-date).toString(ddMMyyyy))"CSTopology.xml
md lync01C$BackupLync"backup_$((get-date).toString(ddMMyyyy))"
xcopy /E /C /H /K /O $BackupPath"backup_$((get-date).toString(ddMMyyyy))" $RemoteLocation"backup_$((get-date).toString(ddMMyyyy))"
Any Comments are Welcome :)
$BackupPath = "C:BackupLync" ( Change the Backup path according to yours)
$FileStore = "Lync01.Contoso.comLyncshare" ( Change File store according to Yours)
$Pool = "lyncpool01.Contoso.Com" ( Change the pool name)
$SQLinstance = "lyncrtc.Contoso.com tc" ( Change te Sql instance )
$RemoteLocation = "lync02C$BackupLync" ( Change the Back Up Location)
md $BackupPath"backup_$((get-date).toString(ddMMyyyy))"
Export-CsConfiguration -FileName $BackupPath"backup_$((get-date).toString(ddMMyyyy))"Config.zip
Export-CslisConfiguration -FileName $BackupPath"backup_$((get-date).toString(ddMMyyyy))"CsLISconfig.zip
CD "C:Program FilesCommon FilesMicrosoft Lync Server 2010Support"
./DBImpExp.exe /hrxmlfile:"$BackupPath"backup_$((get-date).toString(ddMMyyyy))"UserData.xml" /sqlserver:$SQLinstance
CD "C:Program FilesMicrosoft Lync Server 2010ResKit"
Import-Module .RgsImportExport.ps1
Export-CsRgsConfiguration -Source applicationserver:$Pool �FileName $BackupPath"backup_$((get-date).toString(ddMMyyyy))"RGSconfig.zip
md $BackupPath"backup_$((get-date).toString(ddMMyyyy))"FileStore
xcopy /E /C /H /K /O $FileStore $BackupPath"backup_$((get-date).toString(ddMMyyyy))"FileStore > $BackupPath"backup_$((get-date).toString(ddMMyyyy))"FileStoreFileStoreFileCopyList.txt
Get-CsTopology -AsXML | Out-File $BackupPath"backup_$((get-date).toString(ddMMyyyy))"CSTopology.xml
md lync01C$BackupLync"backup_$((get-date).toString(ddMMyyyy))"
xcopy /E /C /H /K /O $BackupPath"backup_$((get-date).toString(ddMMyyyy))" $RemoteLocation"backup_$((get-date).toString(ddMMyyyy))"
Any Comments are Welcome :)