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)

Get-CrmConnection Problem PowerShell Script - Installation Microsoft Portals in CRM 9

(0) ShareShare
ReportReport
Posted on by 65

Hi Guys,

have some one tried to execute the "Get-CrmConnection" powershell command with D365 CRM 9.0 ? I was trying to install Microsoft Portals but is going to crash. I've tried a simpler script ( see below ) :

Add-PSSnapin Microsoft.Xrm.Tooling.Connector
Add-PSSnapin Microsoft.Xrm.Tooling.PackageDeployment

$cred = Get-Credential

Get-CrmConnection -OrganizationName 'orgXXXXXX' -OnLineType Office365 -Credential $cred -DeploymentRegion EMEA

 

but I'm getting these exceptions :

Get-CrmConnection : More then one org was returned, retry with an exact org name

LastCrmError : Unable to Login to Dynamics CRMOrganizationWebProxyClient is nullOrganizationWebProxyClient is null


Is right that I've two different organizations for my user but in the script we pass the organization Name. I guess is a problem with the version 9 because I did the installation of Microsoft portals without any problem in CRM 8.2. ( with user with more than one organization )

Has someone some suggestion ?

Thank you very much for your help :)

*This post is locked for comments

I have the same question (0)
  • mvilas02 Profile Picture
    356 on at

    Hi ,

    I have tried like following and it works

    Write-Host "Established connection to source CRM instance";

    # PRODUCTION is source environment

    $connSource = Connect-CrmOnline -Credential $credential -ServerUrl server.crm4.dynamics.com;

    Let me know if it works for you

    Regards,

    Vilas Magar

  • Alduzzen1985 Profile Picture
    65 on at

    Hi Vilas,

    I'm sorry but I haven't had any success.... Powershell use also the last .NET Framework version but I can't connect to CRM v9.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hiya

    Not sure if you are still experiencing the issue, but we had something similar following an upgrade to one of our instances where we were getting 'More then one org was returned, retry with an exact org name'.

    The unique name of the organisation looked like it had been updated and was suffixed with 'new' e.g. orgnamenew. Go to Settings > Customisations > Developer resources and check where it says 'Instance Reference Information'.

    Everything resolves via the existing orgname in the url (without the 'new') so it was only trying to connect via this powershell script that failed.

    After we'd added the new orgname in powershell it connected fine and we deployed the portal packages successfully.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi ,

    You can use this program code for non interactive users for CRM 365 version 9:

    1. Apply this

    [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12

    2. Connect using Get-CrmConnection

        $conn = Get-CrmConnection  -OrganizationName $organizationName -DeploymentRegion CAN –OnlineType Office365  -Credential $Cred  

    Thanks , Mikhail

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