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
| #Add BackConnectionHostNames | |
| #You can use 'r for carriage return as this is a MultiLine String key | |
| $hosts ="iaas-web.corp.local`r`niaas-mgr.corp.local`r`niaas-web-01.corp.local`r`niaas-web-02.corp.local" | |
| Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\LSA\MSV1_0 -Type MultiString -Name BackConnectionHostNames -Value $hosts |
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
| #Needed to search for invalid hostname inside lots of config files | |
| $wrongHost = "the-host.com" | |
| $path = "D:\Program Files (x86)\VMware\vCAC\" | |
| Get-ChildItem -Path $path -Filter *.config -Recurse | ? { !$_.PSIsContainer } | % { | |
| $f = Get-Content $_.FullName | |
| $c = $f | % { $_ -match $wrongHost } | |
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
| [Version] | |
| Signature="$Windows NT$" | |
| [NewRequest] | |
| Subject = "CN=servername.corp.com, OU=, O=, L=, S=, C=" | |
| Exportable = TRUE | |
| KeyLength = 2048 | |
| KeySpec = 1 |
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
| //Inputs: | |
| //host: vCACCAFE:vCACHost | |
| //user: string | |
| //Can get host like this if needed: | |
| //var host = vCACCAFEEntitiesFinder.getHost("id-of-host-yes"); | |
| var catalogClient = host.createCatalogClient(); | |
| var catalogConsumerResourceService = catalogClient.getCatalogConsumerResourceService(); | |
| var filter = new Array(); |
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
| $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" | |
| $headers.Add("Accept", "application/json") | |
| $headers.Add("Content-Type", "application/json") | |
| $url = "whatever.com" | |
| $r = Invoke-RestMethod $url -Headers $headers |
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
| //input: userEmail [String] | |
| //input: vmHost [VC:Host] | |
| var csv = "" | |
| // Setup Mail Client | |
| var message = new EmailMessage(); | |
| message.smtpHost = "smtp-host@org.co.uk"; | |
| message.fromName = "vCenter Orchestrator"; | |
| message.fromAddress = "noreply@org.co.uk"; |
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
| //input: userEmail [String] | |
| //input: cluster [VC:ClusterComputeResource | |
| var csv = "" | |
| var hosts = cluster.host | |
| // Setup Mail Client | |
| var message = new EmailMessage(); | |
| message.smtpHost = "smtp@org.co.uk"; | |
| message.fromName = "vCenter Orchestrator"; |
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
| #!/usr/bin/python | |
| import getpass | |
| import json | |
| import os | |
| from argparse import ArgumentParser | |
| from jinja2 import Environment, FileSystemLoader | |
| from vraapiclient import reservation |
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
| #!/usr/bin/python | |
| import json | |
| #full path to cloudclient | |
| cloudClientPath = '/PATH_TO_CLOUD_CLIENT/bin/cloudclient.sh' | |
| #Path to your prefix json file. If just the filename, it will look in the script directory | |
| prefixJSONFile = 'vra-machineprefixes.json' | |
| #Path to the resulting script file. If just the filename, it will look in the script directory | |
| prefixScriptFile = 'machineprefix-cloudclient-commands.sh' |
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
| #full path to cloudclient | |
| $cloudClientPath = "D:\cloudclient\bin\cloudclient.bat" | |
| #Path to your prefix json file | |
| $prefixJsonFile = "vra-machineprefixes.json" | |
| #Path to the resulting script file | |
| $prefixScriptFile = "machineprefix-cloudclient-commands.ps1" | |
| $machinePrefixes = Get-Content -Raw -Path "$($prefixJsonFile)" | ConvertFrom-Json | |
| $outFile = @() |