<?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>Saud's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/saudm/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/saudm/feed.xml</link>
    <description>A blog about...well, manageability and mobility.</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:09:26 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>An Adventure in Troubleshooting the Intune Connector</title>
      <link>https://docs.microsoft.com/archive/blogs/saudm/an-adventure-in-troubleshooting-the-intune-connector</link>
      <pubDate>Thu, 05 Feb 2015 18:36:00 GMT</pubDate>
      <dc:creator><![CDATA[SaudM]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/saudm/2015/02/05/an-adventure-in-troubleshooting-the-intune-connector/</guid>
      <description><![CDATA[Note The procedures below are also published here in a more step-by-step format (less...]]></description>
      <content:encoded><![CDATA[<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;"><strong>Note</strong> The procedures below are also published here in a more step-by-step format (less backstory/discussion): <a href="https://social.technet.microsoft.com/wiki/contents/articles/29847.troubleshooting-the-intune-connector-for-system-center-configuration-manager.aspx">https://social.technet.microsoft.com/wiki/contents/articles/29847.troubleshooting-the-intune-connector-for-system-center-configuration-manager.aspx</a> <br /></span></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">&nbsp;</span></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">Recently - I was troubleshooting a device enrolment problem in my test environment. I had been trying to enrol an Android device into Intune and it was enrolling on the device but I couldn&#39;t get it to appear in Intune. I followed the usual steps I walk through to troubleshoot the Intune Connector on Configuration Manager but to no avail. I started to think it wasn&#39;t my environment and started down a typical &quot;if it&rsquo;s not me, then it must be you&quot; route of thought. Turns out it was my environment and it was replication related (but not DRS) - read on to find out more. </span></div>
<div style="line-height:normal;"><b><span style="font-size:10.0pt;color:black;">The backstory<br /> <br /> </span></b></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">I had a hardware failure on my Hyper-V server over the holiday that caused some corruption in my VMs (it was a weird issue where the disks in a Storage Pool slowly failed but while failing bounced up and down). Luckily, I had a backup and proceeded to restore the impacted ConfigMgr primary site and that fixed things (or so I believed at the time). Everything was working just fine in the environment - objects were replicating up in the environment and I was doing some testing of some Android scenarios. I could get object metadata to flow into Intune and appear on the device so I assumed all was well. </span></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">I then tried to enrol an Android device - that worked just fine but the device didn&#39;t appear in the console. I assume that I was being impatient, walked off and got busy with my day job and life in general. I came back and found it wouldn&#39;t enrol and did more troubleshooting. </span></div>
<div style="line-height:normal;"><b><span style="font-size:10.0pt;color:black;">The troubleshooting - the device </span></b></div>
<div style="margin-left:42.0pt;text-indent:-18.0pt;line-height:normal;"><span style="font-size:10.0pt;color:black;">1.<span style="font:7.0pt &#39;Times New Roman&#39;;">&nbsp;&nbsp; </span></span><span dir="LTR"></span><span style="font-size:10.0pt;color:black;">I began by trying to un-enrol the device and for the deletion to be replicated to get settled then re-enrolling it. </span></div>
<div style="margin-left:42.0pt;text-indent:-18.0pt;line-height:normal;"><span style="font-size:10.0pt;color:black;">2.<span style="font:7.0pt &#39;Times New Roman&#39;;">&nbsp;&nbsp; </span></span><span dir="LTR"></span><span style="font-size:10.0pt;color:black;">I began trying to enrol various Android devices to isolated if it was a device issue&hellip;nothing worked. </span></div>
<div style="margin-left:42.0pt;text-indent:-18.0pt;line-height:normal;"><span style="font-size:10.0pt;color:black;">3.<span style="font:7.0pt &#39;Times New Roman&#39;;">&nbsp;&nbsp; </span></span><span dir="LTR"></span><span style="font-size:10.0pt;color:black;">I then tried enrolling Windows Phones to see if there was a platform specific issue.&nbsp;That didn&#39;t work either. </span></div>
<div style="line-height:normal;"><b><span style="font-size:10.0pt;color:black;">The troubleshooting - the connector</span></b></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">At this stage, I needed to move on to the Intune Connector. I knew that it was like a download issue, as I could get objects into the service. </span></div>
<div style="margin-left:42.0pt;text-indent:-18.0pt;line-height:normal;"><span style="font-size:10.0pt;color:black;">1.<span style="font:7.0pt &#39;Times New Roman&#39;;">&nbsp;&nbsp; </span></span><span dir="LTR"></span><span style="font-size:10.0pt;color:black;">Checked <b>dmpdownloader.log</b> to see if the Intune Connector&#39;s download component was able to pull messages from the service. That looked just fine, as I&rsquo;d expect it to be. Message like the following were the last thing in the log:</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Received 1 messages&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DMP_DOWNLOADER&nbsp;&nbsp;&nbsp; 23/01/2015 15:38:45&nbsp;&nbsp; 5912 (0x1718)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Received 3 messages&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DMP_DOWNLOADER&nbsp;&nbsp;&nbsp; 23/01/2015 15:48:53&nbsp;&nbsp; 3784 (0x0EC8)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Received 3 messages&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DMP_DOWNLOADER&nbsp;&nbsp;&nbsp; 23/01/2015 16:49:31&nbsp;&nbsp; 2836 (0x0B14)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Received 3 messages&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DMP_DOWNLOADER&nbsp;&nbsp;&nbsp; 23/01/2015 17:55:15&nbsp;&nbsp; 5964 (0x174C)</span></div>
<div style="margin-left:42.0pt;text-indent:-18.0pt;line-height:normal;"><span style="font-size:10.0pt;color:black;">2.<span style="font:7.0pt &#39;Times New Roman&#39;;">&nbsp;&nbsp; </span></span><span dir="LTR"></span><span style="font-size:10.0pt;color:black;">Check the <b>CloudUserSync.log</b> (authorizes users to enrol devices in Intune) and <b>OutgoingContentManager.log</b> (uploads application files to Intune) &ndash; they shouldn&rsquo;t have had anything to do with the problem but just as a sanity check. </span></div>
<div style="margin-left:42.0pt;text-indent:-18.0pt;line-height:normal;"><span style="font-size:10.0pt;color:black;">3.<span style="font:7.0pt &#39;Times New Roman&#39;;">&nbsp;&nbsp; </span></span><span dir="LTR"></span><span style="font-size:10.0pt;color:black;">Checked <b>dmpuploader.log</b> to see if the Intune Connector&#39;s upload component was able to send messages to the service. Again &ndash; this shouldn&rsquo;t have been the problem but I just needed to rule it out. This also looked just fine, as I&rsquo;d expect it to be. Message like the following were the last thing in the log:</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">StartUpload for replication group CloudDmp last sync version 12170413 ...</span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">&nbsp;&nbsp;&nbsp;&nbsp; SMS_DMP_UPLOADER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 23/01/2015 16:55:32&nbsp;&nbsp; 6656 (0x1A00)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Startload succeeded with transmission ID a36266f9-7663-4625-be03-71f9f89b6a43&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DMP_UPLOADER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 23/01/2015 16:55:33&nbsp;&nbsp; 6656 (0x1A00)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Expecting sync data or sync end message, however message type is DRS_SyncPing&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DMP_UPLOADER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 23/01/2015 16:55:34&nbsp;&nbsp; 6656 (0x1A00)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">EndUpload transmission a36266f9-7663-4625-be03-71f9f89b6a43 final data version 12170518 succeeded&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DMP_UPLOADER&nbsp;&nbsp;&nbsp;&nbsp; 23/01/2015 16:55:35&nbsp;&nbsp; 6656 (0x1A00)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Found sync start for replication group CloudDmp&nbsp;&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DMP_UPLOADER&nbsp;&nbsp;&nbsp;&nbsp; 23/01/2015 18:00:35&nbsp;&nbsp; 6656 (0x1A00)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">StartUpload for replication group CloudDmp last sync version 12170518 ...</span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">&nbsp;&nbsp;&nbsp;&nbsp; SMS_DMP_UPLOADER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 23/01/2015 18:00:35&nbsp;&nbsp; 6656 (0x1A00)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Startload succeeded with transmission ID cee9ce04-3c6d-4f24-97fb-c66355250d31</span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">&nbsp; SMS_DMP_UPLOADER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 23/01/2015 18:00:36&nbsp;&nbsp; 6656 (0x1A00)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Expecting sync data or sync end message, however message type is DRS_SyncPing&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DMP_UPLOADER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 23/01/2015 18:00:37&nbsp;&nbsp; 6656 (0x1A00)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">EndUpload transmission cee9ce04-3c6d-4f24-97fb-c66355250d31 final data version 12170624 succeeded&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DMP_UPLOADER&nbsp;&nbsp;&nbsp;&nbsp; 23/01/2015 18:00:38&nbsp;&nbsp; 6656 (0x1A00)</span></div>
<div style="line-height:normal;"><b><span style="font-size:10.0pt;color:black;">The troubleshooting - the site</span></b></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">At this stage, I&rsquo;d ruled out the Intune Connector installed on my CAS and started to get worried that something was wrong in my environment (&ldquo;It&rsquo;s not you, it&rsquo;s me&rdquo;). :) </span></div>
<ol type="1" start="1">
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:10.0pt;color:black;">I took a look at DRS but this looked find under <b>Monitoring </b></span><b><span style="font-size:10.0pt;font-family:Wingdings;color:black;">&agrave;</span></b><b><span style="font-size:10.0pt;color:black;"> Database Replication</span></b><span style="font-size:10.0pt;color:black;">. </span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:10.0pt;color:black;">I decided to run <b>Replication Link Analyser</b> on each site locally with local admin permissions on SQL Server and the Site Server.&nbsp; That returned nothing wrong on either site. </span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:10.0pt;">I then decided to ensure that my primary site could process the messages, so I walked through the various log files:</span></li>
</ol><ol type="1" start="1">
<li class="MsoNormal" style="line-height:normal;"><b><span style="font-size:10.0pt;">ddm.log</span></b><span style="font-size:10.0pt;"> (processes the incoming device registration and gives the initial basic information you see in the console)</span></li>
<li class="MsoNormal" style="line-height:normal;"><b><span style="font-size:10.0pt;">dataldr.log </span></b><span style="font-size:10.0pt;">(processes the incoming hardware inventory being sent by the service via the connector)</span></li>
<li class="MsoNormal" style="line-height:normal;"><b><span style="font-size:10.0pt;">statsys.log </span></b><span style="font-size:10.0pt;">(processes the incoming state messages sent by the service via the connector that gives information about device compliance and app deployment)</span></li>
<li class="MsoNormal" style="line-height:normal;"><b><span style="font-size:10.0pt;">mpfdm.log </span></b><span style="font-size:10.0pt;">(at the primary site processes and routes messages from the connector to components)</span></li>
<li class="MsoNormal" style="line-height:normal;"><b><span style="font-size:10.0pt;">hman.log </span></b><span style="font-size:10.0pt;">(at the CAS (if you have one) routes messages to each device&rsquo;s assigned primary site for already enrolled clients or to the site configured in the Connector for new devices)</span></li>
</ol>
<ul>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:10.0pt;">All of the above checked out 100% and appeared as you&rsquo;d expect on a normal site.</span></li>
</ul>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">At this stage, all the usual stuff looked fine. DRS replication was after the recovery and all my components worked just fine. However, I did notice that one of my secondary sites was stuck setting itself up post recovery (I ignored this). It was now time to troubleshoot file replication.</span></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">File what?!</span></div>
<div style="line-height:normal;"><b><span style="font-size:10.0pt;color:black;">Background on the Intune Connector</span></b></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">Now &ndash; you might ask&hellip;&rdquo;I though all data moves using DRS in 2012? Why are you troubleshooting file replication!?&rdquo; It does&hellip;but remember that Site Data flows up the hierarchy to the CAS and is owned by the primary site. The primary site owns the device records in hybrid MDM. In order for the data to be stored in the database and for DRS to replicate it, we need a primary site to process it first. To do then, the CAS (or site hosting the Intune Connector) needs to replicate the messages from the service to a primary site. Which primary site is based on the following:</span></div>
<p class="CxSpFirst" style="text-indent:-18.0pt;line-height:normal;margin:0 0 .0001pt .5in;"><span style="font-size:10.0pt;color:black;">A.<span style="font:7.0pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span dir="LTR"></span><span style="font-size:10.0pt;color:black;">For <b>new </b>devices: messages are sent to the site configured in the Intune Connector, and those devices then become assigned to that site.</span></p>
<p class="CxSpLast" style="text-indent:-18.0pt;line-height:normal;margin:0 0 .0001pt .5in;"><span style="font-size:10.0pt;color:black;">B.<span style="font:7.0pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span dir="LTR"></span><span style="font-size:10.0pt;color:black;">For <b>already registered </b>devices: messages for that device are sent to the site to which the device is registered.&nbsp; </span></p>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">So&hellip;I went to go troubleshoot file replication in my environment like it Configuration Manager 2007. Ahh&hellip;the memories! :)</span></div>
<div style="line-height:normal;"><b><span style="font-size:10.0pt;color:black;">The troubleshooting &ndash; file replication?</span></b></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">I discovered this looked fine from the CAS down to the primary site. I went through all the usual logs:</span></div>
<p class="CxSpFirst" style="text-indent:-18.0pt;line-height:normal;margin:0 0 .0001pt .5in;"><span style="font-size:10.0pt;font-family:Symbol;color:black;">&middot;<span style="font:7.0pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span dir="LTR"></span><b><span style="font-size:10.0pt;color:black;">scheduler.log</span></b><span style="font-size:10.0pt;color:black;"> (schedules the transmission and ensure that sender scheduler currently allow communication)</span></p>
<p class="CxSpLast" style="text-indent:-18.0pt;line-height:normal;margin:0 0 .0001pt .5in;"><span style="font-size:10.0pt;font-family:Symbol;color:black;">&middot;<span style="font:7.0pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span dir="LTR"></span><b><span style="font-size:10.0pt;color:black;">sender.log</span></b><span style="font-size:10.0pt;color:black;"> (actually does SMB transmission)</span></p>
<div style="line-height:normal;"><b><span style="font-size:10.0pt;color:black;">The endgame</span></b></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">I was perplexed&hellip;everything was as it should be, so I decided to look at my primary site more closely. I then noticed that my CM installation directory was massive (more than 150GB in size)! That&rsquo;s definitely <i>not </i>normal. The files were in despooler on the primary site, loads of PCK files backlogged that related to some software update packages in my environment. </span></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">I opened up <b>despool.log</b> (as process is responsible for despooling (yes, autocorrect despooling and not despoiling!) incoming messages that have been queued up from other sites. I noticed that the log file was saying that it wasn&rsquo;t processing any file because the site was in maintenance mode. </span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Site currently is in maintenance mode and D:\Program Files\Microsoft Configuration Manager\inboxes\despoolr.box\receive\204kocaz.sni is not DRS init or certificate exchange package, backup it until site becomes active.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DESPOOLER 21/01/2015 11:11:06&nbsp;&nbsp; 2816 (0x0B00)</span></div>
<div style="margin-top:0cm;margin-right:0cm;margin-bottom:.0001pt;margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Waiting for ready instruction file....&nbsp;&nbsp;&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DESPOOLER 21/01/2015 11:11:06&nbsp;&nbsp; 2816 (0x0B00)</span></div>
<div style="margin-left:41.95pt;line-height:normal;"><span style="font-size:9.0pt;font-family:Consolas;color:black;">Site currently is in maintenance mode and D:\Program Files\Microsoft Configuration Manager\inboxes\despoolr.box\receive\204kncaz.sni is not DRS init or certificate exchange package, backup it until site becomes active.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size:9.0pt;font-family:Consolas;color:#e7e6e6;">SMS_DESPOOLER 21/01/2015 11:14:02&nbsp;&nbsp; 2816 (0x0B00)</span></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">Hmm&hellip;DRS replication was just fine both from the CAS and the primary.&nbsp; Then I remembered, that the secondary site wasn&rsquo;t healthy. I&rsquo;d ignored this because I wasn&rsquo;t concerned about the secondary site at that particular moment because it didn&rsquo;t participate in the hybrid MDM work the Intune Connector was doing. </span></div>
<div style="line-height:normal;"><b><span style="font-size:10.0pt;color:black;">The cause</span></b></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">The secondary site setup had caused the primary site to pause replication while DRS is setup &ndash; which should only take minutes to a couple of hours tops not days/weeks. Clearly my secondary site wasn&rsquo;t in a good state&hellip;luckily for me I didn&rsquo;t need it at the moment or for any tests&hellip;so I deleted it from the hierarchy and decided until I get time to either troubleshoot it further or build a new one I could live without it. Within a matter of seconds, despooler sprang to life and started processing my CAS packages and eventually processed my Intune Connector messages as well.&nbsp; These were routed to the right location. From there, within a few minutes I had the devices showing up in the console.</span></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">Hopefully my pain will be useful to you in the future and prevent or minimise any trouble you hit.</span></div>
<div style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10.0pt;color:#1f497d;"><br /> <br /> </span></div>
<div style="line-height:normal;"><span style="font-size:10.0pt;color:black;">&nbsp;</span></div>
<div><span style="font-size:10.0pt;line-height:107%;">&nbsp;</span></div>]]></content:encoded>
    </item>
    <item>
      <title>Enumerating Status Message Strings in PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/saudm/enumerating-status-message-strings-in-powershell</link>
      <pubDate>Mon, 19 Jan 2015 18:45:30 GMT</pubDate>
      <dc:creator><![CDATA[SaudM]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/saudm/2015/01/19/enumerating-status-message-strings-in-powershell/</guid>
      <description><![CDATA[If you found this blog looking for a list of status messages in Configuration Manager, a sample...]]></description>
      <content:encoded><![CDATA[<p>If you found this blog looking for a list of status messages in Configuration Manager, a sample output of the script described below is available <a href="https://gallery.technet.microsoft.com/Enumerate-status-message-6e7e1761/file/132671/1/ConfigMgr%202012%20R2%20Status%20Messages.xlsx">here (xlsx)</a>.</p>
<p>At some point last year&nbsp;I had written a <a href="https://gallery.technet.microsoft.com/Enumerate-status-message-6e7e1761">script </a>to help with some internal work we were doing analysing status message occurances. We wanted a lookup table of status message strings that could be passed to folks who only had visibility of status message IDs and severity. We had old vbscripts that would do this, but they relied on a deprecated automation library from an older version of the SDK. When I asked some software engineers about this, they said that the library was based on some Win32 APIs. I set out to see if I could get those APIs working from PowerShell. :)</p>
<p>Generating status message strings is done using the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).aspx">FormatMessage </a>function that is part of Win32 API. Generally function relies on a message table resource inside a DLL, a message ID and an array of insertion strings (placeholders). The function takes the MessageID looks it up in the tables inside the DLL, and then for each placeholder value inserts a string from the supplied string array.&nbsp; It then return the completed string back to the caller. Configuration Manager has 3 such message table resource DLLs: srvmsgs.dll (site), provmsgs.dll (provider) and climmsgs.dll (client). If you&#39;d like more information about these DLLs and status messages in Configuration Manager, see the CM SDK here: <a href="https://msdn.microsoft.com/en-us/library/jj218266.aspx">https://msdn.microsoft.com/en-us/library/jj218266.aspx</a> &amp; <a href="https://msdn.microsoft.com/en-us/library/jj218288.aspx">https://msdn.microsoft.com/en-us/library/jj218288.aspx</a>.</p>
<p>The script uses a feature of .NET called PInvoke (<a href="https://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx">Platform Invoke</a>) that allows you to call out to unmanaged code and ultimately the underlying platform. Since PowerShell allows you to run .NET code inside of a script nicely, we can combine these two elements to enable us to call the FormatMessage function from PowerShell.&nbsp; This is done by using the following example for FormatMessage:</p>
<p style="margin-left:30px;"><span style="font-family:courier new,courier;"><span style="color:#ff0000;">$sigFormatMessage</span> <span style="color:#c0c0c0;">=</span> <span style="color:#800000;">@&#39;</span></span><br /><span style="color:#800000;font-family:courier new,courier;">[DllImport(&quot;kernel32.dll&quot;)]</span><br /><span style="color:#800000;font-family:courier new,courier;">public static extern uint FormatMessage(uint flags, IntPtr source, uint messageId, uint langId, StringBuilder buffer, uint size, string[] arguments);</span><br /><span style="color:#800000;font-family:courier new,courier;">&#39;@</span></p>
<p>We need three different function ultimately to get this working. A LoadLibrary and GetModuleHandle are required to load the DLL then get a handle that DLL to pass to FormatMessage.&nbsp; Once we&#39;ve got the PInvoke code snippets, we need to tell PowerShell to load these as references via an <span style="color:#0000ff;font-family:courier new,courier;">Add-Type</span><span style="color:#000000;">&nbsp;call</span>. Here is the PowerShell call for Format Message again:</p>
<p style="margin-left:30px;"><span style="font-family:courier new,courier;"><span style="color:#ff0000;">$Win32FormatMessage</span> = <span style="color:#0000ff;">Add-Type</span> <span style="color:#000080;">-MemberDefinition</span> <span style="color:#ff0000;">$sigFormatMessage</span> <span style="color:#000080;">-name</span> <span style="color:#800000;">&quot;Win32FormatMessage&quot;</span> <span style="color:#000080;">-namespace</span> <span style="color:#800080;">Win32Functions</span> <span style="color:#000080;">-PassThru -Using</span> <span style="color:#800080;">System.Text</span></span></p>
<p>Once we have FormatMessage Win32 type declared in $Win32FormatMessage, we can call the FormatMessage function using the :: notation as follows:</p>
<p style="margin-left:30px;"><span style="font-family:courier new,courier;"><span style="color:#ff0000;">$result</span> = <span style="color:#ff0000;">$Win32FormatMessage</span>::FormatMessage(<span style="color:#ff0000;">$flags</span>, <span style="color:#ff0000;">$ptrModule</span>, <span style="color:#800080;">1073741824</span> -bor <span style="color:#ff0000;">$iMessageID</span>, <span style="color:#800080;">0</span>, <span style="color:#ff0000;">$stringOutput</span>, <span style="color:#ff0000;">$sizeOfBuffer</span>, <span style="color:#ff0000;">$stringArrayInput</span>)</span></p>
<p>You&#39;ll notice that the syntax of that last line looks weird. It looks weird because it isn&#39;t a .NET method call (and it certainly isn&#39;t any PowerShell like). This is because the Win32 API are C++ based, so we have to use the C++ syntax. The noticeable difference is that the output of the function is a return code integer and the string output is supplied as variable $stringOutput in the <em>input</em> to the function.&nbsp; Without going into pointers and C++ syntax history (things best left to Computer Science courses) just accept that&#39;s the way it works. :)</p>
<p>You&#39;ll also notice that I&#39;m using binary OR of <span style="font-family:Courier New;"><span style="color:#800080;">1073741824</span> </span>with the Message ID.&nbsp; The reason for this is that the status message ID in configuration manager are actually stored in our message resource DLLs as binary OR of their severity and status message ID. <span style="font-family:Courier New;"><span style="color:#800080;">1073741824</span> </span>happens to be the integer value for Informational severity.&nbsp;<span style="font-family:courier new,courier;"><span style="color:#800080;">2147483648</span> </span>is warning and <span style="color:#800080;font-family:courier new,courier;">3221225472 </span>is error if you&#39;re wondering. </p>
<p>That&#39;s the main/key parts to calling Win32 APIs via PowerShell for status message string matching. The script has additional logic to walk through the various permutations of status message IDs along with a bit of output and parameters. You can find the entire script <a href="https://gallery.technet.microsoft.com/Enumerate-status-message-6e7e1761">here</a> along with sample output for System Center 2012 R2 Configuration Manager <a href="https://gallery.technet.microsoft.com/Enumerate-status-message-6e7e1761/file/132671/1/ConfigMgr%202012%20R2%20Status%20Messages.xlsx">here (xlsx)</a>. </p>
<p>Hopefully that provides you with a good explaination of how to get status message strings in PowerShell, and generally how to call Win32 API from PowerShell.</p>
<p>Special thanks to <a href="https://www.mnscug.org/blogs/sherry-kissinger">Sherry Kissinger</a> and <a href="https://twitter.com/mniehaus">Michael Niehaus</a> for nudging me and reminding me to post this. :)</p>]]></content:encoded>
    </item>
    <item>
      <title>A new start</title>
      <link>https://docs.microsoft.com/archive/blogs/saudm/a-new-start</link>
      <pubDate>Mon, 19 Jan 2015 17:59:00 GMT</pubDate>
      <dc:creator><![CDATA[SaudM]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/saudm/2015/01/19/a-new-start/</guid>
      <description><![CDATA[Hi All,
Just re-introducing this blog. I&#39;d actually forgotten about the fact I&#39;d opened it...]]></description>
      <content:encoded><![CDATA[<p>Hi All,</p>
<p>Just re-introducing this blog. I&#39;d actually forgotten about the fact I&#39;d opened it 5 years ago. My team and I decided it would be better to have a team blog (The Manageability Guys, over at <a href="https://aka.ms/mgmtguys">https://aka.ms/mgmtguys</a>). Anyway, 5 years down the line and I&#39;ve changed roles in Microsoft and joined the Enterprise Client and Mobility org in Microsoft (the org is responsible for Microsoft Intune, Configuration Manager and Azure RemoteApp among others), as part of their Customer Acceleration Team. I&#39;ll probably be posting in various blogs as well as this one...but this one will be focused on the more geeky side of things. :)</p>
<p>I hope you enjoy it.</p>
<p>Regards,<br />Saud</p>]]></content:encoded>
    </item>
    <item>
      <title>Configuration Manager and Powershell</title>
      <link>https://docs.microsoft.com/archive/blogs/saudm/configuration-manager-and-powershell</link>
      <pubDate>Fri, 26 Jun 2009 12:26:26 GMT</pubDate>
      <dc:creator><![CDATA[SaudM_1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/saudm/2009/06/26/configuration-manager-and-powershell/</guid>
      <description><![CDATA[Hello,  This is my first blog post so I thought I would make it something vaguely interesting (to...]]></description>
      <content:encoded><![CDATA[<p>Hello,</p>  <p>This is my first blog post so I thought I would make it something vaguely interesting (to certain people).&#160; Powershell has been around for a while, though for most ConfigMgr people it remains a dark area.&#160; This is primarily due to the lack of samples explaining how to access the ConfigMgr WMI Provider on a Site Server.&#160; This post will walk you through the ConfigMgr SDK sample in VBScript and show a corresponding sample in Powershell.&#160; </p>  <p>I’ve written up the following sample to walk you through the process of converting the ‘How to Create a Static&#160; Collection’ sample in the SDK from C# or VBscript to Powershell.&#160; The sample is designed to work locally on the site server with a site code of LAB, but establishing a connection to a remote provider should not prove too difficult.&#160; We are using some of the .NET System.Management classes directly to give us direct access to WMI.&#160; This makes things easier to maps back to C#/VBScript samples in the SDK.</p>  <p>The first thing we need to do, is instantiate an instance of the SMS_Collection class.</p>  <p></p>  <blockquote>   <p><font face="Lucida Console">$collClass = [WMIClass] “root\SMS\Site_LAB:SMS_Collection”        <br /></font><font face="Lucida Console">$collInstance = $collClass.CreateInstance()</font></p> </blockquote>  <p><font face="ver">With that done, we can populate all settings required for our collection.</font></p>  <blockquote>   <p><font face="Lucida Console">$collInstance.Name = “FooCollection1”        <br /></font><font face="Lucida Console">$collInstance.OwnedByThisSite = $true</font></p> </blockquote>  <p><font face="ver">You may want to set additional properties for this collection.&#160; From there, we store our instance of the SMS_Collection class, and use the returned object to tell us the path of the new instance.&#160; We will need this later on. To properly handle the Path property we need to cast the type of object returned using [WMI].</font></p>  <p><font face="Lucida Console"></font></p>  <blockquote>   <p><font face="Lucida Console">$collPath = $collInstance.Put()        <br /></font><font face="Lucida Console">$collection = [WMI] $collPath.Path</font></p> </blockquote>  <p><font face="ver">We now follow the same instantiation process used above to create an instance of SMS_CollectToSubCollect class.&#160; The SMS_CollectToSubCollect class is required to tie our new collection to an existing collection so that is actually shows up in the console.&#160; This can be any existing collection’s ID or the special ID of COLLROOT to appear under the ‘Collections’ node.&#160; In our case, we are using COLLROOT for simplicities sake.</font></p>  <blockquote>   <p><font face="Lucida Console">$subcollClass = [WMIClass] “root\SMS\Site_LAB:SMS_CollectToSubCollect”        <br /></font><font face="Lucida Console">$subcollInstance = $subcollClass.CreateInstance()</font></p> </blockquote>  <p><font face="ver">So we set our relationship class (SMS_CollectToSubCollect) parentCollectionID property to COLLROOT.&#160; Again, this could be any existing collection ID.</font></p>  <p><font face="Lucida Console">&#160;&#160;&#160;&#160;&#160; $subcollInstance.parentCollectionID = “COLLROOT”</font></p>  <p><font face="ver">We now need to link our relationship class’s subCollectionID property to our new collection’s ID.&#160; Since this is assigned by the provider based on existing collection IDs, we much reference it using the new collection’s object’s CollectionID property and store the new instance of SMS_CollectToSubCollect, as such:</font></p>  <blockquote>   <p><font face="Lucida Console">$subcollInstance.subCollectionID = $collection.CollectionID        <br /></font><font face="Lucida Console">$subcollection = $subcollInstance.Put()</font></p> </blockquote>  <p><font face="verd">Now that we have a new collection linked to the ‘Collections’ root node, we ought to put something in there, so let’s create a direct membership rule for a computer called ‘Test’.&#160; We follow the same WMI connection process using the [WMIClass] cast and then instantiate SMS_CollectionRuleDirect. We also set the ResourceClassName property to “SMS_R_System” to let ConfigMgr know that we want to find System resources.</font></p>  <blockquote>   <p><font face="Lucida Console">$directruleClass = [WMIClass] “root\SMS\Site_LAB:SMS_CollectionRuleDirect”        <br /></font><font face="Lucida Console">$directruleInstance = $directruleClass.CreateInstance()</font><font face="Lucida Console">$directruleInstance.ResourceClassName = “SMS_R_System”</font></p> </blockquote>  <p><font face="ver">With that done, we can use the Powershell Get-WmiObject commandlet to find the ‘Test’ computer. As you may have noticed, this is the first time we are going to be using a commandlet in our PowerShell script. Anyway, we are going to assume that we only have one instance returned (meaning that there is only one computer object (System resource instance) in the database).&#160; In reality there may be multiple objects with similar names, so you will want to either filter them more or use a foreach loop (foreach-object commandlet) to walk through the collection of returned computer objects.</font></p>  <blockquote>   <p><font face="Lucida Console">$computer = Get-WmiObject –class “SMS_R_System” – namespace “root\SMS\Site_LAB” –Filter “NetbiosName = ‘Test’”</font></p> </blockquote>  <p><font face="ver">All we need to do is link the ResourceID property in the found computer object with the rule object’s ResourceID property, as such:</font></p>  <blockquote>   <p><font face="Lucida Console">$directruleInstance.ResourceID = $computer.ResourceId</font></p> </blockquote>  <p><font face="ver">Then, we call the AddMembershipRule method from our new collection, and tie it to the new Direct Memebership rule instance we created just now.</font></p>  <blockquote>   <p><font face="Lucida Console">$collection.AddMembershipRule($directruleInstance)</font></p> </blockquote>  <p><font face="ver">Finally, we call the RequestRefresh method to ask Collection Evaluator in the site to update the collection membership for our new collection and that it!</font></p>  <blockquote>   <p><font face="Lucida Console">$collection.RequestRefresh()</font></p> </blockquote>  <p><font face="ver">Assuming I haven’t bored you to death with my comments so far, this is what you should have in the end:</font></p>  <blockquote>   <p><font face="Lucida Console">$collClass = [WMIClass] “root\SMS\Site_LAB:SMS_Collection”        <br />$collInstance = $collClass.CreateInstance()         <br />$collInstance.Name = “FooCollection1”         <br />$collInstance.OwnedByThisSite = $true         <br />$collPath = $collInstance.Put()         <br />$collection = [WMI] $collPath.Path         <br />$subcollClass = [WMIClass] “root\SMS\Site_LAB:SMS_CollectToSubCollect”         <br />$subcollInstance = $subcollClass.CreateInstance()         <br />$subcollInstance.parentCollectionID = “COLLROOT”         <br />$subcollInstance.subCollectionID = $collection.CollectionID         <br />$subcollection = $subcollInstance.Put()         <br />$directruleClass = [WMIClass] “root\SMS\Site_LAB:SMS_CollectionRuleDirect”         <br />$directruleInstance = $directruleClass.CreateInstance()         <br />$directruleInstance.ResourceClassName = “SMS_R_System”         <br />$computer = Get-WmiObject –class “SMS_R_System” – namespace “root\SMS\Site_LAB” –Filter “NetbiosName = ‘Test’”         <br />$directruleInstance.ResourceID = $computer.ResourceId         <br />$collection.AddMembershipRule($directruleInstance)         <br />$collection.RequestRefresh()</font></p> </blockquote>  <p>Hopefully, the above sample will be useful in letting you understand how you can use PowerShell with ConfigMgr’s WMI Provider.&#160; If this has been helpful to you, please let me know by commenting below.</p>]]></content:encoded>
    </item>
  </channel>
</rss>