Creating Test Orgs with PowerShell

If you have ever tried to create more than a couple orgs with Deployment Manager you know it is a lengthy process. The nice thing about PowerShell is that you can queue up creation and walk away and let the server do all the work. When you come back, all of them are created.

Here’s a very simple snippet of PowerShell code that will create multiple orgs – you can obviously make it a lot fancier but this does the job!

 Add-PSSnapin Microsoft.crm.powershell

$nextOrg = 1
  $orgName = "Dave"+$nextOrg 
 New-CrmOrganization -DisplayName $orgName -SqlServerName crmdev -SrsUrl 		http://crmdev/reportserver -Name $orgName 
while ($nextORg -le 20)