HOWTO: Enumerate servers in a NT4 domain from WSH 
Author Message
 HOWTO: Enumerate servers in a NT4 domain from WSH

Hi all,

i wonder how I can enumerate all servers in a NT4 domain from WSH eg
accessing
the NetServerEnum (?) function?

I Would like to do something like this
set serverlist = GetObject("NetServerEnum", & domainname)
for each server in serverlist
    wscript.echo server.name
next

I can not find this funtion i "WinNT://domainname" the only filter available
is "Computer" or?

regards.rikard



Mon, 20 Sep 2004 22:03:38 GMT  
 HOWTO: Enumerate servers in a NT4 domain from WSH

Set oDomain = GetObject("WinNT://YourDomainName")
oDomain.Filter = Array("computer")

For Each Computer In oDomain
    WScript.Echo Computer.Name
Next

You can also get a list of all trusted domains

Set oDomains = GetObject("WinNT:")
oDomains.Filter = Array("domain")

For Each Domain In oDomains
    WScript.Echo Domain.ADsPath
Next

Regards,
Ian
WSH fAQ http://communities.msn.com/windowsscript

Quote:
> Hi all,

> i wonder how I can enumerate all servers in a NT4 domain from WSH eg
> accessing
> the NetServerEnum (?) function?

> I Would like to do something like this
> set serverlist = GetObject("NetServerEnum", & domainname)
> for each server in serverlist
>     wscript.echo server.name
> next

> I can not find this funtion i "WinNT://domainname" the only filter
available
> is "Computer" or?

> regards.rikard



Tue, 21 Sep 2004 04:18:51 GMT  
 HOWTO: Enumerate servers in a NT4 domain from WSH
Thanks, Ian,

but....this enumerates all computers  I would like to have a list of
_servers_ only.

I tested have tried something called DynamicWrapper to try to call
NetServerEnum but I can't
get the hang of it :-(

Anybody...

Regards,


Quote:

> Set oDomain = GetObject("WinNT://YourDomainName")
> oDomain.Filter = Array("computer")

> For Each Computer In oDomain
>     WScript.Echo Computer.Name
> Next

> You can also get a list of all trusted domains

> Set oDomains = GetObject("WinNT:")
> oDomains.Filter = Array("domain")

> For Each Domain In oDomains
>     WScript.Echo Domain.ADsPath
> Next

> Regards,
> Ian
> WSH fAQ http://communities.msn.com/windowsscript


> > Hi all,

> > i wonder how I can enumerate all servers in a NT4 domain from WSH eg
> > accessing
> > the NetServerEnum (?) function?

> > I Would like to do something like this
> > set serverlist = GetObject("NetServerEnum", & domainname)
> > for each server in serverlist
> >     wscript.echo server.name
> > next

> > I can not find this funtion i "WinNT://domainname" the only filter
> available
> > is "Computer" or?

> > regards.rikard



Fri, 24 Sep 2004 18:30:37 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HOWTO: Enumerate servers in a NT4 domain from WSH

2. NT4-Want to enumerate all domain users and allow Dialin for all account

3. Script to Enumerate server in NT 4 domain.

4. Enumerating Servers in an NT 4 domain

5. Running WSH logon Scripts from NT4 Domain controllers

6. How to enumerate Domain Users using WSH

7. Adding Zones and records to the NT4 Dns Server using WSH

8. nt4 server and wsh

9. Install wsh 5.5 german on a NT4-Server - still problems

10. How to tell the difference between NT4 server and NT4 Workstation

11. enumerating printers in nt4 ?

12. Auto NT4 server logon with Logon to Novell server(4.11)

 

 
Powered by phpBB® Forum Software