Transferring Files Using PowerCLI

I recently had a unique issue in that I needed to transfer some files to VM’s that were running in a secure environment. This meant there was no network access in our out of this environment except the one used by VMware Tools.  There is a powershell command that can be used to transfer files by utilizing VMware Tools.  This is very useful when transferring files even if it is not a secure environment.

Copy-VMGuestfile -Source “C:\Path\” -Destination “C:\Path\” -VM VMName -LocalToGuest -GuestUser “domain\user” -GuestPassword “password”

If you want to retrieve the file then replace -LocalToGuest with -GuestToLocal

One issue you may encounter is when you have multiple VM’s with the same name.  If they are using different folders then you can point to the correct folder path.

-VM $(Get-VM -Name VMName -Location folder)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: