Re: [ActiveDir] Getting the Pre Windows 2000 name for a domain

2005-08-22 Thread SysPro Support
Hi Peter,

It could be NetBiosName that I am looking for. I tried it on my domain, but
it had no value. However that could be because my domain was not built pre
Windows 2000. I will try it on the offending domain and see what it returns.

Alan C

- Original Message - 
From: Peter Jessop [EMAIL PROTECTED]
To: ActiveDir@mail.activedir.org
Sent: Sunday, August 21, 2005 7:45 PM
Subject: Re: [ActiveDir] Getting the Pre Windows 2000 name for a domain


If I understand you correctly you are looking for the Pre Windows 2000
name of computers (not the domain).
The property name is sAMAccountName.

i.e in order to find the pre Windows 2000 names of object in the DDD
ou within domain BBB.CCC the script would be.

Set objContainer = GetObject(LDAP://ou=DDD,dc=BBB,dc=CCC)
For Each objcomputer In objContainer
WScript.Echo objComputer.Name  vbTab  objComputer.sAMAccountName
next

The pre Windows 2000 name of the domain has a property called nETBIOSName.
Regards

Peter Jessop
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/


Re: [ActiveDir] Getting the Pre Windows 2000 name for a domain

2005-08-21 Thread Peter Jessop
If I understand you correctly you are looking for the Pre Windows 2000
name of computers (not the domain).
The property name is sAMAccountName.

i.e in order to find the pre Windows 2000 names of object in the DDD
ou within domain BBB.CCC the script would be.

Set objContainer = GetObject(LDAP://ou=DDD,dc=BBB,dc=CCC)
For Each objcomputer In objContainer
WScript.Echo objComputer.Name  vbTab  objComputer.sAMAccountName
next

The pre Windows 2000 name of the domain has a property called nETBIOSName.
Regards 

Peter Jessop
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/


RE: [ActiveDir] Getting the Pre Windows 2000 name for a domain

2005-08-21 Thread Michael B. Smith
Title: RE: [ActiveDir] OT:Exchange 2003 SP1 bloat



As to the first question:

Dim objWSHNetwork

Set 
objWSHNetwork = CreateObject ("WScript.Network")' get the NetBIOS 
domain namestrNetBIOSDomain = 
objWSHNetwork.UserDomainSet objWSHNetwork = Nothing

As to 
the second question, see 

http://www.microsoft.com/technet/scriptcenter/scripts/ad/computer/cptrvb07.mspx

and

http://msdn.microsoft.com/library/default.asp?url="">


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of SysPro 
SupportSent: Sunday, August 21, 2005 1:54 AMTo: 
ActiveDir@mail.activedir.orgSubject: [ActiveDir] Getting the Pre 
Windows 2000 name for a domain

Hi,

I have a requirement to determine themachines 
that are currently online for a particular domain. I use the Net View 
command and give it a domain name such as:

Net View /Domain:DomName

SinceI know the Fully qualified Domain 
name AAA.BBB.CCC then I use:-

Net View /Domain:AAA

and it normally works. However I have one client 
that uses a different Pre Windows 2000 name (don't ask me why). I tried the 
following bit of code to try and programmatically work out the Pre Windows 2000 
name:-

 Dim Sdou As 
IADs Dim PropertyValue As 
Variant Set Sdou = 
GetObject("LDAP://DC=AAA,DC=BBB,DC=CCC") 
For Each PropertyValue In 
Sdou.GetEx("Name") If 
PropertyValue  "" 
Then 
MsgBox PropertyValue End 
If Next
but it just returnedAAA.

So, is there a property in Active Directory that 
returns the Pre Windows 2000 name?

Alternatively, is there anyway to determine the 
machines that are online via AD, rather than via the Net View 
command?

Alan Cuthbertson




Re: [ActiveDir] Getting the Pre Windows 2000 name for a domain

2005-08-21 Thread SysPro Support
Title: RE: [ActiveDir] OT:Exchange 2003 SP1 bloat



Hi Michael,

Thanks for the response, But it isn't quite what I 
want. The code you give gives the NetBios name of the 
logged on user. I am trying to find the NetBios name 
for another domain.

I have tried enumerating all machines on the domain 
and then pinging them, but it takes too long. We have 20,000 machines, of which 
10,000 are offline. Each ping to an offline machine takes 1 sec to time out, so 
it takes over 3 hours! I was looking a for a quicker way

Alan C

  - Original Message - 
  From: 
  Michael B. 
  Smith 
  To: [EMAIL PROTECTED] 
  
  Sent: Sunday, August 21, 2005 8:47 
  PM
  Subject: RE: [ActiveDir] Getting the Pre 
  Windows 2000 name for a domain
  
  As to the first question:
  
  Dim objWSHNetwork
  
  Set 
  objWSHNetwork = CreateObject ("WScript.Network")' get the 
  NetBIOS domain namestrNetBIOSDomain = 
  objWSHNetwork.UserDomainSet objWSHNetwork = 
Nothing
  
  As 
  to the second question, see 
  
  http://www.microsoft.com/technet/scriptcenter/scripts/ad/computer/cptrvb07.mspx
  
  and
  
  http://msdn.microsoft.com/library/default.asp?url="">
  
  
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of SysPro 
  SupportSent: Sunday, August 21, 2005 1:54 AMTo: 
  [EMAIL PROTECTED]Subject: [ActiveDir] Getting the Pre 
  Windows 2000 name for a domain
  
  Hi,
  
  I have a requirement to determine 
  themachines that are currently online for a particular domain. I use the 
  Net View command and give it a domain name such as:
  
  Net View /Domain:DomName
  
  SinceI know the Fully qualified 
  Domain name AAA.BBB.CCC then I use:-
  
  Net View /Domain:AAA
  
  and it normally works. However I have one client 
  that uses a different Pre Windows 2000 name (don't ask me why). I tried the 
  following bit of code to try and programmatically work out the Pre Windows 
  2000 name:-
  
   Dim Sdou As 
  IADs Dim PropertyValue As 
  Variant Set Sdou = 
  GetObject("LDAP://DC=AAA,DC=BBB,DC=CCC") 
  For Each PropertyValue In 
  Sdou.GetEx("Name") If 
  PropertyValue  "" 
  Then 
  MsgBox PropertyValue End 
  If Next
  but it just returnedAAA.
  
  So, is there a property in Active Directory that 
  returns the Pre Windows 2000 name?
  
  Alternatively, is there anyway to determine the 
  machines that are online via AD, rather than via the Net View 
  command?
  
  Alan Cuthbertson
  
  


RE: [ActiveDir] Getting the Pre Windows 2000 name for a domain

2005-08-21 Thread joe
Title: RE: [ActiveDir] OT:Exchange 2003 SP1 bloat



You can get all of the pre-2K names of all domains in a 
forest by looking at the nETBIOSName attribute of the crossref objects in the 
partitions container of the configuration container. You want anything with 
systemflags2.

You do not want to pick off the name attribute of the 
domaindns object because if you have a disjoint namespace going on (DNS name 
does not match NetBIOS name) then you will not get it right.

As for Net View, I believe that uses NetServerEnum which 
enumerates the machines with server service registered, I think, with the 
browser service. The browser service being a poor mechanism for finding really 
anything in a larger environment with multiple subnets especially if you have 
any multihomed machines or filtering rules. Also anyone that shuts down server 
on their machine (or it otherwise failed to start) wouldn't show up. 





From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of SysPro 
SupportSent: Sunday, August 21, 2005 1:54 AMTo: 
[EMAIL PROTECTED]Subject: [ActiveDir] Getting the Pre 
Windows 2000 name for a domain

Hi,

I have a requirement to determine themachines 
that are currently online for a particular domain. I use the Net View 
command and give it a domain name such as:

Net View /Domain:DomName

SinceI know the Fully qualified Domain 
name AAA.BBB.CCC then I use:-

Net View /Domain:AAA

and it normally works. However I have one client 
that uses a different Pre Windows 2000 name (don't ask me why). I tried the 
following bit of code to try and programmatically work out the Pre Windows 2000 
name:-

 Dim Sdou As 
IADs Dim PropertyValue As 
Variant Set Sdou = 
GetObject("LDAP://DC=AAA,DC=BBB,DC=CCC") 
For Each PropertyValue In 
Sdou.GetEx("Name") If 
PropertyValue  "" 
Then 
MsgBox PropertyValue End 
If Next
but it just returnedAAA.

So, is there a property in Active Directory that 
returns the Pre Windows 2000 name?

Alternatively, is there anyway to determine the 
machines that are online via AD, rather than via the Net View 
command?

Alan Cuthbertson




RE: [ActiveDir] Getting the Pre Windows 2000 name for a domain

2005-08-21 Thread joe
Title: RE: [ActiveDir] OT:Exchange 2003 SP1 bloat



You could use some interesting threading ideas. Say pass 
off machines to be enumerated to one control thread, it spawns up threads (up to 
x threads which is configurable) to ping, the control thread watches how long 
each thread runs for, if it exceeds yy ms then you terminate the thread or let 
it time itself out but in the meanwhile you know the machine isn't out there, 
the ones that return quick would be positives. You will need very little stack 
for these threads that you fire up (very little any resources) so tune that down 
and you could tune the number of threads up. If ~Eric catches this thread he may 
beat on my idea or add to it. Of course that assumes written code and not 
scripts. 

I am not sure there is any good answer for a script here. 
To positively get good info, a script would be too underpowered unless it is say 
a perl script which would allow some of the good programmatic things you could 
do.




From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of SysPro 
SupportSent: Sunday, August 21, 2005 8:36 AMTo: 
[EMAIL PROTECTED]Subject: Re: [ActiveDir] Getting the Pre 
Windows 2000 name for a domain

Hi Michael,

Thanks for the response, But it isn't quite what I 
want. The code you give gives the NetBios name of the 
logged on user. I am trying to find the NetBios name 
for another domain.

I have tried enumerating all machines on the domain 
and then pinging them, but it takes too long. We have 20,000 machines, of which 
10,000 are offline. Each ping to an offline machine takes 1 sec to time out, so 
it takes over 3 hours! I was looking a for a quicker way

Alan C

  - Original Message - 
  From: 
  Michael B. 
  Smith 
  To: [EMAIL PROTECTED] 
  
  Sent: Sunday, August 21, 2005 8:47 
  PM
  Subject: RE: [ActiveDir] Getting the Pre 
  Windows 2000 name for a domain
  
  As to the first question:
  
  Dim objWSHNetwork
  
  Set 
  objWSHNetwork = CreateObject ("WScript.Network")' get the 
  NetBIOS domain namestrNetBIOSDomain = 
  objWSHNetwork.UserDomainSet objWSHNetwork = 
Nothing
  
  As 
  to the second question, see 
  
  http://www.microsoft.com/technet/scriptcenter/scripts/ad/computer/cptrvb07.mspx
  
  and
  
  http://msdn.microsoft.com/library/default.asp?url="">
  
  
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of SysPro 
  SupportSent: Sunday, August 21, 2005 1:54 AMTo: 
  [EMAIL PROTECTED]Subject: [ActiveDir] Getting the Pre 
  Windows 2000 name for a domain
  
  Hi,
  
  I have a requirement to determine 
  themachines that are currently online for a particular domain. I use the 
  Net View command and give it a domain name such as:
  
  Net View /Domain:DomName
  
  SinceI know the Fully qualified 
  Domain name AAA.BBB.CCC then I use:-
  
  Net View /Domain:AAA
  
  and it normally works. However I have one client 
  that uses a different Pre Windows 2000 name (don't ask me why). I tried the 
  following bit of code to try and programmatically work out the Pre Windows 
  2000 name:-
  
   Dim Sdou As 
  IADs Dim PropertyValue As 
  Variant Set Sdou = 
  GetObject("LDAP://DC=AAA,DC=BBB,DC=CCC") 
  For Each PropertyValue In 
  Sdou.GetEx("Name") If 
  PropertyValue  "" 
  Then 
  MsgBox PropertyValue End 
  If Next
  but it just returnedAAA.
  
  So, is there a property in Active Directory that 
  returns the Pre Windows 2000 name?
  
  Alternatively, is there anyway to determine the 
  machines that are online via AD, rather than via the Net View 
  command?
  
  Alan Cuthbertson