[英]Connect with Powershell to Dynamics CRM online with application user
[英]How to connect PowerShell with CRM online?
我正在编写一个 PowerShell 脚本,它需要在线连接到 CRM。
我可以使用Connect-CrmOnline
连接到 CRM,它使用登录框要求提供凭据。 我想自动化它。 请指导如何做。
有没有办法使用连接字符串进行连接? 请分享示例代码/脚本。 我是 PowerShell 的新手。
我正在使用Microsoft.Xrm.Data.PowerShell
谢谢你。
您可以构建凭证对象并在脚本中使用它。 例如:
$secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("username", $secpasswd)
然后,您可以在脚本中使用-credential $mycreds
参数使用它
参考: https : //blogs.msdn.microsoft.com/koteshb/2010/02/12/powershell-how-to-create-a-pscredential-object/和https://docs.microsoft.com/en-us /dynamics365/customer-engagement/developer/xrm-tooling/use-powershell-cmdlets-xrm-tooling-connect
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.