Prakas's Posts

Add the below line at the end of your code (before }), this will do the export for you. $Report | Export-Csv -Path C:\ResultExport.csv -NoTypeInformation -Append Exporting in Excel requires ... See more...
Add the below line at the end of your code (before }), this will do the export for you. $Report | Export-Csv -Path C:\ResultExport.csv -NoTypeInformation -Append Exporting in Excel requires PowerShell Excel module. You can find more information here - Introducing the PowerShell Excel Module – Hey, Scripting Guy! Blog 
It looks like you haven't saved the excel.
Try affixing " | ft -Autosize" at the end of each line. This should format the output nicely.
Did you try the "Get-Template" cmdlet?
I guess you are getting multiple entries of 'domain\username' in your snapshot description and you want to fix this. If so, update the line 10 in your script with below and see if it helps:- ... See more...
I guess you are getting multiple entries of 'domain\username' in your snapshot description and you want to fix this. If so, update the line 10 in your script with below and see if it helps:-     if ($description -notlike "*domain*"){
There is a nice article here about URLs - vSphere 6 – VM Console URL Shortcut. » @vmnick0. I wrote a small PowerCLI script below to generate URL shortcuts for all the VMs in given vCenter. Try i... See more...
There is a nice article here about URLs - vSphere 6 – VM Console URL Shortcut. » @vmnick0. I wrote a small PowerCLI script below to generate URL shortcuts for all the VMs in given vCenter. Try if this works for you.. $MyVC = 'vCenterName' $MyVCwebC = 'VCWebClientName(FQDN)' $VC = Connect-VIServer $MyVC Get-VM -Server $VC | foreach { $_ | Select Name,@{N='URL';E={"https://"+ $myVCwebC + ":9443/vsphere-client/vmrc/vmrc.jsp?vm=urn:vmomi:VirtualMachine:" + $_.ExtensionData.MoRef.value + ":" + $VC.InstanceUuid}} | Export-Csv -Path .\Result.csv -NoTypeInformation -Append }
Try running IE in compatibility mode. Try re-installing the VMware client integration plugin.
My guess is you are not running the VMware tools version matching with the ESXi host's version. Try checking with VMware Tools-version mapping file.
It looks like there is no option available to retrieve the detail for individual vmdks.
Try this Get-VM 'VMName' | Select Name,ProvisionedSpaceGB,UsedSpaceGB Are you looking for details of individual disks?
I faced this error. I used to consolidate the snapshot by powering off the VM - it will complete real quick.
Just to add more info, your step 1 has no effect in vDS movement process. So just keep the VMs running in host and proceed. Once your step 2 is complete, create a VM portgroup with identical name... See more...
Just to add more info, your step 1 has no effect in vDS movement process. So just keep the VMs running in host and proceed. Once your step 2 is complete, create a VM portgroup with identical name as in standard vSwitch. Now use 'Migrate Virtual Machine networking' option under Networking to move the VMs from standard to vDS.
I guess you are missing the migrate Virtual Machine networking in your steps. Refer this link - VMware vSphere 5.1.
I guess you can achieve this by migrating NIC and VM portgroup in one shot to vDS. Are both NICs belong to same network? If so, bring both Management and VM portgroup to same vSwitch and attac... See more...
I guess you can achieve this by migrating NIC and VM portgroup in one shot to vDS. Are both NICs belong to same network? If so, bring both Management and VM portgroup to same vSwitch and attach the NIC to it. Then, you can move one NIC to vDS while both traffic is being handled by other NIC.
Maximum size(GB) = size of the hard disk + amount of free space available in its respective datastore
Try it with the below code $VMname = Read-Host " Enter the VM hostname" $D=Read-Host "Enter D drive GB Size" $E=Read-Host "Enter E drive GB Size" $SYSTEMDBS1 = Read-Host "Enter SYSTEMDB1 ... See more...
Try it with the below code $VMname = Read-Host " Enter the VM hostname" $D=Read-Host "Enter D drive GB Size" $E=Read-Host "Enter E drive GB Size" $SYSTEMDBS1 = Read-Host "Enter SYSTEMDB1 GB Size" $DATA1 = Read-Host "Enter DATA1 GB Size" $LOGS1 = Read-Host "Enter LOGS1 GB Size" $DBA_ADMIN_LOGS1 = Read-Host "Enter DBA_ADMIN_LOGS1 GB Size" $TEMPDB1 = Read-Host "Enter TEMPDB1 GB Size" $DBA_ADMIN_DATA1 = Read-Host "Enter DBA_ADMIN_DATA1 GB Size" $DBAUTILITY = Read-Host "Enter DBAUTILITY GB Size" stop-vm -vm $VMname -confirm:$false Start-sleep -s 5 $VM= get-vm -Name $VMname ##Adding D and E Drive New-HardDisk -VM  $VM -CapacityGB  $D -DiskType Flat -StorageFormat Thin New-HardDisk -VM  $VM -CapacityGB  $E -DiskType Flat -StorageFormat Thin New-HardDisk -VM  $VM -CapacityGB  $SYSTEMDBS1 -DiskType Flat -StorageFormat Thin New-HardDisk -VM  $VM -CapacityGB  $DATA1 -DiskType Flat -StorageFormat Thin New-HardDisk -VM  $VM -CapacityGB  $LOGS1 -DiskType Flat -StorageFormat Thin New-HardDisk -VM  $VM -CapacityGB  $DBA_ADMIN_LOGS1 -DiskType Flat -StorageFormat Thin New-HardDisk -VM  $VM -CapacityGB  $TEMPDB1 -DiskType Flat -StorageFormat Thin New-HardDisk -VM  $VM -CapacityGB  $DBA_ADMIN_DATA1 -DiskType Flat -StorageFormat Thin New-HardDisk -VM  $VM -CapacityGB  $DBAUTILITY -DiskType Flat -StorageFormat Thin $hdds = $VM | Get-HardDisk New-ScsiController -Type ParaVirtual -HardDisk $hdds[2,3] New-ScsiController -Type ParaVirtual -HardDisk $hdds[4,5] New-ScsiController -Type ParaVirtual -HardDisk $hdds[6,7,8] Start-sleep -s 2 ## Start VM Start-VM -VM $VM -confirm:$false consider awarding points if you find my answer helpful.
Can you provide the whole script you are trying to run ?
It depends on version of ESXi you are using. In case of ESX 4.x, snapshot consolidation may lead to an unexpected downtime as VM may be 'stunned' after multiple consolidate attempts. It is safe... See more...
It depends on version of ESXi you are using. In case of ESX 4.x, snapshot consolidation may lead to an unexpected downtime as VM may be 'stunned' after multiple consolidate attempts. It is safe to consolidate in case of ESXi 5.x as it won't cause long pause of the VM(by design). If you can afford to downtime, consolidating when the VM is down is the best and quick way.
For step 4, try like this... $tgtHosts = Get-Cluster tgtClusterName | Get-VMHost foreach($vm in $list) { $h = $tgtHosts | Get-Random Get-VM $vm | Move-VM -Destination $h -Confirm:$fal... See more...
For step 4, try like this... $tgtHosts = Get-Cluster tgtClusterName | Get-VMHost foreach($vm in $list) { $h = $tgtHosts | Get-Random Get-VM $vm | Move-VM -Destination $h -Confirm:$false }
Hi enrich - VMware KB - VMware KB: Restoring and copying vCenter Server alarms gives a nice way of doing this