This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Credential = Get-Credential | |
$skipcertcheck = $true | |
$AuthMethod = “Basic” | |
$NSXMgr=”NSXTManagerIPorDNSName” | |
$policyapi = "/policy/api/v1" | |
$base_url = ("https://" + $NSXMgr + $policyapi) | |
$endpoint = "/infra/realized-state/virtual-machines" | |
$Data = Invoke-restmethod -Uri ($base_url + $EndPoint) -Method GET -Credential $Credential -SkipCertificateCheck:$skipcertcheck -Authentication:$AuthMethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Change Segment Profiles | |
$Credential = Get-Credential | |
$skipcertcheck = $true | |
$AuthMethod = “Basic” | |
$NSXMgr=”IPorDNSName” | |
$policyapi = "/policy/api/v1" | |
$base_url = ("https://" + $NSXMgr + $policyapi) | |
#Change these to the name of the various profiles you want to remap all your segments to. | |
$TargetIPDPName = "default-ip-discovery-profile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-SSLCert{ | |
[CmdletBinding()] | |
<# | |
.SYNOPSIS | |
Gets SSL certificate of remote system. | |
.DESCRIPTION | |
Gets SSL certificate of remote system in order to get it's thumbprint. | |
.EXAMPLE | |
Get-SSLCert tech.zsoldier.com | |
Returns the certificate as object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Have not figured out how to have jq output an array for bash to loop through. | |
nsxt=DNSnameORIPAddressofNSXTManager | |
username=admin | |
password='superduperSecure!' | |
endpoint='policy/api/v1' | |
#Checks to see if you have jq installed. | |
if ! command -v jq &> /dev/null | |
then | |
echo "jq is needed for code for below code to work. Download or use brew/apt/packagemanager to install. https://stedolan.github.io/jq/" | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nsxt=iporDNSnameofNSXManager | |
username=admin | |
password='' | |
if ! command -v jq &> /dev/null | |
then | |
echo "jq is needed for code for below code to work. Download or use brew/apt/packagemanager to install. https://stedolan.github.io/jq/" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$NSXMgr = Read-Host "Please provide NSX-T DNS name or IP address." | |
$Credential = Get-Credential -Message "Please provide NSX-T username and password." | |
$skipcertcheck = $true | |
$AuthMethod = “Basic” | |
$policyapi = "/policy/api/v1" | |
$base_url = ("https://" + $NSXMgr + $policyapi) | |
$endpoint = "/infra/tier-0s/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$testtimer=1800 | |
$writepct=50 | |
$blocksize='64k' | |
$threads=4 | |
$outstandingio=16 | |
$warmuptime=5 | |
$filesize="10G" | |
$drives=@('D','E','F','G') | |
#$drives=@('E') | |
$diskspdpath = "C:\Users\Administrator\Downloads\DiskSpd\amd64\diskspd.exe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Modules vmware.powercli | |
$esxihost = "DNSorIPofESXihost" | |
$vmhost = get-vmhost $esxihost | |
$vmhostcli = $vmhost | get-esxcli -v2 | |
$pcidevices = $vmhostcli.hardware.pci.list.invoke() | |
#$pcidevices | where {$_.vendorname -match "Mellanox"} | |
$HCLData = @() | |
Foreach ($pcidevice in $pcidevices){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Modules az | |
Connect-AzAccount | |
$ERGREnabled = @() | |
$GRDataFull = @() | |
$ERCircuits = @() | |
$Subs = Get-AzSubscription | |
Foreach ($Sub in $Subs){ | |
Select-AzSubscription $Sub | |
$ERCircuits += Get-AzExpressRouteCircuit | |
} |