prasanna22kumar's Posts

Hi All, how to identify the Bootable LUN details of ESXI host using script for multiple ESXI HOST on Vcenter, whether they are booting from SAN Lun (3PAR)  or local disk...?? Thanks, Kumar
Hi All, how to identify the Bootable LUN details of ESXI host using script for multiple ESXI HOST on Vcenter, whether they are booting from SAN Lun (3PAR)  or local disk...?? Thanks, Kumar
Thanks LucD for your reply.. After adding the line as you mentioned getting following error.   New-HardDisk : 23/02/2023 17:35:56 New-HardDisk The operation for the entity "xcpXXXXX" failed with t... See more...
Thanks LucD for your reply.. After adding the line as you mentioned getting following error.   New-HardDisk : 23/02/2023 17:35:56 New-HardDisk The operation for the entity "xcpXXXXX" failed with the following message: "A general system error occurred: PBM error occurred during PreReconfigureCallback: Fault cause: vmodl.fault.SystemError ; " At C:\temp\test.ps1:4 char:22 + Get-VM -Name $vm | New-HardDisk -CapacityGB 10 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [New-HardDisk], SystemError + FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates_OperationFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk Regards, Kumar
this throws an error   At C:\temp\test.ps1:4 char:9 + $vm | New-HardDisk -CapacityGB 10 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-HardDisk], VimException + FullyQ... See more...
this throws an error   At C:\temp\test.ps1:4 char:9 + $vm | New-HardDisk -CapacityGB 10 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-HardDisk], VimException + FullyQualifiedErrorId : Core_ObnArgumentTransformationAttribute_Transform_InvalidPipelineArgument,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk Below is the script i'm trying  $vms=Get-Content "c:\temp\batch.txt" foreach ($vm in $vms) { $vm|New-HardDisk -CapacityGB 10 }    
HI Lucd, If i manually enable SSH and run the below script to verify the SLP status, SSH gets disabled. So it's not able open new SSH session   $cmdsub1 = @' /etc/init.d/slpd status; '@ $cmdsub... See more...
HI Lucd, If i manually enable SSH and run the below script to verify the SLP status, SSH gets disabled. So it's not able open new SSH session   $cmdsub1 = @' /etc/init.d/slpd status; '@ $cmdsub2 = @' chkconfig --list | grep slpd; '@ $secPswd = ConvertTo-SecureString -String $pswd -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential ($user, $secPswd) Get-VMHost -PipelineVariable esx | ForEach-Object -Process { Get-VMHostService -VMHost $esx | Where-Object { $_.Key -eq 'TSM-SSH' } | Start-VMHostService -Confirm:$false | Out-Null $session = New-SSHSession -ComputerName $esx.Name -Credential $cred -AcceptKey $current = Invoke-SSHCommand -SSHSession $session -Command $cmdSub1 $persistent = Invoke-SSHCommand -SSHSession $session -Command $cmdSub2 New-Object -TypeName PSObject -Property ([ordered]@{ VMHost = $esx.Name Current = $current.Output[0] Persistent = $persistent.Output[0] }) Remove-SSHSession -SSHSession $session | Out-Null Get-VMHostService -VMHost $esx | Where-Object { $_.Key -eq 'TSM-SSH' } | Stop-VMHostService -Confirm:$false | Out-Null } Regards, Kumar
Hi Lucd, Thanks for reply, But when i run above script..I get error attached. Regards, Kumar.
Hi Lucd, How to check the status SLP on multiple ESXI host's using script or single command. Regards, Kumar.
Hello Maya, Getting error can help me out..Please New-HardDisk : 23/06/2022 10:30:12 New-HardDisk Strings as pipeline input are not supported. At C:\temp\win.ps1:6 char:9 + $vm | New-HardDisk -Ca... See more...
Hello Maya, Getting error can help me out..Please New-HardDisk : 23/06/2022 10:30:12 New-HardDisk Strings as pipeline input are not supported. At C:\temp\win.ps1:6 char:9 + $vm | New-HardDisk -CapacityGB 10 -DiskType PMem + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-HardDisk], VimException + FullyQualifiedErrorId : Core_ObnArgumentTransformationAttribute_Transform_InvalidPipelineArgument,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk New-HardDisk : 23/06/2022 10:30:12 New-HardDisk Strings as pipeline input are not supported. At C:\temp\win.ps1:6 char:9 + $vm | New-HardDisk -CapacityGB 10 -DiskType PMem + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-HardDisk], VimException + FullyQualifiedErrorId : Core_ObnArgumentTransformationAttribute_Transform_InvalidPipelineArgument,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk
Hi Maya, Thanks for your reply.. If I want include 'Thin Provisioning' and create the disk on default location of the VM reside datastore. Thanks in advance  Regards, Kumar 
Hi All/Lucd, Kindly help me in powershell Script to add new hard disk (10 GB) to multiple VM's. Thanks in advance. Regards, Kumar
Hi Norris, Thanks a lot ...! I will check and updated you ! Cheers, Kumar
Hi Norris, One more help. Instead of cluster name...can I change to one Single ESXI HOST there ..?? $ToolsAutoSettingsVMs = Get-Host "ESXIHOST NAME HERE" | Get-VM | Sort | Get-View -Property @("Nam... See more...
Hi Norris, One more help. Instead of cluster name...can I change to one Single ESXI HOST there ..?? $ToolsAutoSettingsVMs = Get-Host "ESXIHOST NAME HERE" | Get-VM | Sort | Get-View -Property @("Name", "Config.GuestFullName", "Guest.GuestFullName", "Config.Tools.ToolsUpgradePolicy") | Select -Property Name, @{N="Configured OS";E={$_.Config.GuestFullName}}, @{N="Running OS";E={$_.Guest.GuestFullName}}, @{N='ToolsUpgradePolicy';E={$_.Config.Tools.ToolsUpgradePolicy }} Whether this works..?? Regards, Kumar.
Hi Norris ...Thanks a lot ....you made my day..!! I will try the below script if any issues ..i will keep you posted. Thanks a lot. Cheers, Kumar.
Hi Norris, Thanks a lot...I can try this one...But if i want to do one particular cluster...?? how can i do that..!   Regards, Kumar
Thanks for your reply .. I have to verify with Windows team whether UAC is enabled or disabled. If it's enabled , than i don't know whether i can disable it. When i checked in the system I'm runnin... See more...
Thanks for your reply .. I have to verify with Windows team whether UAC is enabled or disabled. If it's enabled , than i don't know whether i can disable it. When i checked in the system I'm running it's "enabled to notify" There is any way i can bypass this notify one & run automatically other than disabling (UAC) manually in all VM's  Regards, Kumar
Hi Lucd, I'm able to copy the .EXE to remote VM on C:\TEMP, but it's not executing the exe automatically. no error, But stuck her from past 20 min or any other way I can execute VM tools inste... See more...
Hi Lucd, I'm able to copy the .EXE to remote VM on C:\TEMP, but it's not executing the exe automatically. no error, But stuck her from past 20 min or any other way I can execute VM tools instead of doing it manually on Multiple Server's. Regards, Kumar  
Hi Lucd , Kindly help me out with powercli script for Mass update of VMtools manually from Shared folder. Scenario:- Store the VMtools.exe (VMware-tools-11.2.6-17901274-x86_64.exe) from shared fold... See more...
Hi Lucd , Kindly help me out with powercli script for Mass update of VMtools manually from Shared folder. Scenario:- Store the VMtools.exe (VMware-tools-11.2.6-17901274-x86_64.exe) from shared folder and Update the same via script in multiple VM's. Below is the script I'm trying..no go with it. #Variables $computername = Get-Content c:\temp\servers.txt $sourcefile = "c:\temp\VMware-tools-11.2.6-17901274-x86_64.exe" #This section will install the software foreach ($computer in $computername) { $destinationFolder = "\\$computer\C$\Temp" #It will copy $sourcefile to the $destinationfolder. If the Folder does not exist it will create it. if (!(Test-Path -path $destinationFolder)) { New-Item $destinationFolder -Type Directory } Copy-Item -Path $sourcefile -Destination $destinationFolder Invoke-Command -ComputerName $computer -ScriptBlock {Start-Process 'c:\temp\VMware-tools-11.2.6-17901274-x86_64.exe'} } Kindly assist me ...Thanks in advance. Regards, Kumar
Hi, Kindly can you help me to convert the same into percentage. Regards, Kumar.
Hi, Below is changes made for only ( Free Memory & CPU ) as per your instructions, $time = Get-Date Get-Cluster -PipelineVariable cluster | Get-VMHost| Select @{N='Cluster';E={$cluster.Name}}, ... See more...
Hi, Below is changes made for only ( Free Memory & CPU ) as per your instructions, $time = Get-Date Get-Cluster -PipelineVariable cluster | Get-VMHost| Select @{N='Cluster';E={$cluster.Name}},     @{N='VMHost';E={$_.Name}},     @{N='CPU GHz Capacity';E={[math]::Round($_.CpuTotalMhz/1000,2)}},     @{N='CPU GHz Used';E={[math]::Round($_.CpuUsageMhz/1000,2)}},     @{N='CPU GHz Free %';E={[math]::Round(($_.CpuTotalMhz - $_.CpuUsageMhz)/1000,2)/100}},     @{N='Memory Capacity GB';E={[math]::Round($_.MemoryTotalGB,2)}},     @{N='Memory Used GB';E={[math]::Round($_.MemoryUsageGB,2)}},     @{N='Memory Free %';E={[math]::Round(($_.MemoryTotalGB - $_.MemoryUsageGB),2)/100}},     @{N='Timestamp';E={$time}}| Export-Csv -Path c:\temp\ramdisk\Utilisationreport3.csv -NoTypeInformation -UseCulture Below is the Ooutput. CPU GHz Capacity CPU GHz Used CPU GHz Free % Memory Capacity GB Memory Used GB Memory Free % Timestamp 79.8 54.76 0.2504 1023.65 737.62 2.8603 04-12-2020 14:20 79.8 57.71 0.2209 1023.65 459.15 5.645 04-12-2020 14:20   Kindly let me whether OUT is correct, If yes... How I place percentage symbol next to Value as per Below  CPU GHz Capacity CPU GHz Used CPU GHz Free % Memory Capacity GB Memory Used GB Memory Free % Timestamp 79.8 54.76 0.25% 1023.65 737.62 2.86% 04-12-2020 14:20 79.8 57.71 0.22% 1023.65 459.15 5.65% 04-12-2020 14:20   Thanks, Kumar
Hi,  How can I convert the output into percentage (%) ..Please. Regards, Kumar.