Partager via


Get-CrmOrganizations

Applies To: CRM 2016 on-prem, Dynamics 365 (online), Dynamics 365 (on-premises)

Get-CrmOrganizations

Returns a list of Microsoft Dynamics 365 organizations that the current user has access to.

Syntax

Parameter Set: OnLine
Get-CrmOrganizations [[-Credential] <PSCredential> ] [-DeploymentRegion] <String> -OnLineType <CommonAuth+OnlineType> {Office365} [-LogWriteDirectory <String> ] [-MaxCrmConnectionTimeOutMinutes <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: OnPrem
Get-CrmOrganizations [-ServerUrl] <Uri> [[-Credential] <PSCredential> ] [[-HomeRealmUrl] <Uri> ] [-LogWriteDirectory <String> ] [-MaxCrmConnectionTimeOutMinutes <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Get-CrmOrganizations cmdlet returns a list of Dynamics 365 organizations that the current user has access to.

This cmdlet applies to Microsoft Dynamics 365 (online) and Microsoft Dynamics 365 (on-premises).

Parameters

-ServerUrl<Uri>

URL of the Microsoft Dynamics 365 (on-premises) server specified in the format http://<server>:<port>.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true(ByValue,ByPropertyName)

Accept Wildcard Characters?

false

-Credential<PSCredential>

User credential for signing in to Microsoft Dynamics 365.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-DeploymentRegion<String>

Geographic region of your Microsoft Dynamics 365 online deployment. Valid values are NorthAmerica, EMEA, APAC, SouthAmerica, Oceania, JPN, CAN, IND, and NorthAmerica2.

Aliases

none

Required?

true

Position?

5

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-HomeRealmUrl<Uri>

URI of the WS-Trust metadata endpoint.

Aliases

none

Required?

false

Position?

4

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-LogWriteDirectory<String>

Custom directory location to store the Xrm.Tooling.Connector log files. The directory must already exist, and the user who is running the cmdlet must have Write permission to the directory. You must also use the -Verbose parameter along with the -LogWriteDirectory parameter to be able to store the log files in a custom location

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-MaxCrmConnectionTimeOutMinutes<Int32>

Maximum time in minutes that Xrm.Tooling.Connector will wait for any given Dynamics 365 SDK command to complete.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByValue,ByPropertyName)

Accept Wildcard Characters?

false

-OnLineType<CommonAuth+OnlineType>

Type of online deployment. Valid value is Office365.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Xrm.Sdk.Discovery.OrganizationDetailCollection

    Returns an initialized array of Dynamics 365 organizations.

Examples

-------------------------- EXAMPLE 1 --------------------------

This example shows how to retrieve the organizations from an on-premises instance of Dynamics 365. On successful connection to Dynamics 365, the cmdlet returns an initialized list of Microsoft.Xrm.Tooling.Connector.CrmOrganizationInfo objects.

C:\PS>Get-CrmOrganizations –ServerUrl http:// mycrmserver –Credential $Cred

-------------------------- EXAMPLE 2 --------------------------

This example shows how to retrieve the organizations from an online instance of Dynamics 365. On successful connection to Dynamics 365, the cmdlet returns an initialized list of Microsoft.Xrm.Tooling.Connector.CrmOrganizationInfo objects

C:\PS>Get-CrmOrganizations -DeploymentRegion NorthAmerica -OnLineType Office365 -Credential $Cred 

Get-CrmConnection

Use PowerShell cmdlets for XRM tooling to connect to CRM