Deployment

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

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

Categories: Deployment, MDT, PowerShell

Tagged as:

4 replies »

Leave a comment

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