This file contains hidden or 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 hidden or 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 hidden or 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-vCenterScheduledTask{ | |
| <# | |
| .SYNOPSIS | |
| Retrieve vCenter Scheduled Tasks. | |
| .DESCRIPTION | |
| Retrieve vCenter Scheduled Tasks. | |
| .NOTES | |
| Source: Automating vSphere Administration | |
| Authors: Luc Dekens, Arnim van Lieshout, Jonathan Medd, | |
| Alan Renouf, Glenn Sizemore |
This file contains hidden or 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
| #See storage policies available | |
| Get-SpbmStoragePolicy | |
| #Define storage policy you want to apply | |
| $storagepolicyname = "RAID-1 FTT-1" | |
| #Capture Storage policy object. | |
| $storagepolicies = Get-SpbmStoragePolicy | |
| $targetstoragepolicy = ($storagepolicies | where-object {$_.name -eq $storagepolicyname}) |
This file contains hidden or 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
| connect-viserver $vcenter -Credential $creds | |
| $view = get-view extensionmanager | |
| $hcxextensions = $view.extensionlist | where {$_.key -match "com.vmware.hybridity"} | |
| foreach ($ext in $hcxextensions){ | |
| $view.UnregisterExtension($ext.key) | |
| } |
This file contains hidden or 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
| # These values are unique to your environment. | |
| # DO NOT USE this code if your NSX-T instance is managed by a service provider. | |
| # You risk breaking your SLA/contracts/blahblahblah and yourself. | |
| # This script works when running from a MacOS zsh Terminal Session. YMMV w/ Linux Terminals | |
| NSXMgr=IPorDNSNameofyourNSXManager | |
| domainsuffix=zsoldier.com | |
| org=zsoldiernet | |
| orgunit=blog | |
| country=US | |
| state=GA |
This file contains hidden or 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
| <# Uncomment if you'd like to use. These are assumed and needed for custom report to work. Must be connected to vCenter and NSXMgr. | |
| Import-Module vmware.powercli,powernsx | |
| $Creds = Get-Credential -Message "Provide vCenter Admin credentials" | |
| $vCenterNameorIP = Read-Host "Provide name or IP of vCenter" | |
| Connect-VIServer $vCenterNameorIP -Credential $Creds | |
| Connect-NSXServer -vCenterServer $vCenterNameorIP -Credential $Creds | |
| #> | |
| $DFWRules = Get-NSXFirewallRule | |
| $CustomReport = @() |
This file contains hidden or 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
| #!/bin/sh | |
| ################################################################################### | |
| ## Create a pwpolicy XML file based upon variables and options included below. | |
| ## Policy is applied and then file gets deleted. | |
| ## Use "sudo pwpolicy -u <user> -getaccountpolicies" | |
| ## to see it, and "sudo pwpolicy -u <user> -clearaccountpolicies" to clear it. | |
| ## | |
| ## Tested on: OS X 10.10 10.11 10.12 | |
| #################################################################################### |
This file contains hidden or 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
| #Creates a simple cluster object in vCenter Inventory with quickstart disabled. | |
| $spec = New-Object VMware.Vim.ClusterConfigSpecEx | |
| $spec.InHciWorkflow = $false #Disables QuickStart | |
| $_this = Get-View -Id 'Folder-group-h5' | |
| $_this.CreateClusterEx($name, $spec) | |
| #Disables QuickStart on an existing cluster | |
| $Cluster = Get-Cluster "SomeCrazyName" | |
| $Cluster.ExtensionData.AbandonHciWorkflow() |
NewerOlder