Script to upgrade vm hardware for list of VM

hello guys..

Here is the script to update the vm hardware for list of VM’s

$vms=Get-Content C:\Temp\servers.txt
foreach($MyVM in $vms){
Write-Host "========Before Upgrading===================" -ForegroundColor Yellow
$MyVM = Get-VM -Name vm10
Write-Host $MyVM.Name $MyVM.Version -ForegroundColor White
if ($MyVM.PowerState -eq "PoweredOn") {
 Write-Host "Shutting Down" $MyVM
 Stop-VMGuest -VM $MyVM -Confirm:$false
 do {
 Start-Sleep -s 5
 $MyVMStat = Get-VM -Name $MyVM
 $status = $MyVMStat.PowerState
 }until($status -eq "PoweredOff")
 $snapTask=New-Snapshot -VM $MyVM -Name HardwareUpgrade -RunAsync
 Wait-Task $snapTask
 $snapState= Get-Task -Id $snaptask.Id |Select State,VM
 if($snapState.State -eq "Success"){
 Write-Host $MyVM "Snapshot is created and proceeding for Hardware Upgrade"
 #Get-Snapshot -VM $MyVM|Select Name,Created
 $vmversiontask=Set-VM -VM $MyVM -Version v10 -Confirm:$false -RunAsync
 $wtask=Wait-Task $vmversiontask 
 write-host $wtask.Id,$vmversiontask.Id
 $state=Get-Task |Select-Object * |where{($_.ObjectId -eq $wtask.Id) -and ($_.Name -eq "UpgradeVM_Task")}

Write-Host "================After the hardware Upgrade===========" -ForegroundColor Yellow
Write-Host $MyVM.Name $MyVM.Version -ForegroundColor White

How to clear WINS from Network Adapter Configuration with Powershell

Hello Guys…!!!

Here is the simple script to clear the WINS entry from multiple servers with powershell script.

$servers=gc C:\ServerList.txt
foreach($server in $servers){
$adapters=Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName $server
foreach($adapter in $adapters){
Write-Host "=======Before Making the WINS NULL=========" -ForegroundColor White
Write-Host $adapter.Description,$adapter.WINSPrimaryServer,$adapter.WINSSecondaryServer

VMware Cloud Foundation – Technical Deep Dive into the Unified SDDC Platform

Abstract: In this session, we’ll dive into the key technical aspects of a modern, unified Software-Defined Data Center delivered through VMware Cloud Foundation. Gain a deep understanding of the Cloud Foundation architecture, the automation of lifecycle management to include initial bring up and configuration, workload domain provisioning, and patching and upgrading operations. 

Date: Thursday, May 18, 2017

Time: 12:00 PM Central Daylight Time

Duration: 1 hour

Click Here For Registration

WEBCAST VMwareCertification: What’s New and What It Means for You

Abstract: When VMware products get an update, certifications get a facelift as well.  Learn about the latest and greatest in certification, including VCP6.5-DCV.  Find out why keeping current on your skill levels is so important and how, exactly, to keep your expertise up-to-date after you’ve certified.   

Date: Thursday, May 11, 2017

Time: 12:00 PM Central Daylight Time

Duration: 1 hour

Presented by: Paul Sorensen, Director, Education Services Programs at VMware and Karl Childs, Senior Manager, Certification Development at VMware.

Click Here For Registration

Introduction to Operational Transformation with NSX Network Virtualization and Security


Abstract: NSX network virtualization represents a major advancement in helping organizations realize the benefits of speed, agility, and security. Enterprises are using VMware NSX to achieve game-changing operational advantages. In this webinar we will cover the NSX Operations Maturity Model that spans across people, process, and tooling – including general operational guidance and best practices based on real world implementations. This unique webinar is ideal for IT executives and managers who want to understand what it takes to operationalize NSX. It is also useful for networking and security professionals in architecture, engineering, and admin/ops who will participate in operationalizing NSX for their organization. Continue reading “Introduction to Operational Transformation with NSX Network Virtualization and Security”

VMUG Virtual Event 6.0

vmug2017Register before April 27 to be entered to win one of (2) $100 New Egg Gift Cards!

Date: Thursday, June 8, 2017

Time: 9 AM – 5 PM Central Standard Time

VMUG Virtual Event 6.0 and take your career to the next level! This is your opportunity to experience live breakout sessions, chat with VMware experts and VMUG leaders, connect with industry leading partners, and access invaluable downloadable resources.

Click Here Registration

For more information and event details please visit:

Script to Get Datastore Path Information

Hello guys…!!!

Here is script developed to get the No Of Paths per DS and Type of path selection policy and to which VMHBA it is connected.

PowerShell Scrip:

Connect-VIServer -Server servername -User username -password password
#Get list of ESXi Hosts
$esxihosts=gc C:\hosts.txt
For($i = 1; $i -le $esxihosts.count; $i++)
ForEach ($esxihost in $esxihosts) {
 $esxi = Get-VMHost -Name $esxihost
 $hbas = $esxi | Get-VMH

 ForEach ($hba in $hbas) {
 $scsiluns = $hba | Get-ScsiLun
 ForEach ($scsilun in $scsiluns) { 
 $exportDSPaths=New-Object PSObject
 $scsipaths =$scsilun | Get-Scsilunpath |Select-Object *
 $DS=Get-Datastore |Get-View |Where-Object {$_.Info.vmfs.Extent.DiskName -eq $LunNaaID}
 #Write-Host $DS.Name,$LunNaaID,$LunPathPolicy,$PathCount,$hba.Name,$esxi.Name
 $exportDSPaths|Add-Member -MemberType NoteProperty -Name "EsxiHost" -Value $esxi.Name
 $exportDSPaths|Add-Member -MemberType NoteProperty -Name "DatastoreName" -Value $DS.Name
 $exportDSPaths|Add-Member -MemberType NoteProperty -Name "LunNAAID" -Value $LunNaaID
 $exportDSPaths|Add-Member -MemberType NoteProperty -Name "MultipathPolicy" -Value $LunPathPolicy
 $exportDSPaths|Add-Member -MemberType NoteProperty -Name "LunPathCount" -Value $PathCount
 $exportDSPaths|Add-Member -MemberType NoteProperty -Name "VmHBA Connected" -Value $hba.Name
 Write-Progress -Activity “Now Scaning $datastore in $hba on $esxi” -status “Found $countofESXi esxi hosts and working on $esxi” -PercentComplete ($i / $esxihosts.count*100)
$expotDSPathCount| Export-Csv -NoTypeInformation 'DSPathCountInformation.csv'

Sample Out PutDSPathInfo