PowerCli

Deploy VMs using Templates and PowerCli script

$csv1 = import-csv C:\users\administrator\desktop\temp.csv $cluster = get-cluster “Production01” $custspec = Get-OSCustomizationSpec windows $i = 0 function vmdeploy() { $fqdn = $csv1.hostname[$i] + “.”+ $csv1.domain[$i] Get-OSCustomizationSpec windows | Set-OSCustomizationSpec -NamingScheme Fixed -NamingPrefix $csv1.hostname[$i] Get-OSCustomizationSpec windows | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpMode UseStaticIp -IpAddress $csv1.ip[$i] -SubnetMask $csv1.subnet[$i] -DefaultGateway $csv1.gateway[$i] -Dns $csv1.dns1[$i],$csv1.dns2[$i] New-VM -ResourcePool $cluster -Name $fqdn -Template $csv1.template[$i]… Continue reading Deploy VMs using Templates and PowerCli script

PowerCli

Change ESXi host advance settings using powershell

write-host “Fetching ESXi Clusters” $mgmtcluster = get-cluster “cluster1” | get-vmhost $cloudcluster = get-cluster “cluster2” | get-vmhost function esxiconfig(){ write-host “Setting Sysloghost” Get-vmhost | Set-VMHostAdvancedConfiguration -NameValue @{‘Syslog.global.logHost’=’udp://10.1.1.10’} write-host “Setting ESXi Shell TImeout” Get-vmhost | Set-VMHostAdvancedConfiguration -NameValue @{‘UserVars.ESXiShellTimeOut’=’3600’} write-host “Setting ESXi Shell Interactive Timeout” Get-vmhost | Set-VMHostAdvancedConfiguration -NameValue @{‘UserVars.ESXiShellInteractiveTimeOut’=’3600’} write-host “Setting DataMover HardwareAcceleratedMove Value” Get-vmhost | Set-VMHostAdvancedConfiguration… Continue reading Change ESXi host advance settings using powershell