rachappachalmi's Posts

Hi LucD, Its working for me as well but i need VM names along with VM count against datastore, can you help me with this pls ?
Hi LucD, For me also its working fine but i need VM names also along with this out put, is it possible ?
Hi LucD,   Thanks for this script, but I want that out file with date and VM name , can you help me on this pls.   Regards Rachappa
Thanks a lot LucD !!  As always you helped and its working fine now for me Thanks a again !!
yes, vCenter 6.7
PowerCLI Version ---------------- VMware PowerCLI 12.4.0 build 18627050 --------------- Component Versions --------------- VMware Common PowerCLI Component 12.4 build 18627061 VMware Cis Core ... See more...
PowerCLI Version ---------------- VMware PowerCLI 12.4.0 build 18627050 --------------- Component Versions --------------- VMware Common PowerCLI Component 12.4 build 18627061 VMware Cis Core PowerCLI Component PowerCLI Component 12.4 build 18627057 VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 12.4 build 18627056 VMware VimAutomation Srm PowerCLI Component PowerCLI Component 12.3 build 17843071 VMware VimAutomation License PowerCLI Component PowerCLI Component 12.0 build 15939670 VMware VimAutomation Storage PowerCLI Component PowerCLI Component 12.4 build 18735056 VMware VimAutomation Vds Commands PowerCLI Component PowerCLI Component 12.4 build 18627062 VMware CloudServices PowerCLI Component PowerCLI Component 12.4 build 18627058 VMware Vmc PowerCLI Component PowerCLI Component 12.4 build 18627053 VMware Nsxt PowerCLI Component PowerCLI Component 12.3 build 17843496 VMware VimAutomation vROps PowerCLI Component PowerCLI Component 12.2 build 17532798 VMware HorizonView PowerCLI Component PowerCLI Component 12.3 build 18592768 VMware VimAutomation Cloud PowerCLI Component PowerCLI Component 12.0 build 15940183 VMWare ImageBuilder PowerCLI Component 7.0 build 17849781 VMWare AutoDeploy PowerCLI Component 7.0 build 17849781 VMware vSphere Update Manager PowerCLI 6.5 build 16941488 VMware VimAutomation Security PowerCLI Component PowerCLI Component 12.3 build 17833870 VMware Hcx PowerCLI Component PowerCLI Component 12.4 build 18627051 VMware Workload Management PowerCLI Component PowerCLI Component 12.4 build 18627055
Hi LucD, As you suggested, i upgraded and its running without any error but alerts are not resetting green. PS C:\Users\RachappaChalmi\Documents\Scripts> .\AlarmTestvCenter.ps1 PS C:\Users\Rachapp... See more...
Hi LucD, As you suggested, i upgraded and its running without any error but alerts are not resetting green. PS C:\Users\RachappaChalmi\Documents\Scripts> .\AlarmTestvCenter.ps1 PS C:\Users\RachappaChalmi\Documents\Scripts> .\AlarmTestvCenter.ps1 PS C:\Users\RachappaChalmi\Documents\Scripts> .\AlarmTestvCenter.ps1 PS C:\Users\RachappaChalmi\Documents\Scripts> Below is the script you shared, i just put this in notepad and made it .ps1 and ran it. but alerts are not resetting $alarmMgr = Get-View AlarmManager $filter = New-Object VMware.Vim.AlarmFilterSpec $filter.Status += [VMware.Vim.ManagedEntityStatus]::red $filter.TypeEntity = [VMware.Vim.AlarmFilterSpecAlarmTypeByEntity]::entityTypeAll $filter.TypeTrigger = [vmware.vim.AlarmFilterSpecAlarmTypeByTrigger]::triggerTypeAll $alarmMgr.ClearTriggeredAlarms($filter)  
PowerCLI Version ---------------- VMware PowerCLI 6.5 Release 1 build 4624819 --------------- Component Versions --------------- VMware Cis Core PowerCLI Component 6.5 build 4624453 VMware Vim... See more...
PowerCLI Version ---------------- VMware PowerCLI 6.5 Release 1 build 4624819 --------------- Component Versions --------------- VMware Cis Core PowerCLI Component 6.5 build 4624453 VMware VimAutomation Core PowerCLI Component 6.5 build 4624450 VMWare ImageBuilder PowerCLI Component 6.5 build 4561891 VMWare AutoDeploy PowerCLI Component 6.5 build 4561891 VMware Vds PowerCLI Component 6.5 build 4624695 VMware Cloud PowerCLI Component 6.5 build 4624821 VMware HA PowerCLI Component 6.0 build 4525225 VMware HorizonView PowerCLI Component 7.0.2 build 4596620 VMware Licensing PowerCLI Component 6.5 build 4624822 VMware PCloud PowerCLI Component 6.5 build 4624825 VMware Storage PowerCLI Component 6.5 build 4624820 VMware vROps PowerCLI Component 6.5 build 4624824 VMware vSphere Update Manager PowerCLI 6.5 build 4540462   PowerCLI E:\Rachappa\TEST\alarms> Get-Module -Name VMware* -ListAvailable | Select Name,Version Name Version ---- ------- VMware.DeployAutomation 6.0.0.0 VMware.ImageBuilder 6.0.0.0 VMware.VimAutomation.Cis.Core 6.5.0.4624453 VMware.VimAutomation.Cloud 6.5.0.4624821 VMware.VimAutomation.Common 6.5.0.4624451 VMware.VimAutomation.Core 6.5.0.2604913 VMware.VimAutomation.HA 6.0.0.0 VMware.VimAutomation.HorizonView 7.0.2.4596620 VMware.VimAutomation.License 6.5.0.4624822 VMware.VimAutomation.PCloud 6.5.0.4624825 VMware.VimAutomation.Sdk 6.5.0.4624452 VMware.VimAutomation.Storage 6.5.0.4624820 VMware.VimAutomation.Vds 6.5.0.4624695 VMware.VimAutomation.vROps 6.5.0.4624824 VMware.VumAutomation 6.0.0.0
when I use this , I am getting below error New-Object : Cannot find type [VMware.Vim.AlarmFilterSpec]: verify that the assembly containing this type is loaded. you also discussed solution for this ... See more...
when I use this , I am getting below error New-Object : Cannot find type [VMware.Vim.AlarmFilterSpec]: verify that the assembly containing this type is loaded. you also discussed solution for this in below tread but  am still not able to able to understand, would you be able provide step by step what exactly needs to be done to fix this if possible ? https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/how-to-use-powercli-Data-Objects/m-p/1376175#M43525
thanks a lot LucD, I will check this and update back.
Hi LucD, I am looking for PowerCLI script which clears all the vCenter alarms in one shot, I just want to schedule this every week Friday end of business hours, can you pls help me with script to c... See more...
Hi LucD, I am looking for PowerCLI script which clears all the vCenter alarms in one shot, I just want to schedule this every week Friday end of business hours, can you pls help me with script to clear all the alarms  in mulitple vCenters in one shot pls ?
Hi Luc, Its working for me, thanks a lot for all your help as always  
Hi Luc, Yes, if it takes from file also fine or if we need to mention in the script also fine, but need to do it for multiple hosts.
Hi Lex,   Sorry i am weak in scripting and i did not understand where to mention my ESXi list here in your script.
Hi Luc , I have two requests to you. 1 - I am trying to use multiple hosts like below in your above script but its not working  $esxName = @("myesxi1","myesxi2")  $esx = Get-VMHost -Name $esxName... See more...
Hi Luc , I have two requests to you. 1 - I am trying to use multiple hosts like below in your above script but its not working  $esxName = @("myesxi1","myesxi2")  $esx = Get-VMHost -Name $esxName $cmdsub = @' /etc/init.d/slpd stop; /etc/init.d/slpd status; esxcli network firewall ruleset set -r CIMSLP -e 0; chkconfig slpd off; chkconfig --list | grep slpd; '@ $secPswd = ConvertTo-SecureString 'ESXI510U2' -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential ('root', $secPswd) Get-VMHostService -VMHost $esx | where{$_.Key -eq 'TSM-SSH'} | Start-VMHostService -Confirm:$false | Out-Null $session = New-SSHSession -ComputerName $esx.Name -Credential $cred –AcceptKey Invoke-SSHCommand -SSHSession $session -Command $cmdSub | Select -ExpandProperty Output Remove-SSHSession -SSHSession $session | Out-Null Get-VMHostService -VMHost $esx | where{$_.Key -eq 'TSM-SSH'} | Stop-VMHostService -Confirm:$false | Out-Null   2 - We have standalone ESXi hosts around 178 and your original script is not working for them too, can you help on this as well (again password is same for all)
Hi Luc,   Will you be able to help me use this script for multiple hosts pls ?   Regards Rachappa
Hi Luc, Oh ok, got it, Actually we have around 2157 ESXi hosts and majority of them have same root passwords, hence I was looking for an option to apply this script once for all of them.  
/Hi Luc, Thanks for above script but can we do this same at vCenter level which dont ask for ESXi root password as we have different different root passwords for all the ESXi hosts to perform this C... See more...
/Hi Luc, Thanks for above script but can we do this same at vCenter level which dont ask for ESXi root password as we have different different root passwords for all the ESXi hosts to perform this CIMSLP actions ?
Hi LucD, I also have the same requirement as this thread but I need to list all the datastore where VMs active files are residing, because SimpliVity restore dont support if the active files of the ... See more...
Hi LucD, I also have the same requirement as this thread but I need to list all the datastore where VMs active files are residing, because SimpliVity restore dont support if the active files of the VMs are in multiple folders in same datastore or different datastores. can you help me with this pls.
Hi All, I am using below script to send mails with multiple attachments but it sending only first file in the folder, need your help. $runDateTime = Get-Date    $smtp = "smtp.server.com" ... See more...
Hi All, I am using below script to send mails with multiple attachments but it sending only first file in the folder, need your help. $runDateTime = Get-Date    $smtp = "smtp.server.com"    $to = "mymailid@com"     $cc = "mymailid@com"     $from = "mymailid@com"        $subject = "HangIssueReport_CL04 - $runDateTime" $attachmentLocation = "E:\Report\ovc1.2.3.4" $attachmentLocation = "E:\Report\ovc2.3.4.5" $attachmentLocation = "E:\Report\ovc3.4.5..6" $attachmentLocation = "E:\Report\ovc4.5.6.7" $body = "Hi Team, Good Day, <br><br>"         $body += "This is the <b>lsof report </b> you received at <i>$runDateTime.</i><br><br>"    $body += "Have a great day!<br><br>"    $body += "Thank you <br><br>" $body += "Test<br>" $body += "Test "       Send-MailMessage -SmtpServer $smtp -To $to -Cc $cc -From $from -Subject $subject -Body $body -BodyAsHtml -Attachments $attachmentLocation    Write-Host "====== Email sent! ======" $attachments = @() foreach($file in $files){     $filename = [system.io.path]::GetFileName($file.FullName)     $attachments += $file.fullname     $body += "TEST <br /><img src='" + $filename + "'/>TEST <br />"