Can't beat a Free script :)

Rich

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Free, Bob
Sent: Wednesday, November 16, 2005 3:19 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] ADSI Scripting - How to find Computer's OU.

Disclaimer- I am not a programmer nor do I play one on TV but this works
for me. I am sure someone can pick it apart and tell me how dumb I am
but hey, it works for me :-p

It will default to local host and domain but prompt for either. Replace
xyz with the default domain of choice.

' simple script to display LDAP path / DN rwf4-12:57 PM 3/11/2004
 
Set Network = WScript.CreateObject("WScript.Network")
 
compname = InputBox ("Enter NETBIOS name of computer - Default is local
machine", "GetComputerLocation In AD", Network.ComputerName )
 
domname  = InputBox ("Enter name of domain- Default is xyz",
"GetDomainName", "XYZ")
 
Set oNet = CreateObject("Wscript.Network") 
Set oTrans = CreateObject("NameTranslate") 
oTrans.Init 1, domname
oTrans.Set 3, domname &"\"& compname &"$"
sAdsPath = oTrans.Get(1) 
Set oNet = Nothing
Set oTrans = Nothing
wscript.echo "Computer Location in AD: " & sAdsPath 



 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jitendra
Kalyankar
Sent: Wednesday, November 16, 2005 12:55 PM
To: ActiveDir@mail.activedir.org
Subject: Re: [ActiveDir] ADSI Scripting - How to find Computer's OU.

This is to check for local computer. What will be the method to check it
against the remote computers. I have a InputBox in the program which
takes input from user, using that string value I want to determine the
OU
of remote computer.

Please let me know if you can shed some light on this.

Thank again,
Jitendra Kalyankar

On 11/16/05, Jitendra Kalyankar <[EMAIL PROTECTED]> wrote:
> Thanks much that is helpful....
>
> Jitendra Kalyankar
> On 11/16/05, Tomasz Onyszko <[EMAIL PROTECTED]> wrote:
> > Jitendra Kalyankar wrote:
> > > I need your guidance to write the script. I need to find out
> > > name of the OU to which the computer account belongs.
> > > Let me know how you can find it.

-------APPLEBEE'S INTERNATIONAL, INC. CONFIDENTIALITY NOTICE------- PRIVILEGED 
/ 
CONFIDENTIAL INFORMATION may be contained in this message or any attachments. 
This information is strictly confidential and may be subject to attorney-client 
privilege. This message is intended only for the use of the named addressee. If 
you are not the intended recipient of this message, unauthorized forwarding, 
printing, copying, distribution, or using such information is strictly 
prohibited and may be unlawful. If you have received this in error, you should 
kindly notify the sender by reply e-mail and immediately destroy this message. 
Unauthorized interception of this e-mail is a violation of federal criminal 
law. 
Applebee's International, Inc. reserves the right to monitor and review the 
content of all messages sent to and from this e-mail address. Messages sent to 
or from this e-mail address may be stored on the Applebee's International, Inc. 
e-mail system.
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to