tlktechidentitythoughts

Identity Management Thoughts from the field

Skip to content
  • Home
  • About
Search

Month: April 2017

Dynamics CRM: Adding custom attributes to Entities and access them from PowerShell

April 15, 2017June 14, 2019 / Ike Ugochuku / 1 Comment

I want to add a couple of new custom attributes to the Account and Contact entities. I want the attributes to start with a prefix of “tlk”. I also want to be able to access these attributes from PowerShell.

Add “tlk” prefix to the attributes

OOB, Dynamics will a prefix of “new” to any custom attribute. In other to specify your own prefix, do this

1. Create a new Publisher:

a. Navigate to Settings > Customizations, and select Publishers from the list.

b. Click the New button.

c. Provide a display name [TLKPublisher], and specify the prefix [tlk] you would like to use. Note that the Option Value Prefix number will be generated automatically.

d. Click Save and Close.

2. Create a new Solution:

a. Navigate to Settings > Solutions, and click the New button.

b. Provide values for Display Name [TLKPublisher] and Version [1].

c. In the Publisher lookup field, select the publisher you created in step 1 above.

d. Click Save and Close.

3. Add the entities to the solution that you want to add custom attributes to using the new prefix:

a. Open the solution from step 2, and click the Add Existing button.

b. Select the entities [Account and Contact] you would like to include, and click OK.

c. Expand Entities, expand the entity you want to modify, and click Fields.

d. Click New. You will notice here that your new prefix is now being used.

e. Create your custom fields and click Save and Close.

f. Click Save and Close to save the Solution. Note that you may need to click the Information tab in the upper-left corner so the Save and Close button becomes visible.

4. Publish customizations by going to Settings > Solutions, and click Publish All Customizations.

Generate updated metadata – Early bound classes

  1. Download the latest CRM SDK. Best to get the latest version via NuGet. After you get it copy the Coretools folder from the NuGet package.
  2. Open a command prompt, cd to the location of the Coretools directory.

  1. Select
  • A location to store the generated file.
  • A file name [TLK.XRM.cs]
  • CRM Soap Webservice url
  • CRM SysAdmin account and Password
  1. Run the following command. There are some changes in ver 8 and above, one is that the crm org name should be before the “/XRMServices” two, you specify the domain name , three for username use the UPN. I have these items in bold

CrmSvcUtil.exe /url:http://MyCRMServerName:5555/TLKCRM/XRMServices/2011/Organization.svc /out:C:\Users\tlkfimportalserv\Documents\MyOrg\TLK.XRM.cs /domain:tlkenterprise /username:”mycrmadmin1@tlkenterprise.net” /password:”MyPassword”  /serviceContextName:DynamicProxyContext

Compile a DLL of the cs file

  1. Open new class library project in Visual Studio. Name it TLK.XRM
  2. Include the TLK.XRM.cs in the solution. Remove the default cs.
  3. Add reference to System.Runtime and Microsoft.Xrm.Sdk.dll
  4. Compile to form TLK.XRM.dll

Add generated metadata to PowerShell

  1. Copy the TLK.XRM.dll to suitable location.
  2. Add the reference at the top of the PowerShell file

Add-Type -Path “C:\dynamics\TLK.XRM.dll”

Posts navigation

← Older posts

Recent Posts

  • Azure Logic Apps: Workday app post provision and deprovision AD tasks via PowerShell
  • Update secrets with Delinea/Thycotic api
  • Identity Administration: AD Identity operations and the link to the Identity cube
  • MIM 2016: Graph MA does not create external guest account
  • MIM 2016: MIMService DB has grown exponentially to a large size

Recent Comments

Ike Ugochuku on MIM 2016: Using the Joine…
Josh U on MIM 2016: Using the Joine…
mara on FIM 2010 Portal: Introduction…
Ike Ugochuku on Removing MIM/FIM Service after…
Abbas on Removing MIM/FIM Service after…

Archives

  • September 2022
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • March 2021
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015

Categories

  • active directory
  • AD Connect
  • azure
  • bulk
  • c#
  • client
  • connector
  • Delinea
  • dirsync
  • Dynamics
  • ecma2
  • exchange
  • fim 2010 r2
  • FIM Portal
  • FIM WAL
  • Galsync
  • Governance
  • Graph api
  • held
  • IDAM
  • IoT
  • Machine Learning
  • MFA
  • mim 2016
  • MIM WAL
  • PowerApps
  • PowerShell
  • privilege
  • RBAC
  • SailPoint
  • SalesForce
  • SAP
  • smtp
  • Speech
  • sql
  • Uncategorized
  • update
  • VPN
  • webservice
  • workflow

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com

Recent Posts

  • Azure Logic Apps: Workday app post provision and deprovision AD tasks via PowerShell
  • Update secrets with Delinea/Thycotic api
  • Identity Administration: AD Identity operations and the link to the Identity cube
  • MIM 2016: Graph MA does not create external guest account
  • MIM 2016: MIMService DB has grown exponentially to a large size

Recent Comments

Ike Ugochuku on MIM 2016: Using the Joine…
Josh U on MIM 2016: Using the Joine…
mara on FIM 2010 Portal: Introduction…
Ike Ugochuku on Removing MIM/FIM Service after…
Abbas on Removing MIM/FIM Service after…

Archives

  • September 2022
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • March 2021
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015

Categories

  • active directory
  • AD Connect
  • azure
  • bulk
  • c#
  • client
  • connector
  • Delinea
  • dirsync
  • Dynamics
  • ecma2
  • exchange
  • fim 2010 r2
  • FIM Portal
  • FIM WAL
  • Galsync
  • Governance
  • Graph api
  • held
  • IDAM
  • IoT
  • Machine Learning
  • MFA
  • mim 2016
  • MIM WAL
  • PowerApps
  • PowerShell
  • privilege
  • RBAC
  • SailPoint
  • SalesForce
  • SAP
  • smtp
  • Speech
  • sql
  • Uncategorized
  • update
  • VPN
  • webservice
  • workflow

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com
Blog at WordPress.com.
  • Follow Following
    • tlktechidentitythoughts
    • Join 25 other followers
    • Already have a WordPress.com account? Log in now.
    • tlktechidentitythoughts
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...