{"id":204,"date":"2018-07-19T16:33:55","date_gmt":"2018-07-19T16:33:55","guid":{"rendered":"http:\/\/107.181.191.134\/?p=204"},"modified":"2018-07-19T16:33:55","modified_gmt":"2018-07-19T16:33:55","slug":"creating-a-new-lab-for-practicing-the-70-740-windows-2016-exam","status":"publish","type":"post","link":"https:\/\/certcent.io\/index.php\/2018\/07\/19\/creating-a-new-lab-for-practicing-the-70-740-windows-2016-exam\/","title":{"rendered":"Creating a new lab for practicing the 70-740 Windows 2016 Exam."},"content":{"rendered":"<p>It&#8217;s essential to have a good lab for testing different scenarios with different features of Windows 2016.  Doing this usually requires lots of pointing and clicking, downloading, and wasting time doing repetitious things.  Saving this time to use for more preparing for the exam can be solved with a little knowledge of Powershell.<br \/>\nAfter hosing my lab that was created a few days ago, I decided it would be advantageous to write a small script that utilizes all the cool commands already included in my Windows 10 Professional computer.  Here&#8217;s is what I came up with.<br \/>\n# Description: Takes user&#8217;s input of how many VMs and switchname, then creates VMs with 2016 Server ISO.<br \/>\n# VMs are Generation 2 by default<br \/>\n# Change drive size in command &#8220;New-VHD&#8221;<br \/>\n# Created by: John Plane, 7\/2018<br \/>\n# Troubleshooting: Please confirm you are using a compatible version of Windows 10 that supports all these Powershell commands.  Obviously Hyper-V will need to be installed.  Check the paths and confirm they exist, I didn&#8217;t setup any check for prerequisites, so it&#8217;s easy for this to fail without warning.<br \/>\nwrite-host &#8220;Enter number of VMs to create?:&#8221;<br \/>\n$number = read-host<br \/>\nwrite-host &#8220;Enter size of drives?:&#8221;<br \/>\n$drivesize = read-host<br \/>\nwrite-host &#8220;Enter switch name?:&#8221;<br \/>\n$switchname = read-host<br \/>\nnew-vmswitch -Name $switchname -switchtype internal<br \/>\n$drivenames = &#8220;data&#8221;,&#8221;cluster&#8221;,&#8221;boot&#8221;<br \/>\n$numbers = 1..$number<br \/>\nforeach ($i in $numbers)<br \/>\n{<br \/>\nnew-vm -name 2016-lab$i -generation 2 -path d:\\vm\\2016\\2016-lab$i<br \/>\nAdd-VMDvdDrive -VMName 2016-lab$i -path &#8220;D:\\ISO\\Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO&#8221;<br \/>\nConnect-VMNetworkAdapter -VMName 2016-lab$i -SwitchName $switchname<br \/>\nforeach ($z in $drivenames)<br \/>\n{<br \/>\nnew-vhd d:\\vm\\2016\\2016-lab$i\\$z$i.vhdx -SizeBytes 10GB -dynamic<br \/>\nadd-vmharddiskdrive -vmname 2016-lab$i -path d:\\vm\\2016\\2016-lab$i\\$z$i.vhdx }<br \/>\n}<br \/>\nGood luck and keep learning!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s essential to have a good lab for testing different scenarios with different features of Windows 2016. Doing this usually requires lots of pointing and clicking, downloading, and wasting time doing repetitious things. Saving this time to use for more preparing for the exam can be solved with a little knowledge of Powershell. After hosing&hellip; <a class=\"more-link\" href=\"https:\/\/certcent.io\/index.php\/2018\/07\/19\/creating-a-new-lab-for-practicing-the-70-740-windows-2016-exam\/\">Continue reading <span class=\"screen-reader-text\">Creating a new lab for practicing the 70-740 Windows 2016 Exam.<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts\/204"}],"collection":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/comments?post=204"}],"version-history":[{"count":0,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts\/204\/revisions"}],"wp:attachment":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/media?parent=204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/categories?post=204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/tags?post=204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}