Hi all,
Recently I had a requirement to change a deployment setting in Dynamics CRM. The issue was that this setting could either be modified by updating a flag in the CRM database or using a powershell script but not from any convenient UI. In my quest to solve this issue, I uncovered how to get Powershell configured so that we can use the common Dynamics CRM cmdlets. I will describe those steps as well as give the script that will help to update obscure deployment settings for CRM Online (when there is no access to the CRM database)
Configuring Power Shell with Dynamics CRM: The steps in details are mentioned here.
Once Power Shell is configured, we will focus on the steps to update the deployment settings:
# on premises instance
$CRM_URL = "http://IP:PORT";
$ORG_NAME = "contosoprod";
#Obtain the credentials in the pop up
$cred = Get-Credential
# Get the connection object (below will change based on deployment type - refer to above link)
$conn = Get-CrmConnection -ServerUrl $CRM_URL -Credential $cred -OrganizationName $ORG_NAME;
# add snap in
Add-PSSnapin Microsoft.Crm.PowerShell;
# get the present team settings
$set = Get-CrmSetting -SettingType TeamSettings;
# update the required setting (not yet transacted to database)
$set.MaxEntitiesEnabledForAutoCreatedAccessTeams = 8;
# set the required setting (database updated)
Set-CrmSetting -Setting $set;
# view the updated settings
Get-CrmSetting -SettingType TeamSettings;
Here we have updated the MaxEntitiesEnabledForAutoCreatedAccessTeams property in the TeamSettings. However, there exist a host of settings that can be updated using the same procedure as described above. The full list can be found here.
Hope this starting tutorial helps you realize the potential of infusing Powershell with Dynamics CRM!
Let me know your views!
Thanks!
No comments:
Post a Comment