When working in a Zero Trust Environment and programs are not working the way they should it is nice to have some Tools available to do troubleshooting. When new applications are installed and not working you can be asking yourself is it my issue with the application or is the firewall blocking ports. I recently had a support call with VMware and they showed me two commands that work awesome to test to see if ports are open to a destination IP on a specific port.

Continue reading

Add disk

PowerShell Code Powershell code to add disk to a Remote Windows Server VMware VM #The Following code shows how to add a New Drive, bring drive online, initialize and format: #Connect to vCenter Connect-VIServer vcsa.domain.org #Add new drive to VM New-HardDisk -VM $VMNAME -CapacityGB $DISKSIZEGB -StorageFormat Thin -Controller ‘SCSI Controller 1’ #Make disk online invoke-command -computername $VMNAME -scriptblock {Set-Disk 2 -isOffline $false} #Initialize disk invoke-command -computername $VMNAME -scriptblock {Initialize-Disk 2 -PartitionStyle GPT} #Create Partition invoke-command -computername $VMNAME -scriptblock {New-Partition -DiskNumber 2 -UseMaximumSize -DriveLetter E} #Format drive invoke-command -computername $VMNAME -scriptblock {Format-Volume -DriveLetter E -FileSystem NTFS -NewFileSystemLabel ‘Data’ -AllocationUnitSize 16384 -Confirm:$false} #------------------------------------------------------------------------- #The Following Code will show disk “Allocation Unit Size” on a remote Windows Server: $C = Invoke-Command -ComputerName $VMname {Get-WmiObject -Class Win32_Volume -Filter “DriveLetter = ‘C:'” | Select-Object BLOCKSIZE} $C_AllocationUnitSize = ($C.

Continue reading

PowerShell Code Add Registry Values to Windows Server #vCrocs Registry Changes invoke-command -computername $FQDNVMname -ScriptBlock {new-Item HKLM:\SOFTWARE\vCrocs -f } invoke-command -computername $FQDNVMname -ScriptBlock {param ($SG) Set-ItemProperty hklm:\software\vCrocs -Name SupportGroup -Value "$SG" -Force} -ArgumentList $SG invoke-command -computername $FQDNVMname -ScriptBlock {param ($APP) Set-ItemProperty hklm:\software\vCrocs -Name Application -Value "$APP" -Force} -ArgumentList $APP invoke-command -computername $FQDNVMname -ScriptBlock {param ($LOC) Set-ItemProperty hklm:\software\vCrocs -Name Location -Value "$LOC" -Force} -ArgumentList $LOC invoke-command -computername $FQDNVMname -ScriptBlock {param ($SL) Set-ItemProperty hklm:\software\vCrocs -Name ServiceLevel -Value "$SL" -Force} -ArgumentList $SL

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

PowerShell Code I use this code to create a log file during a VM build using vRealize Automation Here’s an example: $VMname = 'ServerName' #The next line defines where to save the log file $LOGFILENAME = "C:\vRA-Install-Logs\vRA-Install-Log-" + $VMname + ".log" #Check to see if file already exists. If it does delete it. if (Test-Path $LOGFILENAME) { Remove-Item -Path $LOGFILENAME } #Creates the Log File New-Item $LOGFILENAME -ItemType File #Update Log File.

Continue reading

Randon Password

PowerShell Code I use this code to generate a random password during the automation process of creating a new Server VM. I then add the password to Password Manager with Powershell. #Generate Random text to use for Password $SQLPassword =@( [char[]](65..91 | Get-Random -Count 5) [char[]](97..123 | Get-Random -Count 5) '!','#','(',')' | Get-Random -Count 2 0..9 | Get-Random -Count 4 ) | Sort-Object {Get-Random} $Password = $SQLPassword -join ''

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