ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-win32
python-win32
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved