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
| #Variable declaration | |
| $vCenterIPorFQDN="10.0.1.210" | |
| $vCenterUsername="Administrator@vsphere.local" | |
| $vCenterPassword="vmware" | |
| $ESXiHost="10.0.1.62" | |
| $NumberOfVmToDeploy=2 #How many VM deploy from template | |
| $OracleTemplate="OraTemplate" | |
| $DestinationDatastore="datastore1" | |
| $ESXiHostUsername="root" #ESXi Host username | |
| $ESXiHostPassword="mypassword" #ESXi Host password |
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
| #Variable declaration | |
| $vCenterIPorFQDN="10.0.1.210" | |
| $vCenterUsername="Administrator@vsphere.local" | |
| $vCenterPassword="vmware" | |
| $LocationName="Datacenter" #This could be: Datacenter Name, Cluster Name, Host Name | |
| $ClusterName="TestCluster" #Name of the Cluster on which you need to run the report | |
| $OutputPath="C:\" #Location where you want to place generated report | |
| Write-Host "Connecting to vCenter" -foregroundcolor "magenta" | |
| Connect-VIServer -Server $vCenterIPorFQDN -User $vCenterUsername -Password $vCenterPassword |
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
| ##################BEGIN FUNCTIONS | |
| function connectServer{ | |
| try { | |
| $connect = Connect-VIServer -Server $serverTextBox.Text -User $usernameTextBox.Text -Password $passwordTextBox.Text | |
| $buttonConnect.Enabled = $false #Disable controls once connected |
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
| #Variable declaration | |
| $vCenterIPorFQDN="192.168.243.40" | |
| $vCenterUsername="Administrator@vsphere.local" | |
| $vCenterPassword="vmware" | |
| $ESXiHost="192.168.243.62" | |
| $outputFile="C:\Users\Paolo\Desktop\mycharts.html" | |
| $stat = "mem.usage.average" #Stat to measure | |
| #Available stats | |
| #cpu.usage.average |
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
| #Variable declaration | |
| $vCenterIPorFQDN="10.0.1.210" | |
| $vCenterUsername="Administrator@vsphere.local" | |
| $vCenterPassword="vmware" | |
| $OutputFile="C:\Users\Paolo\Desktop\Report.html" #Where you want to place generated report | |
| Write-Host "Connecting to vCenter" -foregroundcolor "magenta" | |
| Connect-VIServer -Server $vCenterIPorFQDN -User $vCenterUsername -Password $vCenterPassword | |
| #A JavaScript to add some style to our report |
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
| #Variable declaration | |
| $vCenterIPorFQDN="10.0.1.210" | |
| $vCenterUsername="Administrator@vsphere.local" | |
| $vCenterPassword="vmware" | |
| $ClusterName="My Cluster" #Name of the cluster from which you want to retrieve VM infos | |
| #Location where you want to place generated JSON Files. | |
| #Please be aware that you should place them in the "data" folder in order to make WebPowerCLI read data from them | |
| $OutputPath="C:\Users\Paolo\Desktop\data" | |
| Write-Host "Depending on how many VMs you have in your cluster this script could take a while...please be patient" -foregroundcolor "magenta" |
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
| #Variable declaration | |
| $vCenterIPorFQDN="192.168.243.40" | |
| $vCenterPort="443" | |
| $vCenterUsername="Administrator@vsphere.local" | |
| $vCenterPassword="vmware" | |
| $DatacenterFolder="DCFolder" | |
| $DatacenterName="Datacenter" | |
| $MgmtClusterName="MgmtCluster" | |
| $OpenStackClusterNames=@("OpenStackCluster") #Cluster(s) managed by OpenStack | |
| $MgmtHosts= @("192.168.243.144") #IP or FQDN of hosts participating in Management Cluster |
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
| <?php | |
| $variable1=$_POST["sendpowercli"]; | |
| //Post Data | |
| if ($variable1 != null){ | |
| $command = $variable1; | |
| $powercli = "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -psc \"C:\\Program Files (x86)\\VMware\\Infrastructure\\vSphere PowerCLI\\vim.psc1\" -Command \"& {$command}\""; | |
| $query = shell_exec("$powercli"); | |
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
| #Variable declaration | |
| $vCenterIPorFQDN="192.168.243.172" | |
| $vCenterUsername="Administrator@vsphere.local" | |
| $vCenterPassword="vmware" | |
| $pathToVcloudAgent="/opt/vmware/vcloud-director/agent" #Path of vCloud Agent in vCloud Director virtual machine | |
| $FileVcloudAgent="vcloudagent-esx51-5.1.0-799577.zip" #vCloud Agent file that will be installed | |
| $downloadDestination="C:\Users\Paolo\Desktop" #Where to download vCloud Agent on local machine | |
| $vCdVmName="vCloud Director" #Name of vCloud Director virtual machine | |
| $vCdVmUsername="root" #vCloud Director virtual machine username | |
| $vCdVmPassword="vmware" #vCloud Director virtual machine password |
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
| #Variable declaration | |
| $vCloudIPorFQDN="192.168.243.50" | |
| $vCloudUsername="User1" | |
| $vCloudPassword="mypassword" | |
| $vCloudOrganization="HostileCoding" | |
| $outputFile="C:\Users\Paolo\Desktop\mobilereport.html" | |
| #Connecting to vCloud | |
| Connect-CIServer -Server $vCloudIPorFQDN -User $vCloudUsername -Password $vCloudPassword -Org $vCloudOrganization |
OlderNewer