Flappy Shoot

Wednesday, February 3, 2010

Sample script generated by SCVMM 2008 while creating a new VM

# ------------------------------------------------------------------------------
# New Virtual Machine Script
# ------------------------------------------------------------------------------
# Script generated on Thursday, February 04, 2010 6:39:13 AM by Virtual Machine Manager
#
# For additional help on cmdlet usage, type get-help
# ------------------------------------------------------------------------------


New-VirtualNetworkAdapter -VMMServer localhost -JobGroup 0ae875e5-99a6-4ae8-9cb5-c3375328954c -PhysicalAddressType Dynamic -VirtualNetwork "FP7 Network" -VLanEnabled $false


New-VirtualDVDDrive -VMMServer localhost -JobGroup 0ae875e5-99a6-4ae8-9cb5-c3375328954c -Bus 1 -LUN 0

$CPUType = Get-CPUType -VMMServer localhost where {$_.Name -eq "2.40 GHz Xeon"}


New-HardwareProfile -VMMServer localhost -Owner "MCNMENA\tariq.admin" -CPUType $CPUType -Name "Profilea0eef8f3-59c2-4990-994d-c524ac2f02fe" -Description "Profile used to create a VM/Template" -CPUCount 2 -MemoryMB 1500 -RelativeWeight 100 -HighlyAvailable $false -NumLock $false -BootOrder "CD", "IdeHardDrive", "PxeBoot", "Floppy" -LimitCPUFunctionality $false -JobGroup 0ae875e5-99a6-4ae8-9cb5-c3375328954c



New-VirtualDiskDrive -VMMServer localhost -IDE -Bus 0 -LUN 0 -JobGroup 0ae875e5-99a6-4ae8-9cb5-c3375328954c -Size 20480 -Dynamic -Filename "Exch2010_disk_1"

$VMHost = Get-VMHost -VMMServer localhost where {$_.Name -eq "fpdhpv02.mcnmena.local"}
$HardwareProfile = Get-HardwareProfile -VMMServer localhost where {$_.Name -eq "Profilea0eef8f3-59c2-4990-994d-c524ac2f02fe"}
$OperatingSystem = Get-OperatingSystem -VMMServer localhost where {$_.Name -eq "64-bit edition of Windows Server 2008 Enterprise"}

New-VM -VMMServer localhost -Name "Exch2010" -Description "" -Owner "MCNMENA\tariq.admin" -VMHost $VMHost -Path "E:\VirtualArea" -HardwareProfile $HardwareProfile -JobGroup 0ae875e5-99a6-4ae8-9cb5-c3375328954c -RunAsynchronously -OperatingSystem $OperatingSystem -RunAsSystem -StartAction TurnOnVMIfRunningWhenVSStopped -DelayStart 0 -StopAction SaveVM

No comments: