End to End Automation with MDT Managing your reference images. Fred Bainbridge @FredBainbridge fbainbridge@skylinetechnologies.com Daniel Ratliff @PotentEngineer www.PotentEngineer.com Fred Bainbridge Minneapolis, Minnesota Sr. Infrastructure Engineer #MMSMOA 15+ years experience. MNSCUG, President FredBainbridge.com @FredBainbridge Daniel Ratliff @potentengineer Louisville, KY Technology Architect #MMSMOA 10+ years experience Co-founder LouSMUG.org Get Involved (Keep the internet awesome) Join or Start your local user group. Participate in forums • Technet • MyItForum • Etc Keep a blog. What this is not How to build a reference image. A ConfigMgr OSD deep dive. See: Hacking the Task Sequence How to write PowerShell • Learn PowerShell in a Month of Lunches What this is Solving a business problem. Automating the reference image creation..…and all that other crap. Utilizing simple PowerShell to make life easier. Why MDT? Simple PowerShell friendly Free It just works! Defining the Business Problem What is impacted? • Build Time, accuracy, etc. Why is this needed? • Security Requirements, Lifecycle, etc. What is the $ Metric? • Hours / Month? Hours / Build? etc. Getting Starting Identify what you need to automate. ( • There is more than just the OS image. Example Crap - • Setup a virtual machine • Stage the device in WDS • Start the reference image build • Update a pilot or production task sequence • Update Azure image • Clean up • Log your actions ) Technical Lab Details Hyper-V VMs • Server1 MDT 2013 WDS w/ PXE - Respond only to known hosts - Not AD integrated • Server 2 DHCP, DNS • [TSID] – VM for the reference build. - Pre determined MAC address. MDT Details Full CustomSettings.ini Monitoring must be enabled. The task sequence ID will match the VM name. Demo Automate! MDT Image automation with Orchestrator Built off Fred’s scripts • Same LAB setup • Uses SCOrch for all automation • Uses PowerShell for all runbook steps • Leverages PowerShell 2.0 for native compatibility • Modified to function with SCOrch • Reference scripts included for testing • Single runbook for simplicity’s sake • Nothing left behind except captured .wim MDT Details – CustomSettings.ini Slightly modified CustomSettings.ini • .wim is timestamped (TSID_MMDDYYYY.wim) • Runbook parameter must match MAC • Runbook parameter must match Task Sequence ID SCOrch Details – Runbook All steps return Result variable: Success or Fail • Only continue on Success Easily modified for value adds • Send an email on success/fail? • Add .wim to deployment task sequence? Required parameters • MDT server • MDT deployment share • MDT task sequence ID • WDS server • Hyper-V server • Hyper-V switch name • Hyper-V VM root path • Hyper-V VM MAC address SCOrch Details – Runbook Demo Automate with SCOrch! Other ways to Automate SMA Azure Automation Service Manager (any Service Management Tool) Mostly Automated Phase 2 / The next level Incident / Request Management • This one matters the most. Self Service Portal SharePoint/Collaboration Notifications Test Builds Scheduling Logic Discussion - Who said it? “Building golden images is a bad practice – stop now” https://twitter.com/hypervserver/status/659505395472441345 -Jeffrey Snover References PS Module and Example Scripts http://1drv.ms/1NxyX9l Credentials https://technet.microsoft.com/en-us/library/hh849815.aspx Invoke-Command http://fredbainbridge.com/index.php/powershell/29-invokecommand-example Johan http://deploymentresearch.com/ PowerShell Function Outline (ctrl+j) https://technet.microsoft.com/en-us/magazine/hh360993.aspx References continued Johan Arwidmark - Building references images like a boss! http://deploymentresearch.com/Research/Post/357/Building -reference-images-like-a-boss Ryan Andorfer - MMS 2014 - Future of SCOrch http://sched.co/1EkueSo Hey Scripting Guy! – Use PowerShell to automate MDT http://blogs.technet.com/b/heyscriptingguy/archive/2011/12/ 31/learn-how-to-use-powershell-to-automate-mdtdeployment.aspx Discuss… Ask your questions-real world answers! Plenty of time to engage, share knowledge. Evaluations: Please provide session feedback by clicking the EVAL button in the scheduler app (also download slides). One lucky winner will receive a free ticket to the next MMS! SPONSORS Session Title: Automating End to End Image Creation with MDT and PowerShell