< Back

Invoke-CrmWhoAmI

Sat Jan 18, 2020 4:03 pm

NAME Invoke-CrmWhoAmI



SYNOPSIS

Executes WhoAmI Organization Request and returns current user's Id (guid), belonging BusinessUnit Id (guid) and

CRM Organization Id (guid).





SYNTAX

Invoke-CrmWhoAmI [[-conn] <CrmServiceClient>] [<CommonParameters>]





DESCRIPTION

The Invoke-CrmWhoAmI cmdlet lets you execute WhoAmI request and obtain UserId, BusinessUnitId and OrganizationId.





PARAMETERS

-conn <CrmServiceClient>

A connection to your CRM organization. Use $conn = Get-CrmConnection <Parameters> to generate it.



Required? false

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS









OUTPUTS









NOTES









-------------------------- Example 1 --------------------------



Invoke-CrmWhoAmI -conn $conn



This example executes WhoAmI organization request and returns current user's Id (guid), belonging BusinessUnit Id

(guid) and CRM Organization Id (guid).







UserId : 420a942a-7786-4843-9a8b-f8265d9f80ac

BusinessUnitId : 69e48894-f7d6-e511-80d3-c4346bb5987c

OrganizationId : 73354da0-d5a9-4221-bd11-64f988f234a6

ResponseName : WhoAmI

Results : {[UserId, 420a942a-7786-4843-9a8b-f8265d9f80ac], [BusinessUnitId,

69e48894-f7d6-e511-80d3-c4346bb5987c], [OrganizationId, 73354da0-d5a9-4221-bd11-64f988f234a6]}

ExtensionData : System.Runtime.Serialization.ExtensionDataObject



-------------------------- Example 2 --------------------------



Invoke-CrmWhoAmI



This example executes WhoAmI by omitting parameters names.

When omitting parameter names, you do not provide $conn, cmdlets automatically finds it.







UserId : 420a942a-7786-4843-9a8b-f8265d9f80ac

BusinessUnitId : 69e48894-f7d6-e511-80d3-c4346bb5987c

OrganizationId : 73354da0-d5a9-4221-bd11-64f988f234a6

ResponseName : WhoAmI

Results : {[UserId, 420a942a-7786-4843-9a8b-f8265d9f80ac], [BusinessUnitId,

69e48894-f7d6-e511-80d3-c4346bb5987c], [OrganizationId, 73354da0-d5a9-4221-bd11-64f988f234a6]}

ExtensionData : System.Runtime.Serialization.ExtensionDataObject





RELATED LINKS