[python-win32] WMI and Terminal Services

smapusPy anywho.scoggins at gmail.com
Fri Jan 20 23:13:42 CET 2012


I know this thread is a bit old, but for those of you who find this and
wonder if there was a solution, this is what works for me.

<code>
import win32com.client
from win32com.client import GetObject

licenseState =
['Unknown','Temperary','Active','Upgraded','Revoked','Pending','Concurrent']

computer = "YourComputerName"
nt =
GetObject(r"winmgmts:{impersonationLevel=impersonate}!\\%s\root\cimv2"%computer)
licenses = nt.ExecQuery("Select * from Win32_TSIssuedLicense")

for license in licenses: print license.sIssuedToComputer,
licenseState[license.LicenseStatus]

</code>

--
View this message in context: http://python.6.n6.nabble.com/WMI-and-Terminal-Services-tp1956950p3884176.html
Sent from the Python - python-win32 mailing list archive at Nabble.com.


More information about the python-win32 mailing list