[英]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.