net group DC
If I run from my command prompt from my windows XP machine, joined to our main domain
net group "domain computers" /domain >file.txt
It returns over 3000 entries.
Yet, when i go to map a new network drive, (tools > map network drive> browse > right click on my domain and click explore
It only returns over 1200 entries?
Why?
I also noticed in the output of the net group command PC names often have a $ sign at the end. I know for shares if you add a $ it hides it from casual browsing in explorer? Could it be hiding the computers from the explorer view due tot he dollar sign.
But that doesnt make sense, as the net group outlook has named every deviec with a dollar sign, yet I can still see some in explorer. Very confused.
Could the devices OS have anything to do with why i cant see it in explorer?
July 19th, 2011 9:42am
Hello,
netowork browsing requires that NetBios over TCP-IP is enabled and depending on your subnets also a WINS server is used. Additional with the start from Windows Vista / Windows server 2008 the computer browser service is disabled.Best regards Meinolf Weber Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
July 19th, 2011 11:21am
I would expect all computer objects to have a name that ends with the "$" character. The net group utility returns the sAMAccountName of the members, since this uniquely identifies the objects in AD. The sAMAccountName of a computer should be the NetBIOS
name of the machine with a trailing "$" appended. Is it possible that some of the members of your "Domain Computers" group are not computers (perhaps they were added manually)? I believe the "$" character is appended so you can have other objects in AD
with the same name as the NetBIOS name of a computer.
Richard Mueller - MVP Directory Services
July 19th, 2011 11:58am
Is it possible that some of the members of your "Domain Computers" group are not computers (perhaps they were added manually)? I believe the "$" character is appended so you can have other objects in AD with the same name as the NetBIOS name of a computer.
Hi Rich, erm no, a sample I checked were indeed windows servers, I could ping them.
The question next is... what is the most accurate way to view all computers/servers in a domain if NET VIEW is not accurate?
Free Windows Admin Tool Kit Click here and download it now
July 19th, 2011 12:55pm
On a Domain Controller you could use dsquery computer and dsget computer to find all computer objects. You could also use dsquery * -filter to only retrieve computers that are not DC's. On an XP client you can run a VBScript program that uses ADO to query
AD. For example:
Option Explicit
Dim adoCommand, adoConnection, strBase, strFilter, strAttributes
Dim objRootDSE, strDNSDomain, strQuery, adoRecordset, strName, strDN
Dim intCount
' Setup ADO objects.
Set adoCommand = CreateObject("ADODB.Command")
Set adoConnection = CreateObject("ADODB.Connection")
adoConnection.Provider = "ADsDSOObject"
adoConnection.Open "Active Directory Provider"
Set adoCommand.ActiveConnection = adoConnection
' Search entire Active Directory domain.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
strBase = "<LDAP://" & strDNSDomain & ">"
' Filter on user computer objects.
strFilter = "(objectCategory=computer)"
' Filter on all Domain Controller.
strFilter = "(&(objectCategory=computer)(userAccountControl:1.2.840.113556.1.4.804:=8192))"
' Filter on all computers not DC's.
strFilter = "(&(objectCategory=computer)(!userAccountControl:1.2.840.113556.1.4.804:=8192))"
' Comma delimited list of attribute values to retrieve.
strAttributes = "sAMAccountName,distinguishedName"
' Construct the LDAP syntax query.
strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
adoCommand.CommandText = strQuery
adoCommand.Properties("Page Size") = 200
adoCommand.Properties("Timeout") = 30
adoCommand.Properties("Cache Results") = False
' Run the query.
Set adoRecordset = adoCommand.Execute
' Enumerate the resulting recordset.
intCount = 0
Do Until adoRecordset.EOF
' Retrieve values and display.
strName = adoRecordset.Fields("sAMAccountName").Value
strDN = adoRecordset.Fields("distinguishedName").Value
intCount = intCount + 1
' Move to the next record in the recordset.
adoRecordset.MoveNext
Loop
Wscript.Echo "Total found: " & CStr(intCount)
' Clean up.
adoRecordset.Close
adoConnection.Close
-----
In this example I output sAMAccountName, but you could also output the distinguishedName (the variable strDN). Run at a command prompt using cscript so you can redirect output to a text file.
Richard Mueller - MVP Directory Services
July 19th, 2011 4:49pm