Partager via


Get-CrmOrganizationUserMap

Retrieves users from the specified organization and outputs an XML file that can be used to map users as part of an organization import.

Syntax

Get-CrmOrganizationUserMap
   [-SqlServerName] <String>
   [-DatabaseName] <String>
   [[-FileName] <String>]
   [-Timeout <Int32>]
   [-Diag]
   [-Credential <PSCredential>]
   [-DwsServerUrl <String>]
   [-WhatIf]
   [-Confirm]

Description

The Get-CrmOrganizationUserMap cmdlet retrieves the organization users and formats them into an XML file that can be used to map users to the target deployment. This cmdlet can produce the user map as an XML document or write the XML document to a file. This behavior is controlled by the -FileName parameter. If the parameter is present, it writes to the file specified; if it is not, it displays the XML on screen.

Examples

Example 1

PS C:\> Get-CrmOrganizationUserMap -DatabaseName contoso_MSCRM -SqlServerName sqlserver -FileName c:\import\users.xml

Creates a mapping file named users.xml of all users in the contoso_MSCRM organization database hosted on the SQL Server named sqlserver.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

Expects a variable that contains the user credentials used for signing in to Dynamics 365 on-premises organization. To establish this variable, run the PowerShell command $Cred = Get-Credential.

Type:PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DatabaseName

Specifies the name of the organization database to retrieve users from to build the mapping XML file.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Diag

Turns on stack traces for error reports returned from Dynamics 365 service calls. Enabling this emits a detailed error message, including a stack trace, when an error is encountered by the Dynamics 365 PowerShell command.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DwsServerUrl

The URL of the Deployment Web Service. This should be in the format: https://, for example, https://contoso.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-FileName

Specifies the file name that will be created when the user map completes. If the parameter is present, it will write to the file specified; if it is not, it will return the XML on screen.

Type:String
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SqlServerName

The name of the computer that’s running SQL Server that hosts the organization database used to retrieve users for building a mapping XML file.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Timeout

For internal user only.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

System.Int32 System.Management.Automation.SwitchParameter System.Management.Automation.PSCredential

Outputs

System.String

System.String