Thanks Bob! This works for me!

On 11/16/05, Free, Bob <[EMAIL PROTECTED]> wrote:
> 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: [email protected]
> 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.
> > > >
> > >
> http://groups.google.com/group/microsoft.public.scripting.vbscript/brows
> e_thread/thread/fa91247b1a4d65ba/1058b6ce8cad2cfe?lnk=st&q=determine+com
> puter+OU+vbscript&rnum=1&hl=en#1058b6ce8cad2cfe
> > >
> > > --
> > > Tomasz Onyszko
> > > http://www.w2k.pl
> > > 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/
> >
>
>
> --
> Thanks,
> Jitendra Kalyankar
> 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/
>
> 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/
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