Hot Shot
Hot Shot

Upload SSL Certo to ESXi with PowerCLI - possible?


Ive pretty much moved all of my admin and ESXi 4.1 scripting ver to PowerCLI, one thing ive not been able to figure out is how to upload Signed CA SSL Certificates to he ESXi hosts.

Ive been using to upload them, but id rather just use PowerCLI and drop the vSphere CLI totally.

Has anyone managed to do this, or is it not possible at this time?



0 Kudos
4 Replies

Can't you use the pscsp.exe command from the PuTTY Suite ?

See my sample script in


Blog: LucD notes

Twitter: lucd22

Blog:  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos

You could use something like this and it does not require TSM.

$file = "c:\tmp\delete\rui.crt"
$url  = "https://esx01/host/ssl_cert"  
$user = "root"
$pass = ""
$objADOStream = New-Object -ComObject ADODB.Stream
$objADOStream.Type = 1
$arrbuffer = $objADOStream.Read()
$objXMLHTTP = New-Object -ComObject MSXML2.ServerXMLHTTP.6.0
$objXMLHTTP.Open("PUT", $url, $False, $user, $pass)
$objXMLHTTP.SetOption(2, 13056)  


VMware Communities User Moderator

Now available - vSphere Quick Start Guide

Do you have a system or PCI card working with VMDirectPath? Submit your specs to the Unofficial VMDirectPath HCL.

0 Kudos
VMware Employee
VMware Employee

Hi John,

You can copy files in/out of datastores with the VimDatastore provider.When you start PowerCLI you have the "vmstores:" powershell drive that can be used to browse all the datastores on the servers you are currently connected to. After you connectec to a server, you can "cd" into the ESXi datastore and use the Copy-DatastoreItem cmdlet to copy some local files or files from other datastores. Here's a simple script that browses in a datastore, creates a folder and copies a file from the local file sistem to the datastore folder:

cd 'vmstores:\vc41-ga.pc@443\New Datacenter\datastore1\'

mkdir test

cd .\test

Copy-DatastoreItem -Item C:\some_file.ext

You can use the TAB key to autocomplete the path to the datastore folder. Great, isn't it? Smiley Happy



0 Kudos
Hot Shot
Hot Shot

0 Kudos