EKardinal's Accepted Solutions

Hi assuming this is your csv file     "name","ip","netmask","gateway","dns","networkName"     "TESTSRV1","10.244.186.136","255.255.255.0","10.244.186.1","10.244.37.25;10.244.37.26","VLAN1... See more...
Hi assuming this is your csv file     "name","ip","netmask","gateway","dns","networkName"     "TESTSRV1","10.244.186.136","255.255.255.0","10.244.186.1","10.244.37.25;10.244.37.26","VLAN186_QA" you have one problem. You can't save any arrays into a csv and make powershell recognize them natively. Instead, use a custom delimiter (not the same as csv uses!) and split them - at import - into an array. Look at the semicolon between the two dns servers.     $newVmList = Import-Csv test.csv | Select-Object -Property "name", "ip", "netmask", "gateway", @{Name = "dns"; Expression = {$_.dns -split ";"} }, "networkName" The resulting object looks like this     name       : TESTSRV1     ip         : 10.244.186.136     netmask    : 255.255.255.0     gateway    : 10.244.186.1     dns        : {10.244.37.25, 10.244.37.26} <-- Array     networkName: VLAN186_QA Regards Emanuel
My console output, tested on one VM with two external nics and a internal 'dummy' interface Name                               IP                                  MAC ----                    ... See more...
My console output, tested on one VM with two external nics and a internal 'dummy' interface Name                               IP                                  MAC ----                                   --                                    --- VM1                                192.168.1.1                     00:50:56:xx:xx:xx VM1                                192.168.2.1                     00:50:56:xx:xx:xx VM1                                192.x.x.xxx                     xx:xx:xx:xx:xx:xx Do you see any of the expected addresses in the VM summary using vSphere Client? Ah sorry, I forgot about the PS 3.0 requirement. You could put every entry into an array and export the whole at the end of the script.      $out = @()      $VMs = Get-Datacenter $DC | get-vmhost | Get-VM      foreach ($VM in $VMs) {          $VMx = Get-View $VM.ID          $HW = $VMx.guest.net          foreach ($dev in $HW)          {              foreach ($ip in $dev.ipaddress)              {                  $out += $dev | select @{Name = "Name"; Expression = {$vm.name}}, @{Name = "IP"; Expression = {$ip}}, @{Name = "MAC"; Expression = {$dev.macaddress}}              }          }      }      $out | Export-Csv -NoTypeInformation -Path "VM-IP-Info.csv" Regards Emanuel
Hi, foreach($vm in (Get-VM | Where-Object { ($_.PowerState -eq "PoweredOff") -and ($_.Guest.GuestId -eq "windows7Server64Guest") })) {      Enable-MemHotAdd $vm      Enable-vCpuHotAdd $v... See more...
Hi, foreach($vm in (Get-VM | Where-Object { ($_.PowerState -eq "PoweredOff") -and ($_.Guest.GuestId -eq "windows7Server64Guest") })) {      Enable-MemHotAdd $vm      Enable-vCpuHotAdd $vm } http://www.vmware.com/support/developer/converter-sdk/conv50_apireference/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html windows7Server64Guest is the equivalent to Microsoft Windows Server 2008 R2 (64-bit) You could also use $_.Guest.OSFullName which should be the same as the Guest OS selection values. In the above case Microsoft Windows Server 2008 R2 (64-bit) Regards Emanuel
Yes, you are right. By specifying the -VM (Get-VM $modelVM) param you create the new VM from an existing one. Just change the params of the New-VM cmdlet according to your needs and leave t... See more...
Yes, you are right. By specifying the -VM (Get-VM $modelVM) param you create the new VM from an existing one. Just change the params of the New-VM cmdlet according to your needs and leave the -VM away. This one creates your VMs based on a template and a customization specification. $esxName = "prodh1.MYDOMAIN.local" $template = "W2K8R2SP1" $datastore = "IOMEGA" $newVmList = "TEST-SRV01", "TEST-SRV02", "TEST-SRV03", "TEST-SRV04" $custSpec = "W2K8R2SP1" $location = "_Tobedeleted" $taskTab = @{} # Create all the VMs specified in $newVmList foreach($Name in $newVmList) {      $taskTab[(New-VM -Name $Name -VMHost (Get-VMHost -Name $esxName) -Template $template -Datastore $datastore -OSCustomizationSpec $custSpec -Location $location -RunAsync).Id] = $Name } Of course, you can write it like before. Then you have to change only the variable $newVmList in the original script. foreach($Name in $newVmList) {      $taskTab[(New-VM -Name $Name -VMHost "prodh1.MYDOMAIN.local" -Template" W2K8R2SP1" -Datastore" IOMEGA" -OSCustomizationSpec "W2K8R2SP1" -Location "_Tobedeleted" -RunAsync).Id] = $Name } You also need to insert the remaining part with the while loop and your network customizations! http://www.lucd.info/2010/02/21/about-async-tasks-the-get-task-cmdlet-and-a-hash-table/ Regards Emanuel