Re: [python-win32] Get DN of Computer (OU Located)
by Tim Golden other posts by this author
Nov 5 2009 4:17AM messages near this date
[python-win32] Get DN of Computer (OU Located)
|
[python-win32] Extending Vista/Windows7 with Python
Jose Noto wrote:
> Good morning,
>
> I'm trying to create a script where I need to know in witch OU / DN the
> computer is located from just knowing its hostname and I can not figure
> it out or find anything about it on the net. Does anyone know how to do it?
>
> On VBScript would be something like this:
>
> Set objSysInfo = CreateObject("ADSystemInfo")
> strComputer = objSysInfo.ComputerName
Translating literally:
<code>
import win32com.client
sys_info = win32com.client.Dispatch ("ADSystemInfo")
computer = sys_info.ComputerName
print computer
</code>
TJG
_______________________________________________
python-win32 mailing list
python-win32@[...].org
http://mail.python.org/mailman/listinfo/python-win32
Thread:
Jose Noto
Tim Golden
|