Header Ads


How To use PowerShell DSC To Install and configure Hyper-V

In this article I’ll show you how to use PowerShell Desired State Configuration (DSC) to install and configure windows Hyper-V on windows 2012 Server.

DSC had been released with Windows Server 2008 R2 under PS framework 4.0 and continue with major enhancement in windows 2012, also comes with Server 2016 which was released recently.

To Know more about PowerShell DSC please refer my old article DSC Desired State Configuration

Using DSC we can do many process automation in Windows and Linux, also make sure server configuration is always compliant as per your desired config.

To automate any process using dsc we need to follow three easy steps, first need to create configuration block using Pre configured Microsoft Module or custom module. second compile mof file using configuration block for target node and last step need to push/pull configuration using those mof files against target node.

In my case i am using custom DSC module to install and configure Hyper-V.

I have Windows 2012 R2 server , Host name is HV-01.test.lab

  • Create config bloc using custom module.

  • Compile configuration in mof file for target node.

  • push/pull compiled mof to target server to install Hyper-V. 

  • Once you done with deployment, it will give you progress output.

  • Now you can access the Hyper-V Manager console.

Congratulations!! You successfully installed hyper-v using PowerShell DSC .

In next article i will show you how to add new host in Hyper-V and create new guest servers using PowerShell DSC.

No comments:

Systemadminworld. Powered by Blogger.