<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Christian's MDM Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/christians_mdm_blog/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/christians_mdm_blog/feed.xml</link>
    <description>Blog about Microsoft Dynamics Marketing topics like: SDK, OData, Analytics, CRM Connector, and other cool stuff.</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:39:46 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>PowerBI ships out of the box analytics for Microsoft Dynamics Marketing</title>
      <link>https://docs.microsoft.com/archive/blogs/christians_mdm_blog/powerbi-ships-out-of-the-box-analytics-for-microsoft-dynamics-marketing</link>
      <pubDate>Thu, 23 Apr 2015 11:51:00 GMT</pubDate>
      <dc:creator><![CDATA[cabeln]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christians_mdm_blog/2015/04/23/powerbi-ships-out-of-the-box-analytics-for-microsoft-dynamics-marketing/</guid>
      <description><![CDATA[Today, we&rsquo;re very excited to share with you a fantastic new analytic capability that we are...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: medium;">Today, we&rsquo;re very excited to share with you a fantastic new analytic capability that we are adding to the <a href="https://www.powerbi.com/?WT.mc_id=Blog_Dyn_Mktg">Power BI</a> product that targets specifically the Role of a Demand Generation Manager with <a href="https://www.microsoft.com/en-us/dynamics/crm-marketing.aspx" target="_blank">Microsoft Dynamics Marketing</a>.</span></p>
<p><span style="font-size: large;"><a href="https://blogs.msdn.com/b/powerbi/archive/2015/04/23/monitor-and-explore-your-microsoft-dynamics-marketing-data-with-power-bi.aspx">Please find the full announcement and all the details here</a></span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/60/20/2620.01.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-60-20/2620.01.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/60/20/2620.01.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-60-20/2620.01.png" alt="" border="0" /></a></p>
<p>This content pack&nbsp;comes with a template Dashboard, a rich set of reports and a data model that allows you to build further reports and customize your dashboard.</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/60/20/0172.03.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-60-20/0172.03.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/60/20/0172.03.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-60-20/0172.03.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">Enjoy!</span></p>
<p><span style="font-size: small;"><em>Christian Abeln</em>&nbsp;&nbsp;&nbsp;&nbsp; <br />Senior </span>Program Manager&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />Microsoft Dynamics Marketing</p>
<p><span style="font-size: small;">Follow <a href="https://curah.microsoft.com/79665/microsoft-dynamics-marketing">My Curah!s on Microsoft Dynamics Marketing</a></span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Using PowerShell to script Dynamics Marketing</title>
      <link>https://docs.microsoft.com/archive/blogs/christians_mdm_blog/using-powershell-to-script-dynamics-marketing</link>
      <pubDate>Mon, 20 Apr 2015 14:46:00 GMT</pubDate>
      <dc:creator><![CDATA[cabeln]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christians_mdm_blog/2015/04/20/using-powershell-to-script-dynamics-marketing/</guid>
      <description><![CDATA[Dynamics Marketing is a great tool to capture, score and nurture leads in automated campaigns. You...]]></description>
      <content:encoded><![CDATA[<p><font size="2"></font></p>  <p><font size="2">Dynamics Marketing is a great tool to capture, score and nurture leads in automated campaigns. You can build your campaigns and lead management processes which automatically invite your audience, capture registrations, send welcome emails register for your marketing events and trigger post event communication e.g. based on specific record of attendance.</font></p>  <p><font size="2">While most of marketing processes are automated in Dynamics Marketing, often a lot of what is going on at an event is also in different systems or in real world – like the system that records attendees at an in person event when they enter the session room. </font></p>  <p><font size="2">In such situations you have a simple goal: Log a record of attendance in Dynamics Marketing such that lead scoring and nurturing processes can pick up this information for example through Lead Interactions and leads that get created automatically. And because Dynamics Marketing offers API and OData endpoints, this sounds to be very feasible – doesn’t it?</font></p>  <h1>Some background</h1>  <p><font size="2">With the SDK for Dynamics Marketing sample code ships that shows how to write an application that communicated through a Windows Azure Service Bus queues with the API endpoint of an Dynamics Marketing instance. The methods available on this endpoint focus creation and update of Contacts, Companies and Leads; also managing lists, sending transactional email marketing messages creation of event registrations and records of attendance and more.</font></p>  <p><font size="2">A good way to learn about the capabilities of the API Endpoints is simply looking into the assembly from the SDK directly and exploring the available methods and messages:</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/2043.image_2CE0D06D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/2043.image_5F00_2CE0D06D.png"><font size="2"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/3301.image_thumb_53B1775E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/3301.image_5F00_thumb_5F00_53B1775E.png" width="320" height="212" /></font></a><font size="2">&#160;</font><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/4035.image_330AF2B8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/4035.image_5F00_330AF2B8.png"><font size="2"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/3005.image_thumb_16FCC47E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/3005.image_5F00_thumb_5F00_16FCC47E.png" width="244" height="212" /></font></a></p>  <p><font size="2"></font></p>  <p><font size="2"></font></p>  <p><font size="2">If you are looking for a simple step by step guide on building an SDK client with Visual Studio you can download this document. It explains step by step how to build a simple application that communicates through the Service Bus queues.</font></p>  <p><font size="2">The OData endpoint has a rich documentation of all tables and fields here. And if you want to see how you can write an application that makes use of the OData endpoint as coded client application you can review one of my past blog posts here.</font></p>  <p><font size="2">But for various smaller operations and feasibility prototypes or if you want to design a business flow then instead of developing an application a scripting approach might simply be easier for you.</font> And if<font size="2"> you are not a developer who likes to mangle with authentication code or data querying and parsing in code, then this is another reason to look into scripting options.</font></p>  <p><font size="2">First Step: <a href="https://friendlydude.github.io/Dynamics-Marketing-PowerShell/" target="_blank">Install the PowerShell cmdlets from here</a>. There are version available for both 32- and 64-bit PowerShell.</font></p>  <h1><font size="5">Scripting the SDK endpoint</font></h1>  <p><font size="2">After you have installed the power shell cmdlets on your machine you can connect with PowerShell to the SDK endpoint with this:</font></p>  <div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:749fa502-5a86-4180-b94f-84c9b594cb11" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style="background-color:#E6E6E6;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"><span style="color: #000000;">Add</span><span style="color: #000000;">-</span><span style="color: #000000;">PSSnapIn Microsoft.Dynamics.Marketing.API
</span><span style="color: #800080;">$SecureString</span><span style="color: #000000;">=</span><span style="color: #000000;">ConvertTo</span><span style="color: #000000;">-</span><span style="color: #000000;">SecureString </span><span style="color: #800000;">"</span><span style="color: #800000;">QUEUE ACCESS KEY GOES HERE =</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">asplaintext </span><span style="color: #000000;">-</span><span style="color: #000000;">force
Connect</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMApi MyServiceBus101 owner </span><span style="color: #800080;">$securestring</span><span style="color: #000000;"> sdkRequest sdkResponse </span><span style="color: #000000;">-</span><span style="color: #000000;">verbose
</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

<p><font size="2">You need to configure the SDK endpoint before: </font><a href="https://msdn.microsoft.com/en-us/library/dn659820(v=crm.6).aspx" target="_blank"><font size="2">Configure Dynamics Marketing to communicate through queues</font></a><font size="2">. This involves <a href="https://msdn.microsoft.com/en-us/library/jj863635.aspx" target="_blank">creating an ACS enabled Azure ServiceBus namespace</a> also using PowerShell commands. You only need to create the service bus and then leave it to the SDK configuration in the integration settings page to configure the service bus and ACS. After that only one little piece is missing: In the ACS portal we need to add a credential of type <em>symmetric key</em> for the service identity that has been created for us. The key we define here is the secret that will allow your PowerShell command let to authorize sending commands to the service bus and receive responses. The key if referred below as the <em>IssuerKey</em>. </font></p>

<p><font size="2">With that in place you are ready to use one of the commands from the cmdlet. Type <strong>Get-Command -Module:Microsoft.Dynamics.Marketing.API</strong> to get a list of all commands contained. Use the command Get-Help to learn about the command parameters.. For example <strong>Get-Help -Name:Get-MDMLeads</strong></font></p>

<table cellspacing="0" cellpadding="2" width="516" border="0"><tbody>
    <tr>
      <td valign="top" width="233"><font size="2">Connect-MDMApi&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Disconnect-MDMApi </font></td>

      <td valign="top" width="281"><font size="2">Send-MDMApiRequest&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMApiResponse&#160;&#160;&#160; <br /></font></td>
    </tr>

    <tr>
      <td valign="top" width="233"><font size="2">Add-MDMCompany&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Add-MDMContact&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Add-MDMContacts&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Add-MDMContactToList&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Add-MDMCustomFieldCategories&#160;&#160;&#160;&#160; <br />Add-MDMEventAttendance&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Add-MDMEventRegistration&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Add-MDMExternalEntity&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Add-MDMLead&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Add-MDMList&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Add-MDMMarketingResult&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />

          <br />Copy-MDMListContacts&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></td>

      <td valign="top" width="281"><font size="2">Get-MDMAllLists&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMCompanies&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMCompany&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMContact&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMContactPermissions&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMContacts&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMCurrencies&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMCustomFields&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMEmailMessages&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMEmailMessageSentStatus&#160;&#160;&#160; <br />Get-MDMEventAttendance&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMEventAttendanceStatuses&#160;&#160; <br />Get-MDMEventRegistration&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMExternalEntiity&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMExternalEntity&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMExternalIds&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMHardbounces&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMLanguages&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMLead&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMLeadPriorities&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMLeads&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMLeadStatuses&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMList&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMMarketingResult&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMMarketingResults&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMMarketingResultTypes&#160;&#160;&#160;&#160;&#160; <br />Get-MDMMissingContactPermissions 

          <br />Get-MDMSalesRatings&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMSalutations&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Get-MDMSchemaForEmailMessage&#160;&#160;&#160;&#160; <br />Get-MDMTerritories&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></td>
    </tr>

    <tr>
      <td valign="top" width="233"><font size="2">Send-MDMEmailMessages&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />

          <br />Set-MDMContactPermissions&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Set-MDMContactsPermissions&#160;&#160;&#160;&#160;&#160;&#160; <br />Set-MDMHardbouncesProcessed&#160; </font></td>

      <td valign="top" width="281"><font size="2">Remove-MDMAllContactsFromList&#160;&#160;&#160; <br />Remove-MDMCompany&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Remove-MDMContact&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Remove-MDMContactFromList&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Remove-MDMEventAttendance&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Remove-MDMEventRegistration&#160;&#160;&#160;&#160;&#160; <br />Remove-MDMExternalEntity&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Remove-MDMExternalEntityType&#160;&#160;&#160;&#160; <br />Remove-MDMLead&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Remove-MDMList&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />Remove-MDMMarketingResult&#160;&#160;&#160; </font></td>
    </tr>
  </tbody></table>

<h2><font size="2"></font></h2>

<h2><font size="2">The first command we use is&#160; to connect to the API endpoint:</font></h2>

<p><font size="3"><strong>Connect-MDMApi</strong> [[-Namespace] &lt;string&gt;] [[-IssuerName] &lt;string&gt;] [[-IssuerKey] &lt;securestring&gt;] 

    <br /></font><font size="3">[[-RequestQueueName] &lt;string&gt;] [[-ResponseQueueName] &lt;string&gt;] [[-SessionId] &lt;string&gt;]&#160; [&lt;CommonParameters&gt;]</font></p>

<p><font size="2">A fully qualified connection command has the syntax like:</font></p>

<div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:bebcea4b-3942-47bb-926e-96565bd6e713" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style="background-color:#E6E6E6;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"><span style="color: #000000;">Connect</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMApi </span><span style="color: #000000;">-</span><span style="color: #000000;">Namespace:</span><span style="color: #800000;">"</span><span style="color: #800000;">MyMDMserviceBus</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">IssuerName:</span><span style="color: #800000;">"</span><span style="color: #800000;">MDMServiceIdentity</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">IssuerKey:</span><span style="color: #800080;">$SecureString</span><span style="color: #000000;">
</span><span style="color: #000000;">-</span><span style="color: #000000;">RequestQueueName:</span><span style="color: #800000;">"</span><span style="color: #800000;">sdkRequest</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">ResponseQueueName:</span><span style="color: #800000;">"</span><span style="color: #800000;">sdkResponse</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">VERBOSE</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

<p><font size="2">Please note that the -IssuerKey (the 256bit symmetric key) must be maintained in a secure string object of PowerShell scripting – meaning it will be encrypted and cannot be used &amp; decrypted by anything than the user who has created the secure string – you.</font></p>

<h2><font size="3">Lets try few Hello World type of samples</font></h2>

<p><font size="2">1. Reading all Leads that have been updated in the last days and simply out put the leads.</font></p>

<p><font size="3"><strong>Get-MDMLeads</strong> [-BelongsToCompanyId &lt;guid&gt;] [-FromUpdateDate &lt;datetime&gt;] [-MaxNumberOfRecordsToGet &lt;int&gt;] 

    <br />[-OriginOfChange &lt;string&gt;] [-MaxResponseWaitTime &lt;int&gt;]&#160; [&lt;CommonParameters&gt;]</font></p>

<div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:e457abe0-0bea-4ddd-a98b-54bc9b427c88" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style="background-color:#E6E6E6;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;;font-family:Microsoft Sans Serif;font-size:14.25"><span style="color: #800080;">$date</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> [System.DateTime]</span><span style="color: #000000;">::</span><span style="color: #000000;">Now.AddDays(</span><span style="color: #000000;">-</span><span style="color: #000000;">4</span><span style="color: #000000;">).ToUniversalTime()
</span><span style="color: #800080;">$leads</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Get</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMLeads </span><span style="color: #000000;">-</span><span style="color: #000000;">FromUpdateDate:</span><span style="color: #800080;">$date</span><span style="color: #000000;">
</span><span style="color: #800080;">$leads</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

<p><font size="2">2. Adding a new marketing contact with parent marketing company under the assumption that we know the Id of the site company 
    <br />(We assume knowledge of the External Id of the Site company. We will see later how to find the site company.)</font></p>

<p><font size="3"><strong>Get-MDMCompany</strong> [[-CompanyId] &lt;guid&gt;] [-MaxResponseWaitTime &lt;int&gt;] </font></p>

<p><font size="3"><strong>Add-MDMContact</strong> [[-Contact] &lt;Contact&gt;] [-DisableConcurrentRequestValidation &lt;bool&gt;] [-MaxResponseWaitTime &lt;int&gt;]</font></p>

<div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:e295ac2e-10ae-4419-9720-c65714d6fb16" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style="background-color:#E6E6E6;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"><span style="color: #800080;">$SiteCompanyID</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">eddfce37-e3d9-4910-b0c4-f6979777dd07</span><span style="color: #800000;">"</span><span style="color: #000000;">
</span><span style="color: #800080;">$belongsto</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> get</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMCompany </span><span style="color: #800080;">$SiteCompanyID</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">verbose

</span><span style="color: #800080;">$error</span><span style="color: #000000;">.Clear()
</span><span style="color: #800080;">$contact</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> new</span><span style="color: #000000;">-</span><span style="color: #000000;">object Microsoft.Dynamics.Marketing.SDK.Model.Contact
</span><span style="color: #800080;">$company</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> new</span><span style="color: #000000;">-</span><span style="color: #000000;">object Microsoft.Dynamics.Marketing.SDK.Model.Company
</span><span style="color: #800080;">$company</span><span style="color: #000000;">.Name </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">"</span><span style="color: #800000;">Coolest Company On Planet Earth</span><span style="color: #800000;">"</span><span style="color: #000000;">
</span><span style="color: #800080;">$company</span><span style="color: #000000;">.IsMarketing </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">$true</span><span style="color: #000000;">
</span><span style="color: #800080;">$contact</span><span style="color: #000000;">.BelongsToCompany </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$belongsto</span><span style="color: #000000;">
</span><span style="color: #800080;">$contact</span><span style="color: #000000;">.FirstName </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">"</span><span style="color: #800000;">A First Name1</span><span style="color: #800000;">"</span><span style="color: #000000;">
</span><span style="color: #800080;">$contact</span><span style="color: #000000;">.LastName </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">"</span><span style="color: #800000;">A Last Name1</span><span style="color: #800000;">"</span><span style="color: #000000;">
</span><span style="color: #800080;">$contact</span><span style="color: #000000;">.Company </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$company</span><span style="color: #000000;">
</span><span style="color: #800080;">$contact</span><span style="color: #000000;">.IsMarketing </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">$true</span><span style="color: #000000;">
</span><span style="color: #800080;">$newcontact</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMContact </span><span style="color: #800080;">$contact</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">verbose
</span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$error</span><span style="color: #000000;">.Count </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">)
{
    </span><span style="color: #800080;">$error</span><span style="color: #000000;">
}
</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

<p><font size="2">3. Let’s add a new lead to a know contact (like created above) and under a campaign and program. This sample shows also how to set fields like priority, status, sales rating, a custom origin of change, dates and even defines an initial score. The latter sill be overwritten as soon as lead get scored – if then a scoring model has been defined in the marketing context where the lead lands. 
    <br />(We assume knowledge of Campaign Id and Program Id. These are the External Id)</font></p>

<div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:7bcca0bf-07bf-4a58-a7e0-bc284c2dd1c6" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style="background-color:#E6E6E6;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;;font-family:Microsoft Sans Serif;font-size:14.25"><span style="color: #800080;">$sitecompany</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">eddfce37-e3d9-4910-b0c4-f6979777dd07</span><span style="color: #800000;">"</span><span style="color: #000000;">
</span><span style="color: #800080;">$programid</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">fba68e22-e822-4097-a40f-f244bb401736</span><span style="color: #800000;">"</span><span style="color: #000000;">
</span><span style="color: #800080;">$campaignid</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">fcac690f-af01-43c0-9c9b-fda3b5ca8a9c</span><span style="color: #800000;">"</span><span style="color: #000000;">
</span><span style="color: #800080;">$contactid</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">"</span><span style="color: #800000;">6346d0e5-ec1c-4931-b63b-2f24b8666c23</span><span style="color: #800000;">"</span><span style="color: #000000;">


</span><span style="color: #800080;">$program</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> new</span><span style="color: #000000;">-</span><span style="color: #000000;">object Microsoft.Dynamics.Marketing.SDK.Model.Program
</span><span style="color: #800080;">$program</span><span style="color: #000000;">.id </span><span style="color: #000000;">=</span><span style="color: #000000;"> new</span><span style="color: #000000;">-</span><span style="color: #000000;">object Guid(</span><span style="color: #800080;">$programid</span><span style="color: #000000;">) 
</span><span style="color: #800080;">$campaign</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> new</span><span style="color: #000000;">-</span><span style="color: #000000;">object Microsoft.Dynamics.Marketing.SDK.Model.Campaign
</span><span style="color: #800080;">$campaign</span><span style="color: #000000;">.id </span><span style="color: #000000;">=</span><span style="color: #000000;"> new</span><span style="color: #000000;">-</span><span style="color: #000000;">object Guid(</span><span style="color: #800080;">$campaignid</span><span style="color: #000000;">) 


</span><span style="color: #800080;">$lead</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> new</span><span style="color: #000000;">-</span><span style="color: #000000;">object Microsoft.Dynamics.Marketing.SDK.Model.Lead
</span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Name</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">SDK test Lead 123</span><span style="color: #800000;">"</span><span style="color: #000000;"> 

</span><span style="color: #800080;">$belongsto</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Get</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMCompany </span><span style="color: #800080;">$sitecompany</span><span style="color: #000000;">
</span><span style="color: #800080;">$lead</span><span style="color: #000000;">.BelongsToCompany </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$belongsto</span><span style="color: #000000;">

</span><span style="color: #800080;">$contact</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Get</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMContact </span><span style="color: #800080;">$contactid</span><span style="color: #000000;">
</span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Contact </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$contact</span><span style="color: #000000;">

</span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Date</span><span style="color: #000000;">=</span><span style="color: #000000;">[System.DateTime]</span><span style="color: #000000;">::</span><span style="color: #000000;">Now.ToUniversalTime()
</span><span style="color: #800080;">$lead</span><span style="color: #000000;">.DueDate</span><span style="color: #000000;">=</span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Date.AddMonths(</span><span style="color: #000000;">1</span><span style="color: #000000;">)

</span><span style="color: #800080;">$type</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> (</span><span style="color: #800000;">"</span><span style="color: #800000;">System.Collections.Generic.List</span><span style="color: #800000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">'`'</span><span style="color: #000000;">+</span><span style="color: #800000;">"</span><span style="color: #800000;">1</span><span style="color: #800000;">"</span><span style="color: #000000;">) </span><span style="color: #008080;">-as</span><span style="color: #000000;"> </span><span style="color: #800000;">"</span><span style="color: #800000;">Type</span><span style="color: #800000;">"</span><span style="color: #000000;">
</span><span style="color: #800080;">$type</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$type</span><span style="color: #000000;">.MakeGenericType(</span><span style="color: #800000;">"</span><span style="color: #800000;">system.string</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #008080;">-as</span><span style="color: #000000;"> </span><span style="color: #800000;">"</span><span style="color: #800000;">Type</span><span style="color: #800000;">"</span><span style="color: #000000;">)
</span><span style="color: #800080;">$origins</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> [Activator]</span><span style="color: #000000;">::</span><span style="color: #000000;">CreateInstance(</span><span style="color: #800080;">$type</span><span style="color: #000000;">)
</span><span style="color: #800080;">$origins</span><span style="color: #000000;">.Add(</span><span style="color: #800000;">"</span><span style="color: #800000;">Cool SDK</span><span style="color: #800000;">"</span><span style="color: #000000;">)
</span><span style="color: #800080;">$lead</span><span style="color: #000000;">.OriginOfChanges</span><span style="color: #000000;">=</span><span style="color: #800080;">$origins</span><span style="color: #000000;">

</span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Score</span><span style="color: #000000;">=</span><span style="color: #000000;">999</span><span style="color: #000000;">

</span><span style="color: #800080;">$priorities</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Get</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMLeadPriorities
</span><span style="color: #0000FF;">If</span><span style="color: #000000;"> ((</span><span style="color: #008080;">-not</span><span style="color: #000000;"> (</span><span style="color: #800080;">$priorities</span><span style="color: #000000;"> </span><span style="color: #008080;">-eq</span><span style="color: #000000;"> </span><span style="color: #800080;">$null</span><span style="color: #000000;">)) , (</span><span style="color: #800080;">$priorities</span><span style="color: #000000;">.Count </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">))
{
    </span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Priority</span><span style="color: #000000;">=</span><span style="color: #800080;">$priorities</span><span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]
}

</span><span style="color: #800080;">$statuses</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Get</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMLeadStatuses
</span><span style="color: #0000FF;">If</span><span style="color: #000000;"> ((</span><span style="color: #008080;">-not</span><span style="color: #000000;"> (</span><span style="color: #800080;">$statuses</span><span style="color: #000000;"> </span><span style="color: #008080;">-eq</span><span style="color: #000000;"> </span><span style="color: #800080;">$null</span><span style="color: #000000;">)) , (</span><span style="color: #800080;">$statuses</span><span style="color: #000000;">.Count </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">))
{
    </span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Status</span><span style="color: #000000;">=</span><span style="color: #800080;">$statuses</span><span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]
}

</span><span style="color: #800080;">$salesRatings</span><span style="color: #000000;">=</span><span style="color: #000000;">Get</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMSalesRatings
</span><span style="color: #0000FF;">If</span><span style="color: #000000;"> ((</span><span style="color: #008080;">-not</span><span style="color: #000000;"> (</span><span style="color: #800080;">$salesRatings</span><span style="color: #000000;"> </span><span style="color: #008080;">-eq</span><span style="color: #000000;"> </span><span style="color: #800080;">$null</span><span style="color: #000000;">)) , (</span><span style="color: #800080;">$salesRatings</span><span style="color: #000000;">.Count </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">))
{
    </span><span style="color: #800080;">$lead</span><span style="color: #000000;">.SalesRating</span><span style="color: #000000;">=</span><span style="color: #800080;">$salesRatings</span><span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]
}

</span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Program </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$program</span><span style="color: #000000;">;
</span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Campaign </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$campaign</span><span style="color: #000000;">;

</span><span style="color: #800080;">$newLead</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMLead </span><span style="color: #800080;">$lead</span><span style="color: #000000;"> 
</span><span style="color: #800080;">$newLead</span><span style="color: #000000;">.Id 
</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
<font size="2">
  <p>&#160;</p>
</font><font size="2">
  <h1><font size="5">Scripting the OData endpoint</font></h1>

  <p><font size="2">In order to connect with PowerShell to the OData endpoint you can use this command:</font></p>

  <div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:ab7df2e4-b2b3-4ceb-9e67-fd8f15d7744e" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style="background-color:#E6E6E6;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;;font-family:Microsoft Sans Serif;font-size:12"><span style="color: #000000;">Add</span><span style="color: #000000;">-</span><span style="color: #000000;">PSSnapIn Microsoft.Dynamics.Marketing.OData

Connect</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMOData`
    </span><span style="color: #000000;">-</span><span style="color: #000000;">SeviceUrl:</span><span style="color: #800000;">"</span><span style="color: #800000;">https://YOURINSTANCE.marketing.dynamics.com</span><span style="color: #800000;">"</span><span style="color: #000000;">`
    </span><span style="color: #000000;">-</span><span style="color: #000000;">RedirectUrl:</span><span style="color: #800000;">"</span><span style="color: #800000;">https://localhost</span><span style="color: #800000;">"</span><span style="color: #000000;">`
    </span><span style="color: #000000;">-</span><span style="color: #000000;">OAuthTokenResourceName:</span><span style="color: #800000;">"</span><span style="color: #800000;">YOUR__REGISTERED_APPID</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">verbose
</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

  <p><font size="3"><strong>Connect-MDMOData</strong> [[-SeviceUrl] &lt;string&gt;] [[-RedirectUrl] &lt;string&gt;] [[-AzureClientAppId] &lt;string&gt;] [-UserId &lt;string&gt;] 

      <br />&#160;&#160; [-OAuthUrl &lt;string&gt;] [-OAuthTokenResourceName &lt;string&gt;]&#160; [&lt;CommonParameters&gt;]</font> 

    <br /></p>

  <p>The Service URL represents the root Url of your Dynamics Marketing instance, not the OData endpoint - so don’t bother adding the “/analytics”.</p>

  <p>The RedirectUrl should typically be the “https://localhost”, which you have used when defining the app in Azure Active Directory (<a href="https://blogs.msdn.com/b/christians_mdm_blog/archive/2014/09/02/accessing-dynamics-marketing-odata-feeds-with-net-code.aspx" target="_blank">see here</a>). And the AzureClientAppId&#160; is the Id of the app that you have created in Azure Active Directory.</p>

  <p>Optionally you may pass the Sign-in User Id, if you want to default it for the login. The user still he must sign with his password. </p>

  <p>&#160;</p>

  <p>The cmdlets for the OData endpoint provide Find functions in different flavors.</p>

  <p><font size="3"><strong>Find-MDMContacts</strong> [-BelongsToCompanyId &lt;string&gt;] [-Id &lt;string&gt;] [-IsActive &lt;bool&gt;] [-Email &lt;string&gt;] 

      <br />&#160;&#160; [-FirstName &lt;string&gt;] [-LastName &lt;string&gt;] [-ChangedSince &lt;datetime&gt;] [-IsMarketing &lt;bool&gt;] [-IsClient &lt;bool&gt;] 

      <br />&#160;&#160; [-IsVendor &lt;bool&gt;] [-IsStaff &lt;bool&gt;] [-Fields &lt;string&gt;] [-Filter &lt;string&gt;] [-OrderBy &lt;string&gt;] [-Expand 

      <br />&#160;&#160; &lt;string&gt;] [-Top &lt;int&gt;] [-Skip &lt;int&gt;]&#160; [&lt;CommonParameters&gt;]</font> 

    <br /></p>

  <p><font size="3"><strong>Find-MDMCompanies</strong> [-BelongsToCompanyId &lt;string&gt;] [-Id &lt;string&gt;] [-Name &lt;string&gt;] [-IsMarketing &lt;bool&gt;] 

      <br />[-IsClient &lt;bool&gt;] [-IsVendor &lt;bool&gt;] [-IsSiteCompany &lt;bool&gt;] [-Fields &lt;string&gt;] [-Filter &lt;string&gt;] [-OrderBy 

      <br />&lt;string&gt;] [-Expand &lt;string&gt;] [-Top &lt;int&gt;] [-Skip &lt;int&gt;]&#160; [&lt;CommonParameters&gt;]</font> 

    <br /></p>

  <p><font size="3"><strong>Find-MDMLeads</strong> [-BelongsToCompanyId &lt;string&gt;] [-Id &lt;string&gt;] [-Name &lt;string&gt;] [-Status &lt;string&gt;] [-SalesReady 

      <br />&lt;bool&gt;] [-MinScore &lt;double&gt;] [-Fields &lt;string&gt;] [-Filter &lt;string&gt;] [-OrderBy &lt;string&gt;] [-Expand &lt;string&gt;] 

      <br />[-Top &lt;int&gt;] [-Skip &lt;int&gt;]&#160; [&lt;CommonParameters&gt;]</font></p>

  <p><font size="3"><strong>Find-MDMAnyData</strong> [[-TableName] &lt;string&gt;]<em><strong> [-Fields &lt;string&gt;] [-Filter &lt;string&gt;] [-OrderBy &lt;string&gt;] [-Expand 
          <br />&lt;string&gt;] [-Top &lt;int&gt;] [-Skip &lt;int&gt;]</strong></em>&#160; [&lt;CommonParameters&gt;] 

      <br /></font></p>

  <p>The <strong>Find-MDMAnyData</strong> is the core cmd lets for finding records from any OData table which Dynamics Marketing exposes. You specify the table name, Fields to retrieve values for, an OData Filter string and sort fields to OrderBy. If you omit specifying the fields you are interested in, the call will load all columns.</p>

  <p>The parameter “Top” allows to specify how many rows you want to retrieve from the top. Please note, if you do not specify a value by default in the comlet will try to load 10 rows. With the parameter “Skip” you can specify from where from top to start reading records. Parameters Top and Skip two together allow paging through your data, and you often will combine this with sorting and filtering.</p>

  <p>This for example command will collect the last 100 Visits recorded:</p>

  <div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:61c97fe0-268c-4c02-92ab-5578e05615ad" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style="background-color:#E6E6E6;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;;font-family:Microsoft Sans Serif;font-size:14.25"><span style="color: #800080;">$visits</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Find</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMAnyData </span><span style="color: #000000;">-</span><span style="color: #000000;">TableName:Visits </span><span style="color: #000000;">-</span><span style="color: #000000;">top:</span><span style="color: #000000;">100</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">OrderBy:</span><span style="color: #800000;">"</span><span style="color: #800000;">StartTime desc</span><span style="color: #800000;">"</span><span style="color: #000000;"> –verbose 
</span><span style="color: #800080;">$visits</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

  <p>Expand is a more advanced option to include values from related objects into your result object. In the following sample we load programs and include the Program KPIs which deliver aggregated numbers for Expenses, Purchase Orders, Estimates, Invoices and more for different currencies.</p>

  <div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:dba420f8-6a93-4037-91ce-2c1b55046bf1" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style="background-color:#E6E6E6;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;;font-family:Microsoft Sans Serif;font-size:12"><span style="color: #800080;">$programs</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Find</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMAnyData </span><span style="color: #000000;">-</span><span style="color: #000000;">TableName:Programs </span><span style="color: #000000;">-</span><span style="color: #000000;">Expand:ProgramKPIs </span><span style="color: #000000;">-</span><span style="color: #000000;">verbose
</span><span style="color: #800080;">$programs</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
  <font size="3"></font>

  <p>Here is a simple way to find your Site company:</p>

  

  <div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:3f308b22-3ebb-46fd-bc17-09563ff8650f" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style="background-color:#E6E6E6;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;;font-family:Microsoft Sans Serif;font-size:12"><span style="color: #800080;">$comps</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Find</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMCompanies </span><span style="color: #000000;">-</span><span style="color: #0000FF;">Filter</span><span style="color: #000000;">:</span><span style="color: #800000;">"</span><span style="color: #800000;">substringof('Site', Type) eq true</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">verbose
</span><span style="color: #800080;">$site</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$comps</span><span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]
</span><span style="color: #800080;">$siteId</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$site</span><span style="color: #000000;">.Id
</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

  

  <h1>An example that used both OData and the SDK endpoint to create Leads</h1>
</font><font size="2">
  <p>With the site company id at hand we for example can start browsing our marketing contact and run operations:</p>

  <div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:7b61c3ce-0aef-49f3-8217-c6f223ee4b87" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style="background-color:#E6E6E6;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;;font-family:Microsoft Sans Serif;font-size:12"><span style="color: #800080;">$pagesize</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">100</span><span style="color: #000000;">
</span><span style="color: #800080;">$skip</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">
</span><span style="color: #0000FF;">do</span><span style="color: #000000;">
{
    </span><span style="color: #800080;">$contacts</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Find</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMContacts </span><span style="color: #000000;">-</span><span style="color: #000000;">BelongsToId:</span><span style="color: #800080;">$siteId</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">Top:</span><span style="color: #800080;">$pagesize</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">Skip:</span><span style="color: #800080;">$skip</span><span style="color: #000000;">
    </span><span style="color: #800080;">$skip</span><span style="color: #000000;"> </span><span style="color: #000000;">+=</span><span style="color: #000000;"> </span><span style="color: #800080;">$contacts</span><span style="color: #000000;">.Count
    </span><span style="color: #800000;">"</span><span style="color: #800000;">Debug: Skip:</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800080;">$skip</span><span style="color: #000000;">
    </span><span style="color: #008000;">#</span><span style="color: #008000;">ProcessContacts($contacts)</span><span style="color: #008000;">
</span><span style="color: #000000;">}
</span><span style="color: #0000FF;">while</span><span style="color: #000000;"> (</span><span style="color: #800080;">$contacts</span><span style="color: #000000;">.Count </span><span style="color: #008080;">-ge</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">)
</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

  <p>In the sample below we start our journey with knowledge of the site company, a program and a campaign and then page through all contacts ad create leads for all contacts in a certain query.</p>

  

  <div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:c4d232ee-982b-4667-96bf-94a3c97f6e8e" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style="background-color:#E6E6E6;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;;font-family:Microsoft Sans Serif;font-size:14.25"><span style="color: #800080;">$siteId</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> '[Assign Company.ExternalId]'
</span><span style="color: #800080;">$programId</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> '[Assign Program.ExternalId here]'
</span><span style="color: #800080;">$campaignId</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> '[Assign Campaign.ExternalId here]'

</span><span style="color: #800080;">$belongsTo</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Get</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMCompany </span><span style="color: #800080;">$siteId</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">verbose

</span><span style="color: #800080;">$program</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> New</span><span style="color: #000000;">-</span><span style="color: #000000;">Object  Microsoft.Dynamics.Marketing.SDK.Model.Program
</span><span style="color: #800080;">$program</span><span style="color: #000000;">.Id </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$programId</span><span style="color: #000000;">

</span><span style="color: #800080;">$campaign</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> New</span><span style="color: #000000;">-</span><span style="color: #000000;">Object  Microsoft.Dynamics.Marketing.SDK.Model.Campaign
</span><span style="color: #800080;">$campaign</span><span style="color: #000000;">.Id </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$campaignId</span><span style="color: #000000;">

</span><span style="color: #800080;">$pagesize</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">5</span><span style="color: #000000;">
</span><span style="color: #800080;">$skip</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">30</span><span style="color: #000000;">
</span><span style="color: #800080;">$max</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">5</span><span style="color: #000000;">
</span><span style="color: #800080;">$index</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">
</span><span style="color: #0000FF;">do</span><span style="color: #000000;">
{
    </span><span style="color: #800080;">$contacts</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Find</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMContacts </span><span style="color: #000000;">-</span><span style="color: #000000;">BelongsToId:</span><span style="color: #800080;">$siteId</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">Top:</span><span style="color: #800080;">$pagesize</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">Skip:</span><span style="color: #800080;">$skip</span><span style="color: #000000;">
    </span><span style="color: #0000FF;">foreach</span><span style="color: #000000;"> (</span><span style="color: #800080;">$contact</span><span style="color: #000000;"> </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> </span><span style="color: #800080;">$contacts</span><span style="color: #000000;">)
    {    
        </span><span style="color: #800080;">$lead</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> new</span><span style="color: #000000;">-</span><span style="color: #000000;">object Microsoft.Dynamics.Marketing.SDK.Model.Lead
        </span><span style="color: #800080;">$lead</span><span style="color: #000000;">.BelongsToCompany </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$belongsTo</span><span style="color: #000000;"> 
               </span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Name </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">"</span><span style="color: #800000;">Initiative Lead N0.</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800080;">$index</span><span style="color: #000000;">
        </span><span style="color: #800080;">$ExId</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$contact</span><span style="color: #000000;">.Id
               </span><span style="color: #800080;">$sdkContact</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Get</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMContact </span><span style="color: #000000;">-</span><span style="color: #000000;">ContactId:</span><span style="color: #800080;">$ExId</span><span style="color: #000000;">
               </span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Contact </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$sdkContact</span><span style="color: #000000;">
        </span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Program </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$program</span><span style="color: #000000;">
        </span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Campaign </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$campaign</span><span style="color: #000000;">
        </span><span style="color: #800080;">$lead</span><span style="color: #000000;">.Date</span><span style="color: #000000;">=</span><span style="color: #000000;">[System.DateTime]</span><span style="color: #000000;">::</span><span style="color: #000000;">Now.ToUniversalTime()
        Add</span><span style="color: #000000;">-</span><span style="color: #000000;">MDMLead </span><span style="color: #800080;">$lead</span><span style="color: #000000;">
         </span><span style="color: #800080;">$index</span><span style="color: #000000;">++</span><span style="color: #000000;">
    }
    
    </span><span style="color: #800080;">$skip</span><span style="color: #000000;"> </span><span style="color: #000000;">+=</span><span style="color: #000000;"> </span><span style="color: #800080;">$contacts</span><span style="color: #000000;">.Count
    </span><span style="color: #800000;">"</span><span style="color: #800000;">Debug: Skip:</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800080;">$skip</span><span style="color: #000000;">
    </span><span style="color: #008000;">#</span><span style="color: #008000;">ProcessContacts($contacts)</span><span style="color: #008000;">
</span><span style="color: #000000;">}
</span><span style="color: #0000FF;">while</span><span style="color: #000000;"> (</span><span style="color: #800080;">$contacts</span><span style="color: #000000;">.Count </span><span style="color: #008080;">-ge</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">)
</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

  
</font>

<p><font size="2">With this blog post I wanted to give a quick glimpse into what is possible with the cmdlets for Dynamics Marketing OData endpoint and SDK. This topic certainly calls for more blog posts with practical sample applications. Stay tuned.</font></p>

<p><span style="font-size: small">Enjoy!</span></p>

<p><span style="font-size: small"><em>Christian Abeln</em> 

    <br />Senior 

    <div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4fad3655-3884-4e52-a28d-852148352899" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">Technorati Tags: <a href="https://technorati.com/tags/Dynamics+Marketing" rel="tag">Dynamics Marketing</a>,<a href="https://technorati.com/tags/SDK" rel="tag">SDK</a>,<a href="https://technorati.com/tags/OData" rel="tag">OData</a>,<a href="https://technorati.com/tags/PowerShell" rel="tag">PowerShell</a></div>
Program Manager 

    <br />Microsoft Dynamics Marketing</span></p>

<p><span style="font-size: small">Follow <a href="https://curah.microsoft.com/79665/microsoft-dynamics-marketing">My Curah!s on Microsoft Dynamics Marketing</a></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Microsoft Dynamics Marketing SDK Library on NuGet</title>
      <link>https://docs.microsoft.com/archive/blogs/christians_mdm_blog/microsoft-dynamics-marketing-sdk-library-on-nuget</link>
      <pubDate>Wed, 25 Mar 2015 01:18:00 GMT</pubDate>
      <dc:creator><![CDATA[cabeln]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christians_mdm_blog/2015/03/25/microsoft-dynamics-marketing-sdk-library-on-nuget/</guid>
      <description><![CDATA[If you are developing solutions with Visual Studio for Microsoft Dynamics Marketing you typically...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">If you are developing solutions with Visual Studio for Microsoft Dynamics Marketing you typically will download the SDK from <a href="https://go.microsoft.com/fwlink/?LinkId=394973" target="_blank">here</a> then take the SDK library, copy it into a library folder and reference it from there. You will check in the library into your source management system and so on.</span></p>
<p><span style="font-size: small;">Instead you can now use a <a href="https://www.nuget.org/" target="_blank">NuGet</a> Package in your Visual Studio solution and configure which projects in the solution shall make use of it. The library will be added as a reference and as soon as you compile the first time it will be downloaded, added to the package cache in the solution and deployed with your project.</span></p>
<p><span style="font-size: small;">Only check the solution with the package definition into your source management system. Any developer who downloads it will get the correct library version automatically deployed.</span></p>
<p><span style="font-size: small;"><a href="https://www.nuget.org/" target="_blank">Find information on how to use the NuGet packages here.</a></span></p>
<p><span style="font-size: small;"><a href="https://www.nuget.org/packages/Microsoft.Dynamics.Marketing.SDK.library/" target="_blank">Get the Microsoft Dynamics Marketing SDK NuGet package here.</a></span></p>
<p><span style="font-size: small;">&nbsp;</span></p>
<p><span style="font-size: small;">Enjoy!</span></p>
<p><span style="font-size: small;"><em>Christian Abeln</em> <br />Senior Program Manager <br />Microsoft Dynamics Marketing</span></p>
<p><span style="font-size: small;">Follow <a href="https://curah.microsoft.com/79665/microsoft-dynamics-marketing">My Curah!s on Microsoft Dynamics Marketing</a></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Accessing Microsoft Dynamics Marketing OData feeds from .Net code (UPDATED downloads for 17.2 and 18.0)</title>
      <link>https://docs.microsoft.com/archive/blogs/christians_mdm_blog/accessing-microsoft-dynamics-marketing-odata-feeds-from-net-code-autumn-2014-17-0</link>
      <pubDate>Tue, 02 Sep 2014 13:51:00 GMT</pubDate>
      <dc:creator><![CDATA[cabeln]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christians_mdm_blog/2014/09/02/accessing-microsoft-dynamics-marketing-odata-feeds-from-net-code-autumn-2014-17-0/</guid>
      <description><![CDATA[&#160;  The typical usage of the Dynamics Marketing feeds is through Power BI. A user would use...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p><span style="font-size: small">The typical usage of the Dynamics Marketing feeds is through Power BI. A user would use Excel Pro and with the Power Query plugin he would connect to the OData endpoint of Dynamics Marketing.</span></p>  <p><span style="font-size: small">e.g. “https://contoso.marketing.dynamics.com/analytics/”</span></p>  <p><span style="font-size: small">But before the OData endpoint needs to be enabled in the Site Settings – look all at the bottom on that page.</span></p>  <p><span style="font-size: small"><strong><em>“But is Power Query really the only way to access the OData feed endpoint?”</em></strong>       <br /></span><span style="font-size: small">This question has reached my desk a few times now. First of all: The OData endpoint was designed for analytic reporting. Still it is technically possible to access the service endpoint by other dedicated clients as well. In this post I will lay out how that works and even provide a sample OData client application.</span></p>  <table style="width: 515px" cellspacing="0" cellpadding="2" border="0"><tbody>     <tr>       <td valign="top" width="82"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/5342.image_24E1006F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/5342.image_5F00_24E1006F.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/3323.image_thumb_0DB585F1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/3323.image_5F00_thumb_5F00_0DB585F1.png" width="66" height="63" /></a>&#160;</td>        <td valign="top" width="431"><strong><span style="size: 3">This post is targeting the 3rd party developer who is comfortable with using .Net in order to create clients for Dynamics Marketing which communicate of protocol level with the data service. And you should look forward to configure Azure Active Directory and use authentication mechanics in your code</span><span style="size: 3">.</span></strong></td>     </tr>      <tr>       <td valign="top" width="82">&#160;</td>        <td valign="top" width="431">&#160;</td>     </tr>   </tbody></table>  <table style="width: 515px" cellspacing="0" cellpadding="2" border="0"><tbody>     <tr>       <td valign="top" width="82"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/5342.image_24E1006F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/5342.image_5F00_24E1006F.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/3323.image_thumb_0DB585F1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/3323.image_5F00_thumb_5F00_0DB585F1.png" width="66" height="63" /></a>&#160;</td>        <td valign="top" width="431">         <p><strong><span style="size: 3">Accessing the MDM OData endpoint with other tools than PowerQuery is not officially supported for the current releases of Dynamics Marketing.</span></strong></p>       </td>     </tr>   </tbody></table>  <p>&#160;</p>  <h1>For the restless reader (“in a few words”)</h1>  <p><span style="font-size: small">These are the steps needed to write your own client application that is permitted to connect, send data queries and process responses from the MDM OData endpoint.</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/6403.image_76F63E67.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/6403.image_5F00_76F63E67.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/6327.image_thumb_18756DF7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/6327.image_5F00_thumb_5F00_18756DF7.png" width="134" height="134" /></a></p>  <table style="width: 524px" cellspacing="0" cellpadding="2" border="0"><tbody>     <tr>       <td valign="top" width="522">         <ul>           <li><span style="font-size: small">Define an application in WAAD. You will need the generated App ID in your client application code. Also a response URL is defined n this step.</span> </li>         </ul>       </td>     </tr>      <tr>       <td valign="top" width="522">         <ul>           <li><span style="font-size: small">Now make sure that this WAAD app is permitted to connect to the MDM service.                <br /><strike>You need to use the Graph API or the tool </strike><a href="https://graphexplorer.cloudapp.net/" target="_blank"><strike>GraphExplorer</strike></a><strike> for this step.</strike></span>               <br />Update: Graph Explorer does not support setting app permissions any longer. We are looking into to ways to set the permissions by other means.              <br />Until then you can try using the AppID of Power BI.</li>         </ul>       </td>     </tr>      <tr>       <td valign="top" width="522">         <ul>           <li><span style="font-size: small"><span style="font-size: small">Now write the actual OData consumer application in .Net. When it connects to the OData endpoint it must provide the information from above in the authentication flow. This flow will request the user of your client app to sign in and return an access token, which must be included in the Http header of every following request.</span></span> </li>         </ul>       </td>     </tr>      <tr>       <td valign="top" width="522">         <ul>           <li><span style="font-size: small">When reposes arrive from the OData service, the consumer app will apply a data model and process the data accordingly.                <br />A proxy class in .Net for the full OData endpoint of Dynamics Marketing is included in the sample code.</span> </li>         </ul>       </td>     </tr>   </tbody></table>  <p>&#160;</p>  <h1>Defining the application in WAAD</h1>  <p><span style="font-size: small">An application definition in Azure Active Directory provides the control of the consumers that may use the endpoint of a certain service in a specific subscription. This is used in addition of user credentials to sign in. You need to have an Azure subscription enabled for your organization. (The procedure described in this post will not introduce any costs in your subscription.)</span></p>  <p><span style="font-size: small">Why do you need that? because as and administrator of Contoso you want to control explicitly which applications or services may access your Dynamics Marketing OData endpoint. PowerQuery in Excel is by default permitted to do so for every deployment of Dynamics Marketing. </span></p>  <p><span style="font-size: small">Define an application in Azure Active Directory</span></p>  <p>&#160;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/1780.image1_51998226.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/1780.image1_5F00_51998226.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/1882.image1_thumb_06AA7112.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/1882.image1_5F00_thumb_5F00_06AA7112.png" width="477" height="249" /></a></p>  <p>&#160;</p>  <p><span style="font-size: small">Note the generated App ID. For the Redirect URI we use <a href="https://localhost">https://local</a><span style="font-size: small">host</span>. We actually doe not need a redirect URI on which we would receive responses to any request for OAuth requests. We are listening in the application directly. </span></p>  <p>   <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/6138.image101_35FBE69C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/6138.image101_5F00_35FBE69C.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/3823.image101_thumb_1A59EB57.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/3823.image101_5F00_thumb_5F00_1A59EB57.png" width="482" height="290" /></a></p>  <p>&#160;</p>  <h1>Grant permissions to access the Dynamics Marketing service (<font style="font-weight: bold">to be updated…</font>)</h1>  <p><span style="font-size: small">Now we need to grant the permissions to our new Azure app to access Dynamics Marketing.&#160; For other services like Dynamics CRM the necessary steps have been take to show the service in the section “permissions to other applications”. But this not available for Dynamics Marketing yet. Therefore we need to take workaround through the so called <a href="https://msdn.microsoft.com/en-us/library/hh974476.aspx" target="_blank">Graph API</a>. This API has been provided to configure the Active Directory programmatically.</span></p>  <p><span style="font-size: small"><strong>!! Many have reported that Graph Explorer does not support setting the App permissions any longer. We are looking into other ways to allow this configuration !!</strong></span></p>  <p><span style="font-size: small">But no worries we do not need to write our own Graph API client application in order to do the missing step of granting permissions. The Azure team has provide a sample service called <a href="https://graphexplorer.cloudapp.net/" target="_blank">Graph Explorer</a>, which we can use to configure the permissions. Lets open the too and Sign In with the account that can administer Azure account. You as well press then the “Get” button in order to then browse through the different configuration information in your Azure Directory.       <br />You will see of course the address of your own Dynamics Marketing instance for Resource and the Responses below.</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/0652.image17_69C66D9E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/0652.image17_5F00_69C66D9E.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/5481.image17_thumb_79690960.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/5481.image17_5F00_thumb_5F00_79690960.png" width="527" height="244" /></a></p>  <p><span style="font-size: small">Click on “Add Application Permission” in order to establish the trust relationship between your application definition in Azure and the Dynamics Marketing service.</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/5417.image22_12676A57.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/5417.image22_5F00_12676A57.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/8103.image22_thumb_41B8DFE1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/8103.image22_5F00_thumb_5F00_41B8DFE1.png" width="530" height="469" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/5807.image_25AAB1A7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/5807.image_5F00_25AAB1A7.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/6648.image_thumb_751733EE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/6648.image_5F00_thumb_5F00_751733EE.png" width="532" height="326" /></a></p>  <p>&#160;</p>  <h1>Write the basic code to access the MDM OData endpoint</h1>  <table style="width: 537px" cellspacing="0" cellpadding="2" border="0"><tbody>     <tr>       <td valign="top" width="80"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/8304.image_7E3A2634.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/8304.image_5F00_7E3A2634.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/5584.image_thumb_202588B9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/5584.image_5F00_thumb_5F00_202588B9.png" width="66" height="63" /></a>&#160;</td>        <td valign="top" width="455">         <p><span style="font-size: x-small">Prerequisites: In order to build a OData client application you will need to install first the </span><a href="https://www.microsoft.com/en-us/download/details.aspx?id=39373"><span style="font-size: x-small"><strong>WCF</strong> <strong>Data</strong> <strong>Services</strong> 5.6.0 RTM Tools.</span></a><span style="font-size: x-small"> Some of the libraries we need for our experiment are located then on your local machine:              <br /></span><span style="font-size: x-small">C:\Program Files (x86)\Microsoft WCF Data Services\5.6\bin\.NETFramework              <br /></span><span style="font-size: x-small">Notably it is the client library “Microsoft.Data.Services.Client.dll” to which we must add a reference in our project.</span></p>       </td>     </tr>   </tbody></table>  <p><span style="font-size: small">The sample client application that comes with this post does two things in order to authenticate:</span></p>  <h2><span style="font-size: small">1. It requests an authorization token by </span></h2>  <ul>   <ul>     <li><span style="font-size: small">Using the correct Url that provides the authentication, which is:          <br /><strong>https://login.windows.net/common/</strong></span> </li>      <li><span style="font-size: small">Specifying the correct resource name for which the access token shall be issued:          <br /><strong>https://marketing-infra.dynamics.com/</strong></span> </li>      <li><span style="font-size: small">Requesting it for the client app ID from the Application registration in Azure</span> </li>      <li><span style="font-size: small">Specifying the Redirect Uri that we had entered into the application registration (<a href="https://localhost/">https://localhost/</a>)</span> </li>   </ul> </ul>  <p>&#160;</p>  <table style="width: 526px" cellspacing="0" cellpadding="2" border="0"><tbody>     <tr>       <td valign="top" width="524">         <div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:8f174e25-2352-4a23-b96d-75a7322a5230" class="wlWriterSmartContent" style="width: 519px; float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto">           <pre style="overflow: auto; word-wrap: break-word; white-space: pre-wrap; background-color: #ebebeb"><span style="color: #0000ff">this</span><span style="color: #000000">._authenticationContext </span><span style="color: #000000">=</span><span style="color: #0000ff">new</span><span style="color: #000000"> AuthenticationContext(OAuthUrl, </span><span style="color: #0000ff">false</span><span style="color: #000000">); var result </span><span style="color: #000000">=</span><span style="color: #000000"> await </span><span style="color: #0000ff">this</span><span style="color: #000000">._authenticationContext.AcquireTokenAsync( MDMOAuthTokenResourceName, </span><span style="color: #0000ff">this</span><span style="color: #000000">.ODataClientAppID, </span><span style="color: #0000ff">this</span><span style="color: #000000">.RedirectUri, </span><span style="color: #0000ff">string</span><span style="color: #000000">.Empty, </span><span style="color: #0000ff">string</span><span style="color: #000000">.Empty);</span></pre>
<!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
      </td>
    </tr>
  </tbody></table>

<p>&#160;</p>

<p><span style="font-size: small">In the process of getting an the authentication token, the authentication service at <span style="font-size: small">https://login.windows.net/common/</span> will request the user to sign in and provide respective UI 

    <br />(</span><span style="font-size: small">Find the respective code in <em>CurrentEnvironment.cs</em>)</span></p>

<p><span style="font-size: small">The authentication token will also be cached such that the user does not have to enter the credentials every time. Resetting the cache token will require the user to sign in again. The application can control that by simply calling:</span></p>

<div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:afe4b0d0-a662-4c8b-bf61-637a96db2a54" class="wlWriterSmartContent" style="width: 855px; float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto">
  <pre style="overflow: auto; word-wrap: break-word; white-space: pre-wrap; background-color: #e6e6e6"><span style="color: #000000">(AuthenticationContext.TokenCache </span><span style="color: #0000ff">as</span><span style="color: #000000"> DefaultTokenCache).Clear();</span></pre>
<!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

<p><span style="font-size: small">This is a typical activity if the user chooses to sign out or the connection parameters have changed.</span></p>

<h2><span style="font-size: small">2. For each request we send we need to make sure to include the authentication token into the request header.</span></h2>

<table style="width: 335px" cellspacing="0" cellpadding="2" border="0"><tbody>
    <tr>
      <td valign="top" width="333">
        <div id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:e18148e8-f5eb-4bd6-88c2-ec6ddea3b2d7" class="wlWriterSmartContent" style="width: 525px; float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto">
          <pre style="overflow: auto; word-wrap: break-word; white-space: pre-wrap; background-color: #e6e6e6"><span style="color: #008000">//</span><span style="color: #008000"> transmit the access token we have received earlier</span><span style="color: #000000">var headerVal </span><span style="color: #000000">=</span><span style="color: #0000ff">new</span><span style="color: #000000"> AuthenticationHeaderValue(</span><span style="color: #800000">&quot;</span><span style="color: #800000">Bearer</span><span style="color: #800000">&quot;</span><span style="color: #000000">, </span><span style="color: #0000ff">this</span><span style="color: #000000">._environment.AuthenticationToken); args.Headers.Add(</span><span style="color: #800000">&quot;</span><span style="color: #800000">Authorization</span><span style="color: #800000">&quot;</span><span style="color: #000000">, headerVal.ToString());</span></pre>
<!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
      </td>
    </tr>
  </tbody></table>

<p><span style="font-size: small">The simple procedure is simply to add a header value of type Authentication to the http request where the Name is “Bearer” and the value is the authentication token that we have received.</span></p>

<h1>Process data with the help of the data model</h1>

<p><span style="font-size: small">The easiest way to query and consume entities from a OData service is through a data model in your client application code. Visual Studio allows developers to connect to an OData service endpoint and generate code by adding a service reference. This generates code in form of a <a href="https://msdn.microsoft.com/en-us/library/system.data.services.client.dataservicecontext(v=vs.113).aspx" target="_blank">DataServiceContext</a> class implementation. And that comes with a query for each entity, a </span><span style="font-size: small">class for each entity with all entity fields as properties, a queries or relations to other table (like Company.Leads).</span></p>

<p><span style="font-size: small">With such a data model all we need to do is create an instance of the data model for our OData service end point address. Then we need to make sure to subscribe to any activity that builds the http requests for each OData query, so we can inject our authentication token. And with that we are ready to query data and bind the returned data filled with information to any UI we like or use the data in other business logic.</span></p>

<p><span style="font-size: small">Unfortunately Visual Studio does not know how to use OAuth on the data service of Dynamics Marketing. Therefore I have provided a generated data model as part of this sample application. </span></p>

<p><span style="font-size: small">You will find that in the source file <em>MDMOData161.cs</em>. This is for the version of the data model that currently is live in the production instances. The sample will need to be updated for future releases.</span></p>

<h1>Try out the Sample App</h1>

<h1><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/4428.image_0D3FBFAC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/4428.image_5F00_0D3FBFAC.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/6507.image_thumb_2A486E74.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/6507.image_5F00_thumb_5F00_2A486E74.png" width="515" height="291" /></a></h1>

<p><span style="font-size: small">After you start the OData application for MDM you need to enter the MDM Service Address (without the “/analytics” at the end). Also the reply URI and Client App Id from the definition of the application in Azure.</span></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/4532.image_07628B62.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/4532.image_5F00_07628B62.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/3808.image_thumb_2B8A76A2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/3808.image_5F00_thumb_5F00_2B8A76A2.png" width="561" height="323" /></a></p>

<p><span style="font-size: small">Next you will need to sign in.</span></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/4721.image_1F0E0DFA.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/4721.image_5F00_1F0E0DFA.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/3107.image_thumb_00C35704.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/3107.image_5F00_thumb_5F00_00C35704.png" width="334" height="333" /></a></p>

<p><span style="font-size: small">After the Sign in succeeds you will be able to request entities for a few select types. In the sample these are just Contacts, Companies, Leads, Campaigns.</span></p>

<p><span style="font-size: small">For the selected entity, the client app will retrieve all respective entities from the service.</span></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/0601.image_79B4F0BB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/0601.image_5F00_79B4F0BB.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/metablogapi/7077.image_thumb_56F3B8FE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-metablogapi/7077.image_5F00_thumb_5F00_56F3B8FE.png" width="522" height="285" /></a></p>

<p><span style="font-size: small">The sample code shows how to authenticate against WAAD, and use the authentication token to run asynchronous queries on the OData endpoint and also bind the result to a simple generic data view in a Windows 8 Store application.</span></p>

<p><span style="font-size: small"><strong>Download the sample code for Microsoft Dynamics Marketing 2016&#160; (ver. 19.0) </strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/MDM%20OData%20SDK/7762.MDM%20OData%20SDK%2019.0.4639.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-MDM+OData+SDK/7762.MDM-OData-SDK-19.0.4639.zip" target="_blank">from HERE</a></span></p>

<p><span style="font-size: small">Enjoy!</span></p>

<p><span style="font-size: large; font-family: garamond"><em><span style="font-size: large">Christian Abeln</span></em></span> 

  <br /><span style="font-size: small"><span style="font-size: small">Senior Program Manager 
      <br />Microsoft Dynamics Marketing</span></span></p>

<p><span style="font-size: medium">Follow </span><a href="https://curah.microsoft.com/79665/microsoft-dynamics-marketing"><span style="font-size: medium">My Curah!s on Microsoft Dynamics Marketing</span></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Dynamics Marketing 2015 (17.2, 18.0) - OData feed documentation (UPDATED)</title>
      <link>https://docs.microsoft.com/archive/blogs/christians_mdm_blog/dynamics-marketing-odata-feed-documentation-mdm-16-x</link>
      <pubDate>Sun, 31 Aug 2014 15:27:00 GMT</pubDate>
      <dc:creator><![CDATA[cabeln]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christians_mdm_blog/2014/08/31/dynamics-marketing-odata-feed-documentation-mdm-16-x/</guid>
      <description><![CDATA[&nbsp;
Dynamics Marketing provides a rich set of OData feeds for he most important data entities in...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p>
<p><span style="font-size: small;"><span style="font-size: small;">Dynamics Marketing provides a rich set of OData feeds for he most important data entities in the system that can be used for analytic reports.</span></span></p>
<p><span style="font-size: small;"><span style="font-size: small;">All feeds are read only and are especially targeting analytics with Microsoft Power BI. Therefore we have put focus on providing meaningful data together with special KPIs for Marketing Performance Measurement.</span></span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/7318.Graph%20-%20OData%20feeds%2018.0.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42/7318.Graph-_2D00_-OData-feeds-18.0.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/7318.Graph%20-%20OData%20feeds%2018.0.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42/7318.Graph-_2D00_-OData-feeds-18.0.png" alt="" border="0" /></a></span></p>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/49/63/20/OData%20Documentation%20-%20MDM%2018.0.4062.0%20-%20Spica.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-49-63-20/OData-Documentation-_2D00_-MDM-18.0.4062.0-_2D00_-Spica.zip">Download 18.0.4062 OData field documentation from HERE!</a></span></p>
<p><span style="font-size: x-small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/63/42/OData%20Feed%20Documentation/7558.OData%20Documentation%20-%20MDM%2017.2%20-%20Electra.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-63-42-OData+Feed+Documentation/7558.OData-Documentation-_2D00_-MDM-17.2-_2D00_-Electra.zip">Download 17.2.0022 OData field documentation as mht file from HERE!</a></span></p>
<p><span style="font-size: large; font-family: garamond;"><em><span style="font-size: large;">Christian Abeln</span></em></span> <br /><span style="font-size: small;"><span style="font-size: small;">Senior Program Manager <br />Microsoft Dynamics Marketing</span></span></p>
<p><span style="font-size: medium;">Follow </span><a href="https://curah.microsoft.com/79665/microsoft-dynamics-marketing"><span style="font-size: medium;">My Curah!s on Microsoft Dynamics Marketing</span></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/49/63/20/OData%20Documentation%20-%20MDM%2018.0.4062.0%20-%20Spica.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-49-63-20/OData-Documentation-_2D00_-MDM-18.0.4062.0-_2D00_-Spica.zip">OData Documentation - MDM 18.0.4062.0 - Spica.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>The Start of my Microsoft Dynamics Marketing blog</title>
      <link>https://docs.microsoft.com/archive/blogs/christians_mdm_blog/the-start-of-my-microsoft-dynamics-marketing-blog</link>
      <pubDate>Sun, 31 Aug 2014 01:18:00 GMT</pubDate>
      <dc:creator><![CDATA[cabeln]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christians_mdm_blog/2014/08/31/the-start-of-my-microsoft-dynamics-marketing-blog/</guid>
      <description><![CDATA[Hi,  It is really overdue time that I start blogging on Microsoft Dynamics Marketing. I am looking...]]></description>
      <content:encoded><![CDATA[<p><font size="3"></font></p>  <p><font size="3">Hi,</font></p>  <p><font size="3">It is really overdue time that I start blogging on Microsoft Dynamics Marketing. I am looking forward to start sharing about various topics.</font></p>  <p><font size="3"></font></p>  <p><font size="3">You can find general product documentation information here:</font></p>  <p><font size="3"><a href="https://www.microsoft.com/en-us/dynamics/crm-marketing.aspx" target="_blank">https://www.microsoft.com/en-us/dynamics/crm-marketing.aspx</a></font></p>  <p><font size="3"></font></p>  <p><font size="3">Or follow my Curah!'s here (Link collections with essential information and materials):</font></p>  <p><span style="font-size: 10pt; font-family: &#39;Segoe UI&#39;,&#39;sans-serif&#39;; color: #333333; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-fareast-theme-font: minor-fareast; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa; mso-no-proof: yes"><span style="color: #0563c1"><font size="3"><a href="https://curah.microsoft.com/79665/microsoft-dynamics-marketing" target="_blank">My Curah!s on Microsoft Dynamics Marketing</a></font></span></span></p>  <p>&#160;</p>  <p><font size="5" face="Garamond"><em>Christian Abeln        <br /></em></font><font size="3">Senior Program Manager      <br />Microsoft Dynamics Marketing</font></p>]]></content:encoded>
    </item>
  </channel>
</rss>