Re: Enumerate computer names through LDAP
From: new2wmi (wmiposts_at_hotmail.com)
Date: 12/01/04
- Next message: Christoph Duesmann: "Re: WMI Connect"
- Previous message: Peter Falz: "Re: WMI Permissions Update"
- In reply to: Torgeir Bakken \(MVP\): "Re: Enumerate computer names through LDAP"
- Next in thread: Torgeir Bakken \(MVP\): "Re: Enumerate computer names through LDAP"
- Reply: Torgeir Bakken \(MVP\): "Re: Enumerate computer names through LDAP"
- Reply: Peter Falz: "Re: Enumerate computer names through LDAP"
- Messages sorted by: [ date ] [ thread ]
Date: 30 Nov 2004 19:49:36 -0800
Could you explain how this ("Wscript.Echo Mid(ObjItem.Name, 4)") works
differently? Or better yet, point me to where I can figure this out
for myself? I'm using wbemtest and scriptomatic primarily right now,
but beyond playing around with the already available scripts, I'm not
sure where to go.
Thanks.
"Torgeir Bakken \(MVP\)" <Torgeir.Bakken-spam@hydro.com> wrote in message news:<u7SJqDy1EHA.1264@TK2MSFTNGP12.phx.gbl>...
> new2wmi wrote:
>
> > I'm trying to get a list of all computers in a given OU. Using the
> > script below, I'm able to almost do this. The problem is that my
> > output looks like: "CN=Computer1", when I need it to look like
> > "Computer1". Am I echoing the wrong item? Should it be something
> > besides .Name? Or do I need to do modify the formatting of the
> > output?
>
> I suggest you use this:
>
> Wscript.Echo Mid(ObjItem.Name, 4)
>
>
> >
> > script:
> > Set colItems = GetObject ("LDAP://ou=SUS,ou=Computers,ou=NA,dc=ad,
> > dc=local")
> > colItems.Filter = Array("Computer")
> > For each objItem in colItems
> > Wscript.Echo ObjItem.Name
> > Next
> >
> > Output:
> > CN=Computer1
> > CN=Computer2
- Next message: Christoph Duesmann: "Re: WMI Connect"
- Previous message: Peter Falz: "Re: WMI Permissions Update"
- In reply to: Torgeir Bakken \(MVP\): "Re: Enumerate computer names through LDAP"
- Next in thread: Torgeir Bakken \(MVP\): "Re: Enumerate computer names through LDAP"
- Reply: Torgeir Bakken \(MVP\): "Re: Enumerate computer names through LDAP"
- Reply: Peter Falz: "Re: Enumerate computer names through LDAP"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|