Organization Versionen mit PowerShell auslesen

Das folgende Script liest die Versionen aller Mandanten und gibt das entsprechende UR an.

Add-PSSnapin Microsoft.Crm.PowerShell
$orgs =  Get-CrmOrganization
foreach ($org in $orgs)
{
Write-Host Version: $org.Version

If ($org.Version -eq ‘5.0.9688.53’)
{
Write-Host ‘RC’
}
ElseIf ($org.Version -eq ‘5.0.9688.583’)
{
Write-Host ‘RTM’
}
ElseIf ($org.Version -eq ‘5.0.9688.1045’)
{
Write-Host ‘UR1’
}
ElseIf ($org.Version -eq ‘5.0.9688.1155’)
{
Write-Host ‘UR2’
}
ElseIf ($org.Version -eq ‘5.0.9688.1244’)
{
Write-Host ‘UR3’
}
ElseIf ($org.Version -eq ‘5.0.9688.1450’)
{
Write-Host ‘UR4’
}
ElseIf ($org.Version -eq ‘5.0.9688.1533’)
{
Write-Host ‘UR5’
}
ElseIf ($org.Version -eq ‘5.0.9689.1985’ -or $org.Version -eq ‘5.0.9690.1992’)
{
Write-Host ‘UR6’
}
ElseIf ($org.Version -eq ‘5.0.9690.2165’)
{
Write-Host ‘UR7’
}
ElseIf ($org.Version -eq ‘5.0.9690.2243’)
{
Write-Host ‘UR8’
}
ElseIf ($org.Version -eq ‘5.0.9690.2835’ -or $org.Version -eq ‘5.0.9690.2838’ -or $org.Version -eq ‘5.0.9690.2903’)
{
Write-Host ‘UR11’
}
ElseIf ($org.Version -eq ‘5.0.9690.3218’ -or $org.Version -eq ‘5.0.9690.3233’ -or $org.Version -eq ‘5.0.9690.3236’)
{
Write-Host ‘UR12’
}
ElseIf ($org.Version -eq ‘5.0.9690.3448 ‘)
{
Write-Host ‘UR13’
}
ElseIf ($org.Version -eq ‘5.0.9690.3557’)
{
Write-Host ‘UR14’
}
ElseIf ($org.Version -eq ‘5.0.9690.3731’)
{
Write-Host ‘UR15’
}
Else
{
Write-Host ‘Version not found!’
}
Write-Host
}

Read-Host

Leave a Reply

Your email address will not be published. Required fields are marked *