之前没注意过command的方式来安装CRM,估计很多人也不知道,之所以关注到他是因为最近在搞一个外资客户的项目,客户公司的IT是归global统一管理,而global方面以安全为由拒绝给AD账号创建group的权限,必须先预先创建好,所以只能通过command方式来指定group。
安装的前提当然是先把app和db server加入域,然后在db server上装好sql,在app server上下载好CRM的安装文件并解压(后文中SetupServer.exe定位的就是解压出来的安装文件夹)。
本篇的目的是为了应对预先装好AD Group,所以我们得先把AD的四个group建好,虽然group的创建权限可以不用,但剩余的权限一个都不能少,具体需要哪些权限可以看官方docs。
关于command的说明可以参考官方docs。
command命令其实很简单
SetupServer.exe /QR /L C:\CRM\server_install_log.log /config C:\CRM\server_install_config.xml
其中的config配置文件需要我们来配置,这里贴上我的配置文件,具体的配置文件中的节点说明可以看官方docs。
<CRMSetup>
<Server>
<Patch update="false"></Patch>
<LicenseKey>X7CN4-xxxx-xxxx-xxxxx-JHWRF</LicenseKey>
<SqlServer>D365-Test</SqlServer>
<Database create="true"/>
<Reporting URL="http://D365-Test/ReportServer"/>
<OrganizationCollation>Latin1_General_CI_AI</OrganizationCollation>
<basecurrency isocurrencycode="USD" currencyname="US Dollar" currencysymbol="$" currencyprecision="2"/>
<Organization>Test</Organization>
<OrganizationUniqueName>Test</OrganizationUniqueName>
<Groups AutoGroupManagementOff="false">
<PrivUserGroup>CN=PrivUserGroup,OU=CRM-TEST,DC=crm,DC=com</PrivUserGroup>
<SQLAccessGroup>CN=SQLAccessGroup,OU=CRM-TEST,DC=CRM,DC=com</SQLAccessGroup>
<ReportingGroup>CN=ReportingGroup,OU=CRM-TEST,DC=CRM,DC=com</ReportingGroup>
<PrivReportingGroup>CN=PrivReportingGroup,OU= CRM-TEST,DC=CRM,DC=com</PrivReportingGroup>
</Groups>
<WebsiteUrl create="true" port="5555"> </WebsiteUrl>
<InstallDir>c:\Program Files\Microsoft Dynamics CRM</InstallDir>
<CrmServiceAccount type="DomainUser">
<ServiceAccountLogin>crm\crmadmin</ServiceAccountLogin>
<ServiceAccountPassword>xxxxxx</ServiceAccountPassword>
</CrmServiceAccount>
<SandboxServiceAccount type="DomainUser">
<ServiceAccountLogin>crm\crmadmin</ServiceAccountLogin>
<ServiceAccountPassword>xxxxxx</ServiceAccountPassword>
</SandboxServiceAccount>
<DeploymentServiceAccount type="DomainUser">
<ServiceAccountLogin>crm\crmadmin</ServiceAccountLogin>
<ServiceAccountPassword>xxxxxx</ServiceAccountPassword>
</DeploymentServiceAccount>
<AsyncServiceAccount type="DomainUser">
<ServiceAccountLogin>crm\crmadmin</ServiceAccountLogin>
<ServiceAccountPassword>xxxxx</ServiceAccountPassword>
</AsyncServiceAccount>
<MonitoringServiceAccount type="DomainUser">
<ServiceAccountLogin>crm\crmadmin</ServiceAccountLogin>
<ServiceAccountPassword>xxxxx</ServiceAccountPassword>
</MonitoringServiceAccount>
<VSSWriterServiceAccount type="DomainUser">
<ServiceAccountLogin>crm\crmadmin</ServiceAccountLogin>
<ServiceAccountPassword>xxxxxx</ServiceAccountPassword>
</VSSWriterServiceAccount>
<SQM optin="false"/>
<muoptin option="false"/>
<Email>
</Email>
</Server>
</CRMSetup>
其实看了我的示例配置文件中的节点你也能看明白,这些配置都是我们在安装的过程中手工配置指定的,这里只是提前配置好了而已。
关于config配置文件中的Group路径有一个注意的地方,如果你的OU存在嵌套,那你要把你Group所在的OU开始往上直到最顶级的OU都列出来,比如下图中的路径应该是CN=PrivUserGroup,OU=DEV,OU=GC-CRM,OU=AW-CN-NORTH,OU=AW,OU=SERVERS,DC=crm,DC=com,我因为只列了最底层的这个DEV的OU导致安装一直报Group不存在。
我是在写代码尝试用Group名字去找组时才发现的这个问题
用管理员身份运行command后,可以看下进程管理器,起了一个CRM的安装进程
当安装过程中出现错误,会弹出安装失败的窗口,可以点开日志看下出了什么错,纠正它然后再一次运行命令行
如果不报错了,正确开始正常安装了则会弹出以下界面,就表示没问题了。