A可以使用ProvisioningWebService Service(https://provisioningapi.microsoftonline.com/ProvisioningWebService.svc)中的ProvisioningWebService.IProvisioningWebService。 我添加到我的项目wsdl。在web.config中生成:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="External">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://provisioningapi.microsoftonline.com/ProvisioningWebService.svc"
binding="wsHttpBinding" bindingConfiguration="External" contract="ProvisioningWebService.IProvisioningWebService"
name="External">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
获取客户:
var provisioningWebServiceService = new ProvisioningWebServiceClient("External");
如何将 UserIdentityHeader , LiveToken 和 BecContext 添加到客户端? 来自powershell的请求很好。请求来自c#bad。我有错误&#34;此错误的创建者未指定原因。&#34;