Skip to content

Instantly share code, notes, and snippets.

@RIKIKU
Last active June 20, 2017 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RIKIKU/c3fb769b1e2466df83fbdf6d138b4f23 to your computer and use it in GitHub Desktop.
Save RIKIKU/c3fb769b1e2466df83fbdf6d138b4f23 to your computer and use it in GitHub Desktop.
$orgs = Import-Clixml "C:\CRMOrgs.xml" #Put the Literal Path to your Orgs Path here
$SQLServerName = "Example\exampleinstance" # The SQLServername\Instance name of the new server goes here
$SRSurl = "http://Example/reportserver" # reporting services URL of the new server goes here.
Add-PSSnapin Microsoft.crm.powershell
$jobs = @()
foreach($org in $orgs)
{
try
{
$jobs += Import-CrmOrganization -SqlServerName $SQLServerName -SrsUrl $SRSurl -DatabaseName $($org.DatabaseName) -DisplayName $($org.FriendlyName) -Name $($org.UniqueName) -UserMappingMethod ByAccount
}
catch
{
$Error[0]
Write-Output $($org.DatabaseName)
}
}
$jobs.GetEnumerator() | Get-CrmOperationStatus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment