Retrieve Win32 domain name

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Aug 27 00:12:42 EDT 2008


En Tue, 26 Aug 2008 05:39:55 -0300, Salim Fadhley <salimfadhley at gmail.com>  
escribi�:

> I'm looking for a method to retrieve a Windows Domain name (not a DNS
> Domain name).
>
> I know this can be done by simply reading an environment variable,
> however on the machines I need to work with sometimes the environment
> variables can be messed-up and are not trustworthy.
>
> Is there somebody who knows the Win32 library who can point me to the
> function I need? The Win32Net seems to contain a whole load of
> functions for manipulating Windows networking resources, however I
> couldn't find a function which simply returned information about the
> local computer.

You didn't search enough then: try win32net.NetWkstaGetInfo(None, 100)

-- 
Gabriel Genellina




More information about the Python-list mailing list