• About

Information Dynamics

Information Dynamics

Monthly Archives: July 2019

AutomatedLab PS modules

20 Saturday Jul 2019

Posted by GIRISH SRINIVASA in PowerShell

≈ 1 Comment

Automated lab helps in setting up experimental lab environments quickly. The link  provides comprehensive guide and several sample scenario scripts are provided to help one get started.

To set up a simple Lab for development purposes the following script can be used.

New-LabDefinition -Name iDynamicsDev -ReferenceDiskSizeInGB 100 -Path ‘C:\iDynamics\Dev’ -DefaultVirtualizationEngine HyperV

Add-LabVirtualNetworkDefinition -Name Lab0
Add-LabVirtualNetworkDefinition -Name ‘Default Switch’ -HyperVProperties @{ SwitchType = ‘Default Switch’; AdapterName = ‘Wi-Fi’ }

Add-LabMachineDefinition -Name DC1 -Memory 2GB -OperatingSystem ‘Windows Server 2016 Datacenter (Desktop Experience)’ -Roles RootDC -Network Lab0 -DomainName idynamics.dev

$netAdapter = @()
$netAdapter += New-LabNetworkAdapterDefinition -VirtualSwitch Lab0
$netAdapter += New-LabNetworkAdapterDefinition -VirtualSwitch ‘Default Switch’ -UseDhcp
Add-LabMachineDefinition -Name Router1 -Memory 2GB -OperatingSystem ‘Windows Server 2016 Datacenter (Desktop Experience)’ -Roles Routing -NetworkAdapter $netAdapter -DomainName idynamics.dev

Add-LabMachineDefinition -Name Client1 -Memory 6GB -Network Lab0 -OperatingSystem ‘Windows Server 2016 Datacenter (Desktop Experience)’ -DomainName idynamics.dev

Install-Lab

Show-LabDeploymentSummary -Detailed

The above script will create three VM’s

 

  1. DC1 > Domain controller with domain name idynamics.dev
  2. Router1 > joined to domain idynamics.dev and having access to internet
  3. Client1 > joined to domain idynamics.dev but with no internet access.

The definition files are stored as xml files at C:\idynamics\dev and the file Lab.xml will have all information relating to the LabDefinition iDynamicsDev. 

The cmdLet Import-Lab -Path C:\idynamics\dev\Lab.xml will indicate how may VM’s are hosted in HyperV

AutomatedLab.png

Removing the Lab is done by invoking the cmdLet Remove-Lab

AutomatedLab1

 

Result of successfully removing the lab:

  1. C:\AutomatedLab-VMs will have only the base image
  2. C:\idynamics\dev and the associated config files will be removed

AutomatedLab2

 

 

 

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • November 2021
  • August 2021
  • July 2021
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • March 2019
  • September 2018
  • February 2018
  • January 2018
  • December 2017
  • January 2017
  • August 2016
  • January 2016
  • November 2015
  • October 2015
  • September 2015
  • November 2014
  • October 2014
  • September 2014
  • July 2014

Categories

  • ADCS
  • ADFS
  • ADFS 4.0
  • ASP.NET Core
  • Azure
  • Azure AD
  • Azure AD DS
  • Azure B2C
  • CRM 2011
  • CRM2013
  • CRM2015
  • CRM2016
  • Docker
  • Dynamics 365
  • Dynamics 365 CE Online
  • Dynamics 365 Portals
  • Dynamics CE 9
  • Knockout and TypeScript
  • OAuth2.0/OpenIDConnect
  • Power Platform
  • PowerApps
  • PowerShell
  • SharePoint 2019
  • Spkl
  • Uncategorized
  • WebAPI
  • Windows Server 2012
  • Windows Server 2016

Meta

  • Register
  • Log in

Blog at WordPress.com.

  • Follow Following
    • Information Dynamics
    • Already have a WordPress.com account? Log in now.
    • Information Dynamics
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...