public void Main2()
{
DeploymentServiceClient service = Microsoft.Xrm.Sdk.Deployment.Proxy
.ProxyClientHelper.CreateClient(new Uri("http://xxxxxxxxx:5555/XRMDeployment/2011/Deployment.svc"));
Console.WriteLine(CreateOrganization(service
, new Organization
{
UniqueName = "testOrgProv1",
FriendlyName = "testOrgProv1",
SqlServerName = "CRMDDC2",
SrsUrl = @"http://crmddc2/Reports",
BaseCurrencyCode = RegionInfo.CurrentRegion.ISOCurrencySymbol,
BaseCurrencyName = RegionInfo.CurrentRegion.CurrencyNativeName,
BaseCurrencySymbol = RegionInfo.CurrentRegion.CurrencySymbol,
State = Microsoft.Xrm.Sdk.Deployment.OrganizationState.Enabled
}));
}
Guid? CreateOrganization(IDeploymentService deploymentService
, Organization org)
{
BeginCreateOrganizationRequest req = new BeginCreateOrganizationRequest
{
Organization = org
};
BeginCreateOrganizationResponse resp = deploymentService.Execute(req) as BeginCreateOrganizationResponse;
return resp != null ? (Guid?)resp.OperationId : null;
}
但我得到的错误是
“部署服务无法处理请求,因为一项或多项验证检查失败。”
我使用的是本地管理员帐户,它也是部署管理员,
ps:当我以不同的方式使用类似的代码时,弹出相同的错误,但内部消息是
“当前 Active Directory 用户对报告组没有读写权限......”