If you need to set the ESXi Host Advanced System Setting Syslog.global.logHost on every ESXI Host in your environment here is some sample PowerCLI code to set the values. Connect to all your vCenters. Get all your hosts. Set the value and then it will reload the syslog service. The second PowerCLI code example is to get the ESXi Host Advanced System Setting Syslog.global.logHost value on every ESXI Host in your environment.

Continue reading

PowerShell Code There are two PowerCLI commands that have become my best friends in a Zero Trust Environment. Invoke-VMScript - Use to run scripts on VMs. Copy-VMGuestFile - Use to copy files to/from VMs. In this example you can use Invoke-VMScript to run commands on a VM to install Trend Deep Security. All commands run with VM in a zero trust state. $VMName = 'VM Name' #Copy file to the VM $PSText = 'wget https://server01.

Continue reading

NSX PowerCLI Code Some basic PowerCLI commands with NSX Included some examples of code to Automate adding/removing NSX Security Tags from VMs. Show Security TAGs. Show Security TAGs assigned to a specific VM. Hope you find these snippets of code useful. # Need to install PowerShell Module PowerNSX # Connect to vCenter $vCenterName = 'vCenter.vCrocs.info' Connect-VIServer $vCenterName -Credential $cred # Connect to NSX Server Connect-NsxServer -vCenterServer 'vCenter.vCrocs.info' -Credential $cred # Show all Security Tags Get-NsxSecurityTag | Select-Object Name | Sort-Object Name # Info about one specific Security TAG Get-NsxSecurityTag -Name NSX.

Continue reading

PowerCLI Basics

PowerCLI Code Some basic PowerCLI commands #Here are some basic commands that you can keep adding additional code #and get more precise on what you want to see. #Connect to a vCenter Connect-VIServer vcsa.domain.org #Disconnect from vCenter and not be prompted Disconnect-VIServer vcsa.domain.org -confirm:$false #Get VM Listing #Shows all VMs Get-VM #Shows all VMs sorted by Name Get-VM | Sort-Object Name #Shows all VMs sorted by Name that are Powered On Get-VM | Where-Object {$_.

Continue reading

Author's picture

Dale Hassinger

Sharing Content with the vCommunity and anyone else that finds my content interesting…

Lead Systems Engineer - SME

Dillsburg, PA