You can use the vSphere Guest Operations API or the PowerCLI Invoke-VMScript and Copy-VMGuestFile cmdlet in your customization workflows for SDDC VMs.
Prerequisites
- Configure either or both of these connections between your on-premises environment and your SDDC.
- IPSec VPN
- A dedicated high bandwidth, low latency connection.
- Create a management network firewall rule that allows access from your on-premises network to port 443 of your SDDC hosts. See Add or Modify Management Gateway Firewall Rules in the VMware Cloud on Public Cloud Networking and Security guide.
- Use a jump server located in the hyperscaler native cloud instance.
Procedure
Example: Using the PowerCLI Invoke-VMScript Cmdlet
After you establish a network connection that allows traffic to port 443 on your hosts, you can use the Guest Operations API directly, or via PowerCLI as shown here. API and cmdlet requests go to port 443 on the host where the subject VM (Win10-Example here) is running. VMware Tools running on the VM handles the requested guest operations.
PS C:\Users\admin> $vm = Get-VM Win10-Example PS C:\Users\admin> Invoke-VMScript -ScriptText "dir C:\" -VM $vm -GuestUser admin -GuestPassword $passwd" ScriptOutput ------------------------------------------------------ | | Directory: C:\ | | ...