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
| Action: | |
| input: Location - string | |
| return: array/string | |
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
| // Copyright 2016, VMware, Inc. All Rights Reserved | |
| // | |
| // VMware vRealize Orchestrator action sample | |
| // | |
| // Checks the 'Connected' and 'Connect at power on' setting for every Network Adapter on a VM. | |
| // If the value is false, the workflow will update the setting to true on the Network Adapter. | |
| // VM can be powered off or powered on. All changes applied with a single vm reconfig task | |
| // | |
| //Action Inputs: | |
| // vm - VC:VirtualMachine |
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
| Get-VM | Select Name, id, @{Name="IP"; Expression={$_.VMHost | Get-VMHostNetwork | Select -ExpandProperty VirtualNic | where {$_.PortGroupName -match "dvpgManagement"} | Select IP}} |
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 Move-VMtoFolderPath { | |
| <# | |
| .SYNOPSIS | |
| Move VM to folder path | |
| .DESCRIPTION | |
| The function retrives complete folder Path from vcenter (Inventory >> Vms and Templates) | |
| .NOTES | |
| Author: Kunal Udapi | |
| http://kunaludapi.blogspot.com | |
| .PARAMETER N/a |
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 Import-VMAnnotation { | |
| <# | |
| .SYNOPSIS | |
| Import VM information Annotation, Notes into VM Attributes | |
| .DESCRIPTION | |
| The function set Annotation, Notes on VM into vcenter, you will require Export-VMAnnotation function to export data into CSV file. | |
| .NOTES | |
| Author: Kunal Udapi | |
| http://kunaludapi.blogspot.com | |
| .PARAMETER N/a |
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
| //Action Inputs: | |
| // cluster : VC:ClusterComputeResource | |
| // vlan : Number | |
| // | |
| //Action Result: Array/VC:DistributedVirtualPortgroup | |
| var toReturn = new Array(); | |
| var networks = cluster.network; |
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
| //Action Inputs: | |
| // hostname : string | |
| // instance : string | |
| // domain : string | |
| // user : string | |
| // password : SecureString | |
| //Action Result: Array/string | |
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
| //action inputs | |
| // restHost : REST:RESTHost | |
| // vhost : string | |
| // name : string | |
| // durable : boolean | |
| // autoDelete : boolean | |
| // autoExpire : number | |
| // maxLength : number | |
| // deadLetterExchange : string | |
| // deadLetterRoutingKey : string |
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
| $vm = Get-VM | |
| $vmview = $vm | Get-View | |
| Foreach ($v in $vmview){ | |
| echo "-----------------------" | |
| echo $v.Name | |
| echo $v.Config.uuid | |
| echo "-----------------------" | |
| $Name = $v.Guest.HostName | |
| If ($Name -ne $null -and $Name -ne ""){ |
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
| //Action Inputs | |
| // cluster - VC:ClusterComputeResource | |
| // | |
| //Action Result: VC:HostSystem | |
| var hosts = cluster.host; | |
| var host; | |
| for (var h in hosts) { | |
| if (hosts[h].runtime.connectionState.value == "connected" && hosts[h].runtime.inMaintenanceMode == false) { | |
| host = hosts[h]; |