# For VMWare ESXi 5.5, 6.0, 6.5, and 6.7 # # Copy and paste into a PowerCLI window. PowerCLI is a free download from my.vmware.com. # Does not require admin level PowerCLI # VMWare Free license does not allow access to these commands. Use unlicensed/trial license if necessary (first 60 days) #Set certificate to not fail on unsecured certificate (default) Set-PowerCLIConfiguration -invalidcertificate Ignore -confirm:$false # Modify the command for your specific server Connect-VIServer -Server 192.168.1.8 -port 443 #Setup SNMP on the host, clears out existing community, adds in INSI, then sets the service properly, starts it, and opens up the firewall Get-VMHostSnmp | Set-VMHostSnmp -ReadonlyCommunity @() Get-VMHostSnmp | Set-VMHostSnmp -ReadonlyCommunity 'INSI' -Enabled $true Get-vmhostservice | where { $_.key -eq "snmpd"} | set-vmhostservice -Policy on Start-VMHostService -HostService (Get-VMHostService | Where { $_.Key -eq "snmpd"}) Get-VMHostFirewallException "snmp server" | set-VMHostFirewallException -Enabled $true #Setup the SSH Service, start it, add in firewall exception Get-vmhostservice | where { $_.key -eq "TSM-SSH"} | set-vmhostservice -Policy on Start-VMHostService -HostService (Get-VMHostService | Where { $_.Key -eq "TSM-SSH"}) Get-VMHostFirewallException "SSH server" | set-VMHostFirewallException -Enabled $true #adds in SSH outbound connections on the firewall Get-VMHostFirewallException "SSH Client" | set-VMHostFirewallException -Enabled $true #NTP settings, sets up time services on the host Add-VMHostNTPServer -NtpServer 0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org,3.pool.ntp.org Get-VMHostFirewallException | where {$_.Name -eq "NTP client"} | Set-VMHostFirewallException -Enabled:$true Get-VmHostService | Where-Object {$_.key -eq "ntpd"} | Start-VMHostService Get-VmHostService | Where-Object {$_.key -eq "ntpd"} | Set-VMHostService -policy "on" #Set Power to static or high performance (Get-View (Get-VMHost | Get-View).ConfigManager.PowerSystem).ConfigurePowerPolicy(1) #Disconnect from the host Disconnect-VIServer -confirm:$false #End