<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>vishu_dear05 Tracker</title>
    <link>https://communities.vmware.com/wbsdv95928/tracker</link>
    <description>vishu_dear05 Tracker</description>
    <pubDate>Wed, 15 Nov 2023 10:31:06 GMT</pubDate>
    <dc:date>2023-11-15T10:31:06Z</dc:date>
    <item>
      <title>PowerCli to list ESXi install locations for 7.0</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCli-to-list-ESXi-install-locations-for-7-0/m-p/2898774#M105726</link>
      <description>&lt;P&gt;&lt;A href="https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Esxi-OS-running-on-Local-Sata-HDD-or-SD-card/m-p/1760683#2602542" target="_blank"&gt;https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Esxi-OS-running-on-Local-Sata-HDD-or-SD-card/m-p/1760683#2602542&lt;/A&gt;&amp;nbsp; &amp;nbsp;This script works well with ESxi 6.7&amp;nbsp;&lt;BR /&gt;Is there a version for ESxi 7.0 avaialble .. In Our environment - ESXi is installed on SD Card and ESXOSData volume is on local disk&amp;nbsp; - may be why this script lists the ESXI installed on local disk instead of SD Card&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 18:02:20 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCli-to-list-ESXi-install-locations-for-7-0/m-p/2898774#M105726</guid>
      <dc:creator>vishu_dear05</dc:creator>
      <dc:date>2022-03-15T18:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with SRM API InventoryMapping.GetResourcePoolMappings().SecondaryObject[]</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Need-help-with-SRM-API-InventoryMapping-GetResourcePoolMappings/m-p/2834872#M100286</link>
      <description>&lt;P&gt;Okay Got it.. Thank you very much for the explanation !&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 21:44:42 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Need-help-with-SRM-API-InventoryMapping-GetResourcePoolMappings/m-p/2834872#M100286</guid>
      <dc:creator>vishu_dear05</dc:creator>
      <dc:date>2021-03-09T21:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with SRM API InventoryMapping.GetResourcePoolMappings().SecondaryObject[]</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Need-help-with-SRM-API-InventoryMapping-GetResourcePoolMappings/m-p/2834586#M100262</link>
      <description>&lt;P&gt;Great! I did read through the SRM API guide to figure out how i can get recovery site details for the VM however was nly able to get references comeing from sRM DB ...&lt;BR /&gt;This recovery res pool and recovery network listing you show works being connected only to the Protected Site vCenter&amp;nbsp; right ? doesn't need a connection to remote site vcenter ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 18:11:52 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Need-help-with-SRM-API-InventoryMapping-GetResourcePoolMappings/m-p/2834586#M100262</guid>
      <dc:creator>vishu_dear05</dc:creator>
      <dc:date>2021-03-08T18:11:52Z</dc:date>
    </item>
    <item>
      <title>PowerCli - vCSA Daily Dashboard -Host Connectivity + vCenter Alarms for vsan,vcsa,hostrelated issues</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/PowerCli-vCSA-Daily-Dashboard-Host-Connectivity-vCenter-Alarms/ta-p/2833719</link>
      <description>&lt;DIV class="lia-message-template-content-zone"&gt;&lt;P&gt;&amp;lt;#&lt;/P&gt;&lt;P&gt;===========================================&lt;/P&gt;&lt;P&gt;Created By: Vishwanath Biradar&lt;/P&gt;&lt;P&gt;Created on: 12/Aug/2020&lt;/P&gt;&lt;P&gt;Version: 2.0(Final)&lt;/P&gt;&lt;P&gt;NOTE: Local Drive :D:\Scripts\vCenterDashboard is used to store the script , vCEnternames in csv file please ensure to make necessary changes in script if you save it in a difference directory&lt;BR /&gt;substitute vcsa1, vcsa2,vcsa3,vcsa4 with the shortnames of vcsa in your environment to fetch vsca related alarms&lt;BR /&gt;SendMail cmdlet needs the smtp server, from and to email addresses to be updated&lt;BR /&gt;&lt;BR /&gt;===========================================&lt;/P&gt;&lt;P&gt;#&amp;gt;&lt;/P&gt;&lt;P&gt;$row=@()&lt;BR /&gt;$Style =@()&lt;BR /&gt;$alarmtable=""&lt;BR /&gt;$table=""&lt;BR /&gt;$table = New-Object system.Data.DataTable "HostConnectionSummary"&lt;BR /&gt;$alarmtable = New-Object system.Data.DataTable "AlarmSummary"&lt;/P&gt;&lt;P&gt;Function Createalarmtable{&lt;BR /&gt;# Create a DataTable&lt;/P&gt;&lt;P&gt;$col1 = New-Object system.Data.DataColumn vCenter,([string])&lt;BR /&gt;$col2 = New-Object system.Data.DataColumn Alarm,([string])&lt;BR /&gt;$col3 = New-Object system.Data.DataColumn Entity,([string])&lt;BR /&gt;$col4 = New-Object system.Data.DataColumn Status,([string])&lt;BR /&gt;$col5 = New-Object system.Data.DataColumn Time,([string])&lt;BR /&gt;$alarmtable.columns.add($col1)&lt;BR /&gt;$alarmtable.columns.add($col2)&lt;BR /&gt;$alarmtable.columns.add($col3)&lt;BR /&gt;$alarmtable.columns.add($col4)&lt;BR /&gt;$alarmtable.columns.add($col5)&lt;BR /&gt;}&lt;BR /&gt;Function CreateHostTable{&lt;BR /&gt;# Create a DataTable&lt;/P&gt;&lt;P&gt;$col1 = New-Object system.Data.DataColumn VMHost,([string])&lt;BR /&gt;$col2 = New-Object system.Data.DataColumn State,([string])&lt;BR /&gt;$col3 = New-Object system.Data.DataColumn Cluster,([string])&lt;BR /&gt;$col4 = New-Object system.Data.DataColumn vCenter,([string])&lt;BR /&gt;$table.columns.add($col1)&lt;BR /&gt;$table.columns.add($col2)&lt;BR /&gt;$table.columns.add($col3)&lt;BR /&gt;$table.columns.add($col4)&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;CreateHostTable&lt;BR /&gt;CreateAlarmTable&lt;/P&gt;&lt;P&gt;$VCServers = Get-Content 'D:\Scripts\vCenterDashboard\vcenterlist.csv'&lt;BR /&gt;foreach($VCServer in $Vcservers)&lt;BR /&gt;{&lt;BR /&gt;$pattern=@('hardware','vsan','network','memory status','cpu status','vcsa1','vcsa2','vcsa3','vcsa4')&lt;BR /&gt;#$nopattern=@('hardware')&lt;BR /&gt;Write-Host "Connecting to $VCServer..." -Foregroundcolor "Yellow" -NoNewLine&lt;BR /&gt;$connection = Connect-VIServer -Server $VCServer -ErrorAction SilentlyContinue -WarningAction 0 | Out-Null&lt;BR /&gt;$alarm =''&lt;BR /&gt;$rootFolder = Get-Folder -Server $vc "Datacenters"&lt;BR /&gt;# ALARM Section&lt;BR /&gt;foreach ($ta in $rootFolder.ExtensionData.TriggeredAlarmState) {&lt;BR /&gt;#$alarm = "" | Select-Object VC, EntityType, Alarm, Entity, Status, Time, Acknowledged, AckBy, AckTime&lt;BR /&gt;$a= (Get-View -Server $vc $ta.Alarm).Info.Name&lt;BR /&gt;$pattern | ForEach-Object{$temp=$_&lt;BR /&gt;if($a.ToLower().Contains($temp) -and !($a.ToLower().Contains("vsan support insight"))){&lt;BR /&gt;#if($a.ToLower().Contains("hardware") -or $a.ToLower().Contains("vsan") -or $a.ToLower().Contains("network")){&lt;BR /&gt;$roww=''&lt;BR /&gt;$roww = $alarmtable.NewRow()&lt;BR /&gt;$roww.Alarm =$a&lt;BR /&gt;$entity = Get-View -Server $vc $ta.Entity&lt;BR /&gt;$roww.Entity =(Get-View -Server $vc $ta.Entity).Name&lt;BR /&gt;$roww.Status =$ta.OverallStatus&lt;BR /&gt;$roww.Time =$ta.Time&lt;BR /&gt;$roww.vCenter=$vcserver&lt;BR /&gt;$alarmtable.Rows.Add($roww)&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;$alarmtablerow=$alarmtable.Rows.Count&lt;BR /&gt;$alarmstyle = "&amp;lt;style&amp;gt;BODY{font-family: Arial; font-size: 10pt;}"&lt;BR /&gt;$alarmstyle = $alarmstyle + "TABLE{border: 1px solid black; border-collapse: collapse;}"&lt;BR /&gt;$alarmstyle = $alarmstyle + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"&lt;BR /&gt;$alarmstyle = $alarmstyle + "TD{border: 1px solid black; padding: 5px; }"&lt;BR /&gt;$alarmstyle = $alarmstyle + "&amp;lt;/style&amp;gt;"&lt;/P&gt;&lt;P&gt;$alarmhtml = $alarmtable | ConvertTo-Html -Property Alarm,Entity,Status,Time,vCenter -Head $alarmStyle&lt;BR /&gt;# ALARM Section END&lt;/P&gt;&lt;P&gt;# HOST Connection Section&lt;/P&gt;&lt;P&gt;$esxs=''&lt;BR /&gt;$esx=''&lt;BR /&gt;$esxs= Get-vmhost&lt;BR /&gt;foreach ($esx in $esxs)&lt;BR /&gt;{&lt;BR /&gt;$row=''&lt;/P&gt;&lt;P&gt;Write-Host " Processing $esx"&lt;BR /&gt;if ($esx.State -ne "Connected")&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;$row = $table.NewRow()&lt;BR /&gt;$row.VMHost =$esx.Name&lt;BR /&gt;$row.State =$esx.State&lt;BR /&gt;$row.Cluster =$esx.Parent&lt;BR /&gt;$row.vCenter=$vcserver&lt;BR /&gt;$table.Rows.Add($row)&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;$tablerow=$table.Rows.Count&lt;BR /&gt;$style = "&amp;lt;style&amp;gt;BODY{font-family: Arial; font-size: 10pt;}"&lt;BR /&gt;$style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"&lt;BR /&gt;$style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"&lt;BR /&gt;$style = $style + "TD{border: 1px solid black; padding: 5px; }"&lt;BR /&gt;$style = $style + "&amp;lt;/style&amp;gt;"&lt;BR /&gt;$hosthtml = $table | ConvertTo-Html -Property VMHost,State,Cluster,vCenter -Head $Style&lt;BR /&gt;}&lt;BR /&gt;#HOST ConnectionSection End&lt;BR /&gt;If($global:DefaultVIServer){Disconnect-VIServer -confirm:$false}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$date=(get-date).ToString("dMyyyy")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$msg="&amp;lt;br /&amp;gt;&amp;lt;big&amp;gt;Number of Hosts Not in 'CONNECTED' mode : $tablerow &amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;" + $hosthtml + "&amp;lt;p&amp;gt;&amp;lt;big&amp;gt;Number of Triggered Alarms:$alarmtablerow &amp;lt;/big&amp;gt; &amp;lt;/p&amp;gt;" + $alarmhtml + "&amp;lt;p&amp;gt;&amp;lt;big&amp;gt;Number of Metro Protection Domains :$pdtablerow &amp;lt;/big&amp;gt; &amp;lt;/p&amp;gt;" + $pdhtml&lt;BR /&gt;Send-MailMessage -SmtpServer "xyzmailrelay" -From 'DailyDashboard@xyz.com' -To @('abc@abc.com','xyz@xyz.com') -Subject "Daily Dashboard- $date" -Body $msg -BodyAsHtml&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Mar 2021 23:25:44 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/PowerCli-vCSA-Daily-Dashboard-Host-Connectivity-vCenter-Alarms/ta-p/2833719</guid>
      <dc:creator>vishu_dear05</dc:creator>
      <dc:date>2021-03-03T23:25:44Z</dc:date>
    </item>
    <item>
      <title>PowerCli Report for VMware -SRM Inventory</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/PowerCli-Report-for-VMware-SRM-Inventory/ta-p/2833715</link>
      <description>&lt;DIV class="lia-message-template-content-zone"&gt;&lt;P&gt;&amp;lt;#&lt;/P&gt;&lt;P&gt;===========================================&lt;/P&gt;&lt;P&gt;Created By: Vishwanath Biradar&lt;/P&gt;&lt;P&gt;Created on: 31/05/2020&lt;/P&gt;&lt;P&gt;Version: 1&lt;/P&gt;&lt;P&gt;NOTE: Local Drive D:\Scripts\SRM is being used to store the script,output,vCenterserverlist .If you save it on any other folder structure. Please ensure you make necessary changes in all the references in the script before executing.&lt;BR /&gt;The $pscred variable pulls up an already stored credential so Use Export-Clixml to store your credential before running this script&lt;BR /&gt;SendMail cmdlet needs the smtp server, from and to email addresses to be updated&lt;BR /&gt;CopyItem cmdlet needs the share path for a shared drive if you intend to store reports.&lt;BR /&gt;RemoteItem cmdlet cleansup last run output files&lt;BR /&gt;===========================================&lt;/P&gt;&lt;P&gt;#&amp;gt;&lt;BR /&gt;$report = @()&lt;BR /&gt;$row=''&lt;BR /&gt;$VCServers=''&lt;BR /&gt;$VCServer&lt;BR /&gt;$protectionGroups=''&lt;BR /&gt;$file=@()&lt;BR /&gt;#Use Export-Clixml to store your credential before running this script&lt;BR /&gt;$pscred = Import-Clixml -Path 'D:\Scripts\SRM\Cred.Xml'&lt;/P&gt;&lt;P&gt;# Removes any old items from the SRMOutput Folder&lt;BR /&gt;Remove-Item –Path D:\Scripts\SRM\SRMOutput\*.* -Verbose&lt;BR /&gt;#$pscred =Get-Credential&lt;BR /&gt;#Pull vcenternames in environment&lt;BR /&gt;$VCServers = Get-Content 'D:\Scripts\SRM\vcenterlist.csv'&lt;BR /&gt;foreach($VCServer in $Vcservers)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;$report=@()&lt;BR /&gt;Write-Host "Connecting to $VCServer..." -Foregroundcolor "Yellow" -NoNewLine&lt;BR /&gt;$connection = Connect-VIServer -Server $VCServer -ErrorAction SilentlyContinue -WarningAction 0 | Out-Null&lt;BR /&gt;Write-Host " "&lt;BR /&gt;$pos = $VCServer.IndexOf(".")&lt;BR /&gt;$dev=$vcserver.Substring(0, $pos)&lt;BR /&gt;$srmConnection = Connect-SrmServer -Port 443 -Credential $pscred -RemoteCredential $pscred&lt;BR /&gt;$srmApi = $srmConnection.ExtensionData&lt;BR /&gt;$recoveryplans=$srmApi.Recovery.ListPlans()&lt;BR /&gt;foreach($recoveryplan in $recoveryplans)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;$protectionGroups = $recoveryplan.GetInfo().ProtectionGroups&lt;/P&gt;&lt;P&gt;foreach ($protectionGroup in $protectionGroups)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;$protectionGroupInfo = $protectionGroup.GetInfo()&lt;BR /&gt;#$recoveryplan= $protectionGroup.ListRecoveryPlans()&lt;BR /&gt;$recoveryplanInfo =$recoveryplan.GetInfo()&lt;BR /&gt;$vms = $protectionGroup.ListAssociatedVms()&lt;BR /&gt;$vmp = $protectionGroup.ListProtectedVms()&lt;BR /&gt;&lt;BR /&gt;foreach ($vm in $vmp)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;$row = "" | select VMName, PowerState, ProtectionGroupName, PeerProtectionGroupName, RecoveryPlanName, PeerRecoveryPlanName, ClusterName, ResourcePoolName, Datastore, RPO, IPAddress, VMtoolStatus, vCenterName&lt;BR /&gt;&lt;BR /&gt;$vm.Vm.UpdateViewData()&lt;BR /&gt;if(($vm.vm.Config.RepConfig))&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;$row.VmName= $vm.vm.Name&lt;BR /&gt;$row.PowerState= $vm.Vm.Runtime.PowerState&lt;BR /&gt;$row.ProtectionGroupName = $protectionGroupInfo.Name&lt;BR /&gt;$row.PeerProtectionGroupName=$protectionGroup.GetPeer().GroupMoRef.Value&lt;BR /&gt;$row.RecoveryPlanName = $recoveryplanInfo.Name&lt;BR /&gt;$row.PeerRecoveryPlanName=$recoveryplan.GetPeer().PlanMoRef.Value&lt;BR /&gt;$hostview =Get-view $vm.vm.Runtime.Host&lt;BR /&gt;$clusview = Get-View $hostview.Parent&lt;BR /&gt;$row.ClusterName =$clusview.Name&lt;BR /&gt;$resp =Get-View $vm.Vm.ResourcePool&lt;BR /&gt;$row.ResourcePoolName =$resp.Name&lt;BR /&gt;$row.Datastore = $vm.vm.Config.DatastoreUrl.Name&lt;BR /&gt;$row.RPO =$vm.vm.Config.RepConfig.Rpo&lt;BR /&gt;$row.IPAddress =$vm.vm.Guest.IpAddress&lt;BR /&gt;$row.VMtoolStatus =$vm.vm.Guest.ToolsRunningStatus&lt;BR /&gt;$row.vCenterName =$VCserver&lt;BR /&gt;$report += $row&lt;BR /&gt;&lt;BR /&gt;$row | Format-Table -AutoSize&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;$d=Get-Date -Format "yyyyMMdd"&lt;BR /&gt;$report | Export-CSV "D:\Scripts\SRM\SRMOutput\SRM_$d.csv" -Append -NoTypeInformation&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Disconnect-SrmServer * -Confirm:$false&lt;BR /&gt;Disconnect-VIServer * -Confirm:$false&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;$msg="SRM Configured Virtual Machines Report"&lt;BR /&gt;Set-Location -Path D:\Scripts\SRM\SRMOutput&lt;BR /&gt;$file="D:\Scripts\SRM\SRMOutput\SRM_${d}.csv"&lt;BR /&gt;Send-MailMessage -SmtpServer "XXXX" -From "ReplicatedVMsReport@XYZ.com" -To @('abc','xyz') -Subject "Site Recovery Manager Configured Virtual Machines Report " -Attachments $file -Body $msg -BodyAsHtml&lt;BR /&gt;Copy-Item $file -Destination \SERVERNAME\SHARENAME\FOLDERNAME\SRMReports&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Mar 2021 23:08:11 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/PowerCli-Report-for-VMware-SRM-Inventory/ta-p/2833715</guid>
      <dc:creator>vishu_dear05</dc:creator>
      <dc:date>2021-03-03T23:08:11Z</dc:date>
    </item>
    <item>
      <title>Script to Detach Unmounted LUNs in SAN Connected Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Script-to-Detach-Unmounted-LUNs-in-SAN-Connected-Cluster/ta-p/2833706</link>
      <description>&lt;DIV class="lia-message-template-content-zone"&gt;&lt;P&gt;&amp;lt;#&lt;/P&gt;&lt;P&gt;===========================================&lt;/P&gt;&lt;P&gt;Created By: Vishwanath Biradar&lt;/P&gt;&lt;P&gt;Created on: 02/Feb/2018&lt;/P&gt;&lt;P&gt;Version: 2.0(Final)&lt;/P&gt;&lt;P&gt;NOTE: The Script needs VCenter and Cluster name as inputs to detach Unmounted Luns and provide a CSV output that can be shared with storage team to reclaim&lt;BR /&gt;===========================================&lt;/P&gt;&lt;P&gt;#&amp;gt;&lt;BR /&gt;#Declaration of Variable for report&lt;BR /&gt;$report = @()&lt;BR /&gt;Function Login-VC {&lt;BR /&gt;$VCServer = Read-Host 'Enter VC Server name'&lt;BR /&gt;Write-Host "Connecting to $VCServer..." -Foregroundcolor "Yellow" -NoNewLine&lt;BR /&gt;$connection = Connect-VIServer -Server $VCServer -ErrorAction SilentlyContinue -WarningAction 0 | Out-Null&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Conection to Vcenter server&lt;BR /&gt;Login-VC&lt;BR /&gt;Write-Host " "&lt;BR /&gt;$cluster = Read-Host "Enter Cluster name ="&lt;BR /&gt;$time = (Get-Date).tostring("dd-MM-yyyy-hh-mm-ss")&lt;BR /&gt;$CSVname = "$cluster-$time"&lt;BR /&gt;$esxs= Get-cluster "$cluster" | get-vmhost -State Connected #Fetching all host name of cluster&lt;BR /&gt;foreach($esx in $esxs) #Loop for each ESXI host in cluster&lt;BR /&gt;{&lt;BR /&gt;$esxcli = Get-EsxCli -VMhost $esx -V2&lt;BR /&gt;Write-host "Processing host $esx"&lt;BR /&gt;foreach($ds in $esxcli.storage.filesystem.list.Invoke())&lt;BR /&gt;{&lt;BR /&gt;if(($ds.VolumeName -ne "") -and ($ds.Mounted -eq "false"))&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;$row = "" | select VMHost, MountPoint,Volume,MountState,Size,DeviceName&lt;BR /&gt;foreach($st in $esxcli.storage.vmfs.extent.list.invoke())&lt;BR /&gt;{&lt;BR /&gt;if($st.VolumeName -eq $ds.VolumeName)&lt;BR /&gt;{&lt;BR /&gt;$row.DeviceName = $st.DeviceName&lt;BR /&gt;$Arguments= $esxcli.storage.core.device.set.CreateArgs()&lt;BR /&gt;$arguments.device = $row.DeviceName&lt;BR /&gt;$arguments.state = "off"&lt;BR /&gt;$esxcli.storage.core.device.set.Invoke($arguments)&lt;BR /&gt;$row.VMHost = ($esx).Name&lt;BR /&gt;$row.MountPoint = $ds.MountPoint&lt;BR /&gt;$row.MountState = $ds.Mounted&lt;BR /&gt;$row.Volume = $ds.VolumeName&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;$report += $row&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;} $report | Export-CSV "D:\scripts\DetachDatastore\${CSVname}.csv"&lt;BR /&gt;Write-host "Go and find report at location D:\DetachDatastore\${CSVname}.csv" # Location of file&lt;BR /&gt;Write-Host "Disconnecting $VCServer..." -Foregroundcolor "Yellow" -NoNewLine #Disconnecting the Vcenter server&lt;BR /&gt;Disconnect-VIServer * -Confirm:$false&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Mar 2021 22:38:39 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Script-to-Detach-Unmounted-LUNs-in-SAN-Connected-Cluster/ta-p/2833706</guid>
      <dc:creator>vishu_dear05</dc:creator>
      <dc:date>2021-03-03T22:38:39Z</dc:date>
    </item>
  </channel>
</rss>

