web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2013 SDK Powershell Get-CrmConnection - PermissionDenied

(0) ShareShare
ReportReport
Posted on by

Hi,

I am using CRM Online and trying to import package using powershell. During connection i am getting permission denied error.  

Below are error details

Get-CrmConnection : Failed to connect to CRM: The remote server returned an error: (504) Gateway Timeout.
At C:\Builds\2\CIBlank\CIBlank_1\src\xRMCIFramework_6.1.0.0\PowerShell\ConnectionValidate.ps1:50 char:30
+ "Office365" { $CRMConn = Get-CrmConnection -Credential $Cred -DeploymentRegi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Get-CrmConnection], Exception
+ FullyQualifiedErrorId : -3,Microsoft.Xrm.Tooling.CrmConnector.Powershell.Commands.GetCrmConnectionCommand

Any help greatly appreciated.

*This post is locked for comments

I have the same question (0)
  • Bas van de Sande Profile Picture
    4,383 on at

    Hi there,

    did you verify if your credentials were entered correctly?  

    You can do this by typing $Cred on the powershell commandline.

    Does the user that tou use have permissions to import and deploy packages?

    Bas

  • Community Member Profile Picture
    on at

    Hi,

    Thanks for the reply,

    Yes, I have verified the credentials which are correct and also the user having administrator privileges.

    below is the code I am using

    $Cred = New-Object System.Management.Automation.PSCredential ($Username, $SecPassword)

    $CRMConn = Get-CrmConnection -Credential $Cred -DeploymentRegion $DeploymentRegion –OnlineType $OnlineType –OrganizationName $OrganizationName

    -Sayta

  • Community Member Profile Picture
    on at

    Also my authentication type is Office365

  • Bas van de Sande Profile Picture
    4,383 on at

    Hi Satya,

    stupid question: in the credentials you entered the email address (blabla@bla.onmicrosoft.com) as user name?

    Bas

  • Community Member Profile Picture
    on at

    Yes , with masked information something like below

    -AuthenticationType "Office365" -Username "XXXXXX@XXXXXX.onmicrosoft.com" -Password "XXXXXX" -ServerUrl "https://ssatyavarapu.crm5.dynamics.com" -OrganizationName "Prolifics" -DeploymentRegion "NorthAmerica" -OnlineType "Office365"

  • Suggested answer
    Bas van de Sande Profile Picture
    4,383 on at

    Hi Satya,

    the connection should be set up as follows:

    $CRMConn = Get-CrmConnection -Credential $Cred -DeploymentRegion <Deployment

    region name> –OnlineType Office365 –OrganizationName <OrgName>

    You need to remove the -ServerUrl from the command

    Bas

  • Community Member Profile Picture
    on at

    Hi Bas,

    Yes, I am not using the Parameter while establishing connection, below is my code.

    $CRMConn = Get-CrmConnection -Credential $Cred -DeploymentRegion $DeploymentRegion –OnlineType $OnlineType –OrganizationName $OrganizationName

    -Satya

  • Verified answer
    Community Member Profile Picture
    on at

    This issue is solved, issue with Internal Proxy. 

    I have used LoginControlTester.exe to debug the issue.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans