Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

newbie: How do I determine a computer's OU?

36 views
Skip to first unread message

Sheepdog

unread,
Oct 29, 2003, 2:30:20 PM10/29/03
to
I am wanting to create a StartUp script that among other things deterimines
a computers OU.

What is the best way to do this?

All the script examples that I can find seem to presume that you know the OU
in advance.


Torgeir Bakken (MVP)

unread,
Oct 29, 2003, 2:47:43 PM10/29/03
to
Sheepdog wrote:

Hi

Parse the output of sADssComputer below to get the OU:


Set oADsSysInfo = CreateObject("ADSystemInfo")

' Get distinguished name of the local computer
' It will include the OU.
sADssComputer = oADsSysInfo.ComputerName

Wscript.Echo sADssComputer

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter


Max L. Vaughn [MSFT]

unread,
Nov 18, 2003, 9:35:35 AM11/18/03
to
Thanks!

Works very nicely!

Sincerely,
Max Vaughn [MS]
Microsoft Developer Support


Disclaimer: This posting is provided "AS IS" with no warranties, and
confers no rights. You assume all risk for your use.

0 new messages