Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Connect to vSphere using SmartConnect
import ssl
from pyVim.connect import SmartConnect
s = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
s.verify_mode = ssl.CERT_NONE
c = SmartConnect(host="192.168.20.1", user="root", pwd='Passw0rd', sslContext=s)
h = c.content.sessionManager.currentSession.key
print (h)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.