Upload
truongkhue
View
283
Download
8
Embed Size (px)
Citation preview
Get-CatalogGet-CIAccessControlRule
New-CIAccessControlRuleRemove-CIAccessControlRule
Set-CIAccessControlRuleAdd-CIDatastoreGet-CIDatastore
Get-CINetworkAdapterSet-CINetworkAdapter
Get-CIRoleConnect-CIServer
Disconnect-CIServerGet-CIUser
Get-CIVAppImport-CIVApp
New-CIVAppRemove-CIVAppRestart-CIVApp
Set-CIVAppStart-CIVAppStop-CIVApp
Suspend-CIVAppRestart-CIVAppGuest
Stop-CIVAppGuestSuspend-CIVAppGuest
Get-CIVAppNetworkNew-CIVAppNetwork
Remove-CIVAppNetworkSet-CIVAppNetwork
Get-CIVAppStartRuleSet-CIVAppStartRuleGet-CIVAppTemplate
Import-CIVAppTemplateNew-CIVAppTemplate
Remove-CIVAppTemplateSet-CIVAppTemplate
Get-CIViewGet-CIVM
New-CIVMRestart-CIVM
Start-CIVMStop-CIVM
Suspend-CIVMRestart-CIVMGuest
Stop-CIVMGuestGet-CIVMTemplate
Search-CloudGet-CloudCommandGet-ExternalNetwork
Get-MediaGet-NetworkPool
Get-OrgNew-Org
Remove-OrgSet-Org
Get-OrgNetworkNew-OrgNetwork
Remove-OrgNetworkSet-OrgNetwork
Get-OrgVdcNew-OrgVdc
Remove-OrgVdcSet-OrgVdc
Get-OrgVdcNetwork
Cloud
http://blogs.vmware.com/PowerCLI/Copyright © 2017 VMware, Inc. All rights reserved. @PowerCLI @vmwarepowercli @PowerCLI
VMware PowerCLI 6.5 Release 1 Reference Poster
Get-PowerCLIConfigurationSet-PowerCLIConfiguration
Get-PowerCLIDocumentationGet-PowerCLIVersion
Get-PowerCLICommunityGet-PowerCLIHelp
PowerCLI Settings
Get-NfsUserNew-NfsUser
Remove-NfsUserSet-NfsUser
Get-SpbmCapabilityGet-SpbmCompatibleStorageGet-SpbmEntityConfigurationSet-SpbmEntityConfiguration
Get-SpbmFaultDomainStart-SpbmReplicationFailover
Get-SpbmReplicationGroupSync-SpbmReplicationGroup
Get-SpbmReplicationPairStart-SpbmReplicationPrepareFailover
Start-SpbmReplicationReverseNew-SpbmRule
New-SpbmRuleSetExport-SpbmStoragePolicy
Get-SpbmStoragePolicyImport-SpbmStoragePolicy
New-SpbmStoragePolicyRemove-SpbmStoragePolicy
Set-SpbmStoragePolicyGet-VAIOFilter
New-VAIOFilterRemove-VAIOFilter
Set-VAIOFilterGet-VasaProvider
New-VasaProviderRemove-VasaProviderGet-VasaStorageArray
Copy-VDiskGet-VDisk
Move-VDiskNew-VDisk
Remove-VDiskSet-VDisk
Storage Operations
Switch-ActiveDeployRuleSetGet-AutoDeployCommand
Export-AutoDeployStateImport-AutoDeployState
Repair-DeployImageCacheGet-DeployOptionSet-DeployOption
Add-DeployRuleCopy-DeployRule
Get-DeployRuleNew-DeployRule
Remove-DeployRuleSet-DeployRule
Get-DeployRuleSetSet-DeployRuleSet
Repair-DeployRuleSetComplianceTest-DeployRuleSetCompliance
Apply-ESXImageProfileSet-ESXImageProfileAssociation
Add-ProxyServerGet-ProxyServer
Remove-ProxyServerAdd-ScriptBundleGet-ScriptBundle
Get-VMHostAttributesGet-VMHostImageProfile
Get-VMHostMatchingRules
AutoDeploy
Move-ClusterNew-Cluster
Remove-ClusterSet-Cluster
Get-DrmInfoApply-DrsRecommendation
Get-DrsRecommendationInvoke-DrsRecommendation
Get-DrsRuleNew-DrsRule
Remove-DrsRuleSet-DrsRule
Get-ResourcePoolMove-ResourcePoolNew-ResourcePool
Remove-ResourcePoolSet-ResourcePool
Cluster Operations
Attach-BaselineDetach-Baseline
Get-BaselineRemove-BaselineGet-ComplianceTest-Compliance
Update-EntityAdd-EntityBaseline
Remove-EntityBaselineRemediate-Inventory
Scan-InventoryCopy-Patch
Download-PatchGet-Patch
Stage-PatchSync-Patch
Get-PatchBaselineNew-PatchBaselineSet-PatchBaseline
Update Manager
Compare-EsxImageProfileExport-EsxImageProfile
Get-EsxImageProfileNew-EsxImageProfile
Remove-EsxImageProfileSet-EsxImageProfile
Add-EsxSoftwareDepotGet-EsxSoftwareDepot
Remove-EsxSoftwareDepotAdd-EsxSoftwarePackageGet-EsxSoftwarePackage
Remove-EsxSoftwarePackageGet-ImageBuilderCommand
Image Builder
Connect-SrmServerDisconnect-SrmServer
SRM
Connect-HVServerDisconnect-HVServer
Horizon View
Get-OMAlert
Set-OMAlert
Get-OMAlertDefinition
Get-OMAlertSubType
Get-OMAlertType
Get-OMRecommendation
Get-OMResource
Connect-OMServer
Disconnect-OMServer
Get-OMStat
Get-OMStatKey
Get-OMUser
vR Ops
Apply-VMHostProfileExport-VMHostProfile
Get-VMHostProfileImport-VMHostProfileInvoke-VMHostProfile
New-VMHostProfileRemove-VMHostProfile
Set-VMHostProfileTest-VMHostProfileCompliance
Get-VMHostProfileRequiredInput
Host Profiles
Get-TagNew-Tag
Remove-TagSet-Tag
Get-TagAssignmentNew-TagAssignment
Remove-TagAssignmentGet-TagCategory
New-TagCategoryRemove-TagCategory
Set-TagCategory
Tag Operations
Get-LogGet-LogType
Get-StatGet-StatInterval
New-StatIntervalRemove-StatInterval
Set-StatIntervalGet-StatType
Get-ErrorReportGet-VIEvent
Logging and Statistics
Export-VAppGet-VApp
Import-VAppMove-VAppNew-VApp
Remove-VAppSet-VApp
Start-VAppStop-VApp
VApp
Get-VsanClusterConfigurationSet-VsanClusterConfiguration
Test-VsanClusterHealthGet-VsanDisk
New-VsanDiskRemove-VsanDisk
Get-VsanDiskGroupNew-VsanDiskGroup
Remove-VsanDiskGroupGet-VsanFaultDomain
New-VsanFaultDomainRemove-VsanFaultDomain
Set-VsanFaultDomainUpdate-VsanHclDatabase
Test-VsanNetworkPerformanceGet-VsanResyncingComponent
Get-VsanSpaceUsageTest-VsanStoragePerformance
Test-VsanVMCreation
vSAN Operations
Dismount-ToolsMount-Tools
Update-ToolsWait-Tools
Get-VMGuestRestart-VMGuest
Shutdown-VMGuestStop-VMGuest
Suspend-VMGuestCopy-VMGuestFile
Get-VMGuestNetworkInterfaceSet-VMGuestNetworkInterface
Get-VMGuestRouteNew-VMGuestRoute
Remove-VMGuestRouteInvoke-VMScript
Guest OS
Remove-VDSwitchPrivateVlanAdd-VDSwitchVMHost
Remove-VDSwitchVMHostGet-VDTra�cShapingPolicySet-VDTra�cShapingPolicy
Get-VDUplinkLacpPolicySet-VDUplinkLacpPolicy
Get-VDUplinkTeamingPolicySet-VDUplinkTeamingPolicy
Set-VDVlanConfigurationGet-VirtualPortGroup
New-VirtualPortGroupRemove-VirtualPortGroup
Set-VirtualPortGroupGet-VirtualSwitch
New-VirtualSwitchRemove-VirtualSwitch
Set-VirtualSwitchGet-SecurityPolicySet-SecurityPolicy
Add-VirtualSwitchPhysicalNetworkAdapterRemove-VirtualSwitchPhysicalNetworkAdapter
Get-VDBlockedPolicySet-VDBlockedPolicy
Get-VDPortSet-VDPort
Export-VDPortGroupGet-VDPortgroup
New-VDPortgroupRemove-VDPortGroup
Set-VDPortgroupGet-VDPortgroupOverridePolicySet-VDPortgroupOverridePolicy
Get-VDSecurityPolicySet-VDSecurityPolicy
Export-VDSwitchGet-VDSwitch
New-VDSwitchRemove-VDSwitch
Set-VDSwitchAdd-VDSwitchPhysicalNetworkAdapter
Remove-VDSwitchPhysicalNetworkAdapterGet-VDSwitchPrivateVlan
New-VDSwitchPrivateVlan
Network
Get-DatastoreMove-DatastoreNew-Datastore
Remove-DatastoreSet-Datastore
Get-ESXGet-EsxCli
Get-EsxTopGet-HAPrimaryVMHost
Get-IScsiHbaTargetNew-IScsiHbaTarget
Remove-IScsiHbaTargetSet-IScsiHbaTarget
Get-NicTeamingPolicySet-NicTeamingPolicy
Add-PassthroughDeviceGet-PassthroughDevice
Remove-PassthroughDeviceGet-ScsiController
New-ScsiControllerSet-ScsiController
Get-ScsiLunSet-ScsiLun
Get-ScsiLunPathSet-ScsiLunPath
Add-VirtualSwitchPhysicalNetworkAdapterRemove-VirtualSwitchPhysicalNetworkAdapter
Add-VMHostGet-VMHost
Move-VMHostRemove-VMHostRestart-VMHost
Set-VMHostStart-VMHostStop-VMHost
Suspend-VMHostGet-VMHostAccount
New-VMHostAccountRemove-VMHostAccount
Set-VMHostAccountGet-VMHostAdvancedConfigurationSet-VMHostAdvancedConfiguration
Get-VMHostAuthenticationSet-VMHostAuthentication
Get-VMHostAvailableTimeZoneGet-VMHostDiagnosticPartitionSet-VMHostDiagnosticPartition
Get-VMHostDiskFormat-VMHostDiskPartition
Get-VMHostDiskPartition
Get-VMHostFirewallDefaultPolicySet-VMHostFirewallDefaultPolicy
Get-VMHostFirewallExceptionSet-VMHostFirewallException
Get-VMHostFirmwareSet-VMHostFirmwareGet-VMHostHardware
Get-VMHostHbaSet-VMHostHba
Get-VMHostModuleSet-VMHostModule
Get-VMHostNetworkSet-VMHostNetwork
Get-VMHostNetworkAdapterNew-VMHostNetworkAdapter
Remove-VMHostNetworkAdapterSet-VMHostNetworkAdapter
Add-VMHostNtpServerGet-VMHostNtpServer
Remove-VMHostNtpServerGet-VMHostPatch
Install-VMHostPatchGet-VMHostPciDevice
Get-VMHostRouteNew-VMHostRoute
Remove-VMHostRouteSet-VMHostRoute
Get-VMHostServiceRestart-VMHostService
Set-VMHostServiceStart-VMHostServiceStop-VMHostService
Get-VMHostSnmpSet-VMHostSnmp
Test-VMHostSnmpGet-VMHostStartPolicySet-VMHostStartPolicy
Get-VMHostStorageSet-VMHostStorage
Get-VMHostSysLogServerSet-VMHostSysLogServer
Get-VMStartPolicySet-VMStartPolicy
ESXi Host Operations
Get-AdvancedSettingNew-AdvancedSetting
Remove-AdvancedSettingSet-AdvancedSetting
Get-AlarmActionNew-AlarmAction
Remove-AlarmActionGet-AlarmActionTrigger
New-AlarmActionTriggerRemove-AlarmActionTrigger
Get-AlarmDefinitionSet-AlarmDefinition
Get-AnnotationSet-Annotation
Connect-CisServerDisconnect-CisServer
Get-CisServiceGet-Cluster
Get-ContentLibraryItemGet-CustomAttribute
New-CustomAttributeRemove-CustomAttribute
Set-CustomAttributeGet-Datacenter
Move-DatacenterNew-Datacenter
Remove-DatacenterSet-Datacenter
Get-DatastoreClusterNew-DatastoreCluster
Remove-DatastoreClusterSet-DatastoreClusterNew-DatastoreDriveCopy-DatastoreItem
Get-FolderMove-FolderNew-Folder
Remove-FolderSet-Folder
Get-InventoryMove-Inventory
Remove-InventoryGet-LicenseDataManager
Get-OSCustomizationNicMappingNew-OSCustomizationNicMapping
Remove-OSCustomizationNicMappingSet-OSCustomizationNicMapping
Get-OSCustomizationSpecNew-OSCustomizationSpec
Remove-OSCustomizationSpecSet-OSCustomizationSpec
Get-OvfConfiguration
Get-TaskStop-TaskWait-Task
Get-VIAccountGet-VICommand
Get-VICredentialStoreItemNew-VICredentialStoreItem
Remove-VICredentialStoreItemGet-View
New-VIInventoryDriveGet-VIObjectByVIView
Get-VIPermissionNew-VIPermission
Remove-VIPermissionSet-VIPermission
Get-VIPrivilegeGet-VIProperty
New-VIPropertyRemove-VIProperty
Get-VIRoleNew-VIRole
Remove-VIRoleSet-VIRole
Connect-VIServerDisconnect-VIServer
vSphere
VMware PowerCLI
UpdateManager
vRealizeOperations vCloud Air Cloud
Infrastructure
vSphere Core Auto Deploy Image Builder vCloud HighAvailability
Horizon View LicenseManager Storage Distributed
Switch Mirage
UEM
Get-CDDriveNew-CDDrive
Remove-CDDriveSet-CDDrive
Get-FloppyDriveNew-FloppyDrive
Remove-FloppyDriveSet-FloppyDrive
Copy-HardDiskGet-HardDisk
Move-HardDiskNew-HardDisk
Remove-HardDiskSet-HardDisk
Get-NetworkAdapterNew-NetworkAdapter
Remove-NetworkAdapterSet-NetworkAdapter
Add-PassthroughDeviceGet-PassthroughDevice
Remove-PassthroughDeviceGet-Snapshot
New-SnapshotRemove-Snapshot
Set-SnapshotGet-Template
Move-TemplateNew-Template
Remove-TemplateSet-Template
Get-UsbDeviceRemove-UsbDevice
Export-VMGet-VM
Move-VMNew-VM
Remove-VMRestart-VM
Set-VMStart-VMStop-VM
Suspend-VMOpen-VMConsoleWindow
Answer-VMQuestionGet-VMQuestionSet-VMQuestion
Get-VMResourceConfigurationSet-VMResourceConfiguration
VM Operations
To list all the snapshots for all virtual machines:Get-VM | Get-SnapshotTo snapshot a VM: New-Snapshot -VM "XP SP2" -Name BeforePatch1To remove a snapshot: Remove-Snapshot -Snapshot $snapshot1 –RemoveChildren
Snapshot Operations
Top 5 VM memory allocation:Get-VM | Sort-Object -Property MemoryGB -Descending | Select-First 5
Total memory available on all ESXi:Get-VMHost | Measure-Object -Property MemoryTotalGB -Sum |Select -ExpandProperty Sum
Report on NumCPU and number of VM:Get-VM | Group-Object -Property NumCpu |Select @{N="NumCpu";E={$_.Name}},@{N="Number ofVM";E={$_.Count}}
Most API methods require parameters.You create those with New-Object:$vm = Get-VM -Name MyVM$spec = New-Object VMware.Vim.VirtualMachineConfigSpec$spec.latencySensitivity = New-ObjectVMware.Vim.LatencySensitivity$spec.LatencySensitivity.Level =[VMware.Vim.LatencySensitivitySensitivityLevel]::high$vm.ExtensionData.reReconfigVM($spec)
Quick Helpful Commands
To list all resource pools on the connected VMware vSphere server and some oftheir properties: Get-ResourcePool
To create a new resource pool:$clusterRootRP = Get-ResourcePool -Location(Get-Cluster ResearchAndDevelopmentCluster) -Name ResourcesNew-ResourcePool -Location $clusterRootRP -Name DevelopmentResources-CpuExpandableReservation $true -CpuReservationMhz 500 -CpuSharesLevel high -MemExpandableReservation $true -MemReservationMB 500 -MemSharesLevel high
Resource Pool Operations
To list all tasks for a VMware vSphere server and some of their properties:Get-TaskTo stop a task (example: stops the task of removing the VM):Stop-Task -Task (Remove-VM -VM "Lync-Edge-03" -Confirm -RunAsync)To wait until a task is completed before continuing:Wait-Task -Task (Remove-VM -VM "Lync-Edge-03" -Confirm -RunAsync)
Task Information
Invoke-VMScript allows BIN, BASH, and Powershell Commands to be invoked remotelyInvoke-VMScript -VM LABTEST1 -ScriptText "dir" -GU Administrator -GP "VMware1!"
Invoke Commands in Virtual Machines
Create a tag category:New-TagCategory -Name "Owner" -Cardinality Single -EntityType
VirtualMachineRemove-TagCategory "Owner"Create a tag:$myTag = New-Tag -Name "jSmith" -Category "Owner"Assign a tag:Get-VM -Name "Lync-Edge-*" | New-TagAssignment -Tag $myTagGet-VM -Tag "jSmith"
Tag Operations
Using OVFConfiguration to deploy vApps:$ovfconfig = get-OvfConfiguration “myOvfTemplate.ovf”$ovfconfig.ToHashtable()
Use a hashtable:$ovfconfig = @{"vami.DNS.VMware_vCenter_Log_Insight" = "10.144.99.5";"vami.gateway.VMware_vCenter_Log_Insight" = "10.144.99.1";"vami.ip0.VMware_vCenter_Log_Insight" = "10.144.99.30";"vami.netmask0.VMware_vCenter_Log_Insight" = "255.255.255.0";"vm.rootpw" = "VMware1!";}
Or populate an object:$ovfconfig.NetworkMapping.Network.Value = “Network 1”$ovfconfig.vami.VM_1.ip0.Value = “10.144.99.30”$ovfPath = “c:\temp\myOvfTemplate.ovf”
Import-Vapp $ovfPath -OvfConfiguration $ovfConfig -VMHost $vmHost -Name “VM_OVF”
OVF Configuration
Returns a VMware vSphere.Net view object by specified search criteria.$vm = Get-View -ViewType VirtualMachine -Filter @{"Name" = "MS Win XP SP2"}$hostView = Get-View -ID $vm.Runtime.Host$hostView.Summary.Runtime
Another example:(Get-View (Get-VMHost 'ESX1' | getview).ConfigManager.VmotionSystem).SelectVnc('vmk0')
API Reference: https://www.vmware.com/support/developer/vc-sdk/
API Operations
To list all of the VSAN disks groups for an ESXi host:Get-VsanDiskGroup -VMHost (Get-VMHost | select -first 1)
To list all of the disks within a VSAN disk group for an ESXi host:$vmhost = Get-VMHost | select -First 1$vsanDiskGroup = Get-VsanDiskGroup -VMHost $vmhostGet-VsanDisk -VsanDiskGroup $vsanDiskGroup
To create a new VSAN disk group for an ESXi host$vmhost = Get-VMHost | select -First 1$ssd = Get-ScsiLun -VmHost $vmhost | where {$_.extensiondata.ssd -eq $true -and$_.ExtensionData.LocalDisk -eq $true}$datadisk = Get-ScsiLun -VmHost $vmhost | where {$_.extensiondata.ssd -eq $false -and $_.ExtensionData.LocalDisk -eq $true}New-VsanDiskGroup -VMHost $vmhost -SsdCanonicalName $ssd.CanonicalName -DataDiskCanonicalName $datadisk.CanonicalName
To remove a disk from a VSAN disk group:$vmhost = Get-VMHost | select -First 1$vsanDiskGroup = Get-VsanDiskGroup -VMHost $vmhost$vsanDisk = Get-VsanDisk -VsanDiskGroup $vsanDiskGroup | select -first 1Remove-VsanDisk -VsanDisk $vsanDisk
vSAN Operations
To list all virtual switches attached to a VM and some of their properties, use:Get-VirtualSwitch -VM (Get-VM -Name "Lync-Edge-03")To create a new virtual switch:New-VirtualSwitch -VMHost (Get-VMHost -Name 192.168.0.10) -Name Switch02To remove a virtual switch:$vs = Get-VirtualSwitch -VMHost 192.168.0.10 -Name VS23Remove-VirtualSwitch -VirtualSwitch $vsTo change the configuration of a virtual switch:$vs = New-VirtualSwitch -Host 192.168.0.10 -Name VirtSwitchSet-VirtualSwitch -VirtualSwitch $vs -MTU 500
Virtual Switch Operations
Get-AlarmDefinition # Returns all the defined alarms on the servers you’re connected to.Get-AlarmDefinition -Name "virtual machine*" -Enabled $false# Returns all the disabled alarm definitions with names starting with “virtual machine.”Get-VMHost hostname | Get-AlarmDefinition # Returns all alarms that apply to the host “hostname”. Includes alarms defined on this host and alarms inherited from the parent entity, or from any ancestors in the inventory hierarchy.Modify an alarm definition: Get-AlarmDefinition "Host memory status" |Set-AlarmDefinition -Name "Host memory" -Enabled $false# This will rename the alarm to “Host memory” and disable it.
Events and Alarms
To list all the port groups and some of their properties:$vs = Get-VirtualSwitch -VMHost 192.168.0.10 -Name Switch02Get-VirtualPortGroup -VirtualSwitch $vsTo add a new port group to a virtual switch:$vs = Get-VirtualSwitch -VMHost 192.168.0.10 -Name Switch02$vpg = New-VirtualPortGroup -VirtualSwitch $vs -Name VPG1Other cmdlets include:Remove-VirtualPortGroupSet-VirtualPortGroup
Port Group Operations
To connect to a VMware vSphere server. Start a new session or reestablish aprevious session with a VMware vSphere server.$srv = Connect-VIServer –Server 192.168.0.10 -User Admin -Password Pass01To disconnect from the connected vSphere server:Disconnect-VIServer -Server $srv -Confirm:$false
How to Connect to vCenter Server or ESXi
Utilizing the Get-ESXCLI cmdlet with new -V2 parameter to perform two pings from an ESXi host:$esxcli2 = Get-ESXCLI -VMHost (Get-VMhost | Select -first 1) -V2
$arguments = $esxcli2.network.diag.ping.CreateArgs()$arguments.count = 2$arguments.host = “10.0.0.8”$esxcli2.network.diag.ping.Invoke($arguments)
Utilizing the Get-ESXCLI cmdlet with new -V2 parameter to perform two pings from an ESXi host:$esxcli2 = Get-ESXCLI -VMHost (Get-VMhost | Select -first 1) -V2
$arguments = $esxcli2.storage.vmfs.unmap.CreateArgs()$arguments.volumelabel = “Datastore1”$esxcli2.storage.vmfs.unmap.Invoke($arguments)
ESXCLI V2 Operations
The VMware PowerCLI Community Repository is a central location where anyone can contribute their own resources. The repository features a Principles of Operations document to help guide contributors along the process of using, creating, and updating resources which are contained within the repository.
Link: https://github.com/vmware/PowerCLI-Example-Scripts
Featured Modules:
- Horizon View Helper - VM Encryption- vCenter High Availability
Featured Scripts:
- Home Lab Deployment- A�nity Rule Creation- LUN Path Report
PowerCLI Community Repository
Method to not have to input credentials every time you connect to vCenter:New-VICredentialStoreItem -Host vCSA.lab.local -User Root -Password "VMware1!"To remove credentials: Remove-VICredentialStoreItem -Host vCSA.lab.local -Confirm
How to Store vCenter Credentials
PowerCLI Community
Get-EsxTop –Counter
# View the fields available for vCPU counter:(Get-EsxTop –Counter –CounterName VCPU).FieldsGet-EsxTop –TopologyInfo
# View the entries of a specific topology:(Get-EsxTop –TopologyInfo –Topology SchedGroup).Entries | FT# Retrieve the counter values for “VCPU” and “SchedGroup" counters:Get-EsxTop –CounterName VCPU | FT * -AutoSizeGet-EsxTop –CounterName SchedGroup | FT * -AutoSize
ESXTOP through PowerCLI
Files can be copied between user’s local machine and a VM Copy from a VM to the Local Machine:Copy-VMGuestFile -VM LABTEST1 -GuestUser Administrator -GuestPassword "VMware1!" -GuestToLocal -Source c:\temp\logfile.txt -Destination c:\temp\
Copy Files To/From VM
Connect to vCenter Server firstConnect-SrmServer -SrmServerAddress 10.144.99.6 -User "administrator" -Password "myPassword"Disconnect-SrmServer -Server 10.144.99.6
How to Connect to SRM
Connect to the Horizon View Server: $hvserver = Connect-HVServer -Server
view connection.fqdn -User administrator -Password VMware1! -Domain domain.local
Access the Horizon View API: $hvapi = $global:defaultHVservers[0].ExtensionData
View the health of the Horizon View Connection Servers:$hvapi.connectionserverhealth.connectionserverhealth_list()
View the Horizon View Session Data: $hvapi.connectionserverhealth.connectionserverhealth_list().ConnectionData
View connected vCenter Servers:$hvapi.VirtualCenter.VirtualCenter_List()
Horizon View API Reference: http://developercenter.vmware.com/web/dp/explorer-apis/4595/view
Horizon View Operations
O�cial PowerCLI Blog - http://blogs.vmware.com/PowerCLI/Documentation - http://vmware.com/support/developer/PowerCLI/index.htmlVMware PowerCLI Community - http://vmware.com/go/powercliTwitter - https://twitter.com/PowerCLILinkedIn - http://www.linkedin.com/groups/PowerCLI-Users-162324Facebook - https://www.facebook.com/vmwarepowercliSlack - https://code.vmware.com/web/code/joinVMware Education Course: Data Center Automation with vRealize Orchestrator and vSphere PowerCLI - https://mylearn.vmware.com/mgrreg/courses.cfm?a=one&id_subject=71972
Third-Party PowerCLI training from Pluralsight - http://www.pluralsight.com
PowerCLI Sites
VMware Flings featuring PowerCLI - https://labs.vmware.com/flings/?product=PowerCLI
PowerCLI Core - Enable users of Linux, Mac and Docker to now use the same cmdlets which were previously only available on Windows.PowerActions for vSphere Web Client - PowerActions integrates the vSphere Web Client and PowerCLI to provide complex automation solutions from within the standard vSphere management client.Onyx for the Web Client - Onyx for the Web Client is a Fling that translates actions taken in the vSphere Web Client to PowerCLI.Net code.PowerCLI Extensions - PowerCLI Extensions gives PowerCLI users early access to functionality by extending the core PowerCLI cmdlets to include new experimental features and gives PowerCLI users the ability to provide early feedback.
PowerCLI Based Flings
What is PowerCLI?
VMware PowerCLI is a powerful, easy-to-use scripting interface to manage the vSphere platform. Administrators can leverage more than 360 cmdlets to simplify everyday tasks.
PowerCLI Info
VMware PowerCLI frequently asked questions (FAQs) link:http://communities.vmware.com/docs/DOC-13700To find out what cmdlets are available: Get-VICommandTo show documentation for all available cmdlets: Get-PowerCLIDocumentationFor help with a cmdlet: Get-Help cmdlet-name –Full
Getting Started