The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

PowerShell is King – I need to monitor OS Deployment in MDT 2012 not using Deployment Workbench

Posted by Mikael Nystrom on March 6, 2013


You are using MDT 2012 Update 1 (Lite Touch or Zero Touch), you have enabled MDT monitoring and you would like to know the current status of the OSD deployment, but you would like to read directly from the OData feed using PowerShell and maybe get a nice grid-view. Now, you might wonder why and that is easy, basically every blog post I have seen on this topic assumes you are logged on to the server where the MDT Workbench exists, but that is not always the case.


Use PowerShell to get the data using the Invoke-RESTMethod, convert and read it as a Grid view

Display on screen in text


Display using grid view:


PowerShell command to execute:

You need to change MDT01 to the name of your deployment server for this to work.

$URL = "http://MDT01:9801/MDTMonitorData/Computers"

function GetMDTData {
  $Data = Invoke-RestMethod $URL

  foreach($property in ($ ) {
    New-Object PSObject -Property @{
      Name = $($property.Name);
      PercentComplete = $($property.PercentComplete.’#text’);
      Warnings = $($property.Warnings.’#text’);
      Errors = $($property.Errors.’#text’);
      DeploymentStatus = $(
        Switch ($property.DeploymentStatus.’#text’) {
        1 { "Active/Running" }
        2 { "Failed" }
        3 { "Successfully completed" }
        Default { "Unknown" }
      StartTime = $($property.StartTime.’#text’) -replace "T"," ";
      EndTime = $($property.EndTime.’#text’) -replace "T"," ";

GetMDTData | Select Name, DeploymentStatus, PercentComplete, Warnings, Errors, StartTime, EndTime | Out-GridView

Download script here:


7 Responses to “PowerShell is King – I need to monitor OS Deployment in MDT 2012 not using Deployment Workbench”

  1. Dan said

    That’s awesome, Mike. Thanks a lot.

  2. Sem said

    This looks really great!
    Have to give it a try.

    Is there any refresh interval?

  3. […]… […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: