PowerShell is amazing, it is now possible to do all those things I know would be possible, but did require compiled code or time I don’t have (Still working as an consultant in the real world you know). In my line of work besides automation, flexibility is one other keyword and that is very often used in conjuction with Windows Server deployment. Now, Windows Server is also amazing, it is a multipurpose operating system and multipurpose also means that while client deployment is pretty standard these days, server deployment is not even close to that. In SCCM we have great OS Deployment (even better with MDT integration), but in many cases I’m not allowed to use it. MDT is very flexible and many orgs are using MDT for server deployment and SCCM for clients and they have their reasons, but MDT lacks some of the features that SCCM/MDT does have. We also have an upcoming star and that is SCVMM, while SCVMM has some of the benefits that SCCM have but MDT does not have, well you get the point. But, if you could have bits and pieces from each and every one, and does not require an investment in System Center knowledge, what about having only Active Directory. Windows Deployment Services, DHCP/DNS, MDT and a PowerShell script? Wouldn’t that be nice?
The parts
It is not that hard to setup and configure, but still, there is a lot of moving parts and you need to understand them all, therefore it is dived in the following parts for more details
(note I’ll add the links as soon as I have written them, ok)
- OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 1–Getting the Hardware info)
- OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 2–Pre-stage device in AD)
- OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 3–Pre-stage device in MDT)
- OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 4–Controlling Power remote)
- OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 5–Controlling Drivers)
- OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 6–Apps and Firmware)
The Script
If you know this stuff and just need the script, download it from here: http://sdrv.ms/JCo5bO
Run Import-Module .\ServerDeployment-v1.psm1 –Verbose to import the module
run Get-Module to verify
To see all the functions you now have, just run Get-Command – Module ServerDeployment-v1
to get all the command syntax, just type Get-Command -Module ServerDeployment-v1 –Syntax
There is builtin help with command samples, just use Get-Help Command to get the help
Note: The script will assume certain things:
- Active Directory – Installed, configured and working
- Windows Deployment Services – Installed, configured and working
- Microsoft Deployment Toolkit 2013 – Installed, configured and working
- HPs PowerShell Module for iLO – http://h20565.www2.hp.com/portal/site/hpsc/public/psi/swdHome/?cc=us&lang=en&sp4ts.oid=5440658&ac.admitted=1388336774596.876444892.492883150
- Michael Niehaus PowerShell module for the MDT database http://blogs.technet.com/b/mniehaus/archive/2009/05/15/manipulating-the-microsoft-deployment-toolkit-database-using-powershell.aspx
- SQL Express – Installed, configured and working
There are just a few hardcoded paths, its for the two modules (yes, there are others way to solve the problem)
Make sure the dependent POSH modules are located here:
- Import-Module ‘C:\Program Files\Hewlett-Packard\PowerShell\Modules\HPiLOCmdlets’ -ErrorAction Stop
- Import-Module ‘C:\Program Files\Microsoft Deployment Toolkit\MDTDB.psm1’ -ErrorAction Stop
One last thing, this is not for beginners, you really need to understand the bits and pieces this time.
/mike
Categories: Deployment, iLO, MDT, PowerShell, Windows Deployment Services, Windows Server 2012 R2
3 replies »