Created
May 9, 2016 10:24
-
-
Save PatrickTerlisten/006df05f1de3026b3110ef6001f2778a to your computer and use it in GitHub Desktop.
Connect to vSphere using SmartConnect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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