Quantcast
Channel: Virtual Machine Manager – General forum
Viewing all articles
Browse latest Browse all 4089

Deploying multiple VM's from a VM Template in SCVMM error term 'New-SCVirtualMachine' is not recognized

$
0
0

Hello,

i'm trying to create multiple VM's from a VM Template in SCVMM using the following Power Shell Script

[int]$VMcount = Read-host “Input Number of VMs”

$VMTemplate = Read-host "Input VMTemplate Name"
$VMName = Read-host “Input Base Name” 
$VMHost = Read-host "Input Host Name"
$VMPath = Read-host "Input VM Path (example: C:\Clusterstorage\Volume1)"

$Total = 1

While ($total -le $VMCount) {$NewVMName = $VMName-” + $total

Write-Output $virtualMachineConfiguration

New-SCVirtualMachine -Name $NewVMName -VMHost "$VMHost" -path "$VMPath" -VMTemplate "$VMTemplate" -ReturnImmediately -DelayStartSeconds “0"

$Total++

}

#End

When running the .ps1 file i'm getting the following error:

"New-SCVirtualMachine : The term 'New-SCVirtualMachine' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again"

is someone can advise what is wrong with this power shell script?

i'm using microsoft system center 2012

Thanks.






Viewing all articles
Browse latest Browse all 4089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>