server are registred with FQDN I'm not sure if the certificate contains both FQDN and IP but I confirm that the vCenter is not resolved by its IP I verified with a Production vcenter I can ...
See more...
server are registred with FQDN I'm not sure if the certificate contains both FQDN and IP but I confirm that the vCenter is not resolved by its IP I verified with a Production vcenter I can resolve the FQDN bwhen I nslookup its IP Get-EsxCli : 24/10/2020 20:58:21 Get-EsxCli Could not establish secure channel for SSL/TLS with authority 'vCenter.local'. At X:\script.ps1:186 char:19 + $esxcli = Get-EsxCli -VMHost $ESX -V2 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-EsxCli], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.EsxCli.GetEsxC li You cannot call a method on a null-valued expression. At X:\script.ps1:188 char:9 + $obj = New-Object -TypeName PSObject -Property @{ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull
I mean as I'm connecting to ESXi node through vCenter I'm trying to find a way to check why Get-VMHost is not working withing the script FYI : when I just connect to vCenter I run the Cmdlet G...
See more...
I mean as I'm connecting to ESXi node through vCenter I'm trying to find a way to check why Get-VMHost is not working withing the script FYI : when I just connect to vCenter I run the Cmdlet Get-VMHost it's working really strange....:smileycry:
despite that I'm adding the below to my script, I have always the error message : Get-EsxCli Could not establish secure channel for SSL/TLS with authority [System.Net.ServicePointManager]::Sec...
See more...
despite that I'm adding the below to my script, I have always the error message : Get-EsxCli Could not establish secure channel for SSL/TLS with authority [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls,[System.Net.SecurityProtocolType]::Tls11,[System.Net.SecurityProtocolType]::Tls12 Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false has anyone encountered this kind of problem?
Thanks for confirmation finally, even the error message appears, the script is running. on a test vcenter there is just 1 single server which does not report information. is that possibl...
See more...
Thanks for confirmation finally, even the error message appears, the script is running. on a test vcenter there is just 1 single server which does not report information. is that possible the information of the total number of ESXs checked in the vCenter, so that I can make the comparisons with the inventory of ESXs
Server rebooted same issue, checked with another vCenter also same issue I guess you are right regarding the error message related to SSL/TLS can we work with Get-Cluster | Get-VMHost -Pipeli...
See more...
Server rebooted same issue, checked with another vCenter also same issue I guess you are right regarding the error message related to SSL/TLS can we work with Get-Cluster | Get-VMHost -PipelineVariable esx instead of using $esxcli and obtain the same result?
Thanks for the clarification I will check this on a new thread Hostname should be added after acceptance in oder to get information for the host(s) that may have a different Software Acce...
See more...
Thanks for the clarification I will check this on a new thread Hostname should be added after acceptance in oder to get information for the host(s) that may have a different Software Acceptance Level
Yes I'm connected to vcenter and I just tested the script like this and same issue $vcenter = Read-Host "vCenter name:" $user = Read-Host "User:" $password = Read-Host "Password:" $FileHa...
See more...
Yes I'm connected to vcenter and I just tested the script like this and same issue $vcenter = Read-Host "vCenter name:" $user = Read-Host "User:" $password = Read-Host "Password:" $FileHardening = 'E:\temp' $esxcli = Get-ESXCLI -VMHost * -V2 $generatefile = ForEach ($line in $esxcli) { $line.software.acceptance.get.Invoke() } $generatefile | Out-String | ForEach-Object { $_.Trim() } > "E:\temp\Software_AcceptanceLevel-config.txt" $generateerrorfile = foreach ($line in (Get-Content -Path "E:\temp\Software_AcceptanceLevel-config.txt")) { if ($line -like "*PartnerSupported*") { } else { $line } } if ($generateerrorfile -eq $Null) { Write-Host "All Hosts have PartnerSupported Software Acceptance" } else { Write-Host "Hosts with wrong Software Acceptance detected" Write-Host "You need to modify them manually" } it works only If I do connect-viserver then I run the script
despite that I added this on the top of my script I got the below error message Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false Get-ESXCLI : 23/10/2020 19:10:4...
See more...
despite that I added this on the top of my script I got the below error message Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false Get-ESXCLI : 23/10/2020 19:10:40 Get-EsxCli Could not establish secure channel for SSL/TLS with authority 'vcenter.local'. At E:\Hardening_ESXi\Herdening_ESXi.ps1:182 char:11 + $esxcli = Get-ESXCLI -VMHost * -V2 + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-EsxCli], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.EsxCli.GetEsxCli
I'm trying to get the software acceptance level for some hosts and then provide a result basicaly the script should collect the info and then compare it unfortunaly it's not working $esxcli =...
See more...
I'm trying to get the software acceptance level for some hosts and then provide a result basicaly the script should collect the info and then compare it unfortunaly it's not working $esxcli = Get-ESXCLI -VMHost -V2 -Server $generatefile = ForEach($line in $esxcli) {$line.software.acceptance.get()} $generatefile | Out-String | ForEach-Object { $_.Trim() } > "$FileHardening\Software_AcceptanceLevel-config.txt" $generateerrorfile = foreach($line in (gc "$FileHardening\Software_AcceptanceLevel-config.txt")) {if ($line -like "*PartnerSupported*") {} else {$line}} if ($generateerrorfile -eq $Null) { Write-Log -FilePath $LogFile -Message "All Hosts have PartnerSupported Software Acceptance" -Level Success } else{ Write-Log -FilePath $LogFile -Message "Hosts with wrong Software Acceptance detected" -Level Warning Write-Log -FilePath $LogFile -Message "You need to modify them manually" -Level Warning
Thanks LucD if I identify some VMs with DirectPath Enabled is there a way to disabled this option as it's not recommended by VMware your comment are always welcome
Thanks LucD I'm using a function to log output to file , so if I have understood correctly shall I add this parametre $host.PrivateData to my function or I need to create another one? is t...
See more...
Thanks LucD I'm using a function to log output to file , so if I have understood correctly shall I add this parametre $host.PrivateData to my function or I need to create another one? is there some samples to check and learn from it?:smileyblush: