The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

PowerShell is King – I’m using MDT 2012 to deploy OS, did the deployment went well?

Posted by Mikael Nystrom on January 16, 2013

Scenario:

You are using MDT 2012 Update 1 (Lite Touch or Zero Touch), you have enabled MDT monitoring and you would like to know if the deployment of the machine was ok.

Solution:

Use PowerShell to read from the event log, since the MDT Monitor feature will write in the event log

Display on screen in text

Get-EventLog -ComputerName MDT01 -LogName Application -Source MDT_Monitor | select TimeGenerated, EntryType, InstanceID, Message | Format-Table

image

Display using the gridview

Get-EventLog -ComputerName MDT01 -LogName Application -Source MDT_Monitor | Out-GridView

image

Display using HTML

Get-EventLog -ComputerName MDT01 -LogName Application -Source MDT_Monitor | select TimeGenerated, EntryType, InstanceID, Message | ConvertTo-Html -title "OS Deployment status: $ENV:COMPUTERNAME" -body (get-date) -pre "<H1>OS Deploymentstatus for: $ENV:COMPUTERNAME </H1><P>Generated by Corporate IT</P>" -post "<P>For details, contact Corporate IT.</P>" > $ENV:TEMP\MDTstatus.htm; Invoke-Item $ENV:TEMP\MDTstatus.htm

image

/mike

4 Responses to “PowerShell is King – I’m using MDT 2012 to deploy OS, did the deployment went well?”

  1. Thanks for sharing Mike.

    You Rock.

    //Thomas Strøbæk

  2. Sean Kilmer said

    perfect :D

  3. Terence said

    Fantasic Mike, thanks a lot

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

 
%d bloggers like this: