Windows 7 can't see all domain computers

Discussion in 'Windows 7 Networking' started by meniem, Jul 21, 2011.

  1. meniem

    meniem New Member

    Joined:
    Jul 21, 2011
    Messages:
    4
    Likes Received:
    0
    Hi guys,
    I have a windows 7 pro that is connected to the domain, but it has a lot of issues, it can discover only about 5 machines from about 50.
    Also no one in the network can access in through LAN although it can join the domain with no problem.
    I tried lot of things like:
    - Rejoin it to the domain.
    - Rename PC name before rejoin it to the domain.
    - Remove all profiles and create new ones.
    - Remove DNS entry and AD computer entry regarding this machine.
    ------------
    I think it is a system problem not a network problem, but i don't wanna reinstall the system as i have a lot of licenses for it and it is hard to reset these licenses again.
    So, What should i do to resolve this issue.
    If anyone has any idea, I'll be grateful.
    Best Regards
     
  2. CraveRummer

    Joined:
    Jul 15, 2011
    Messages:
    43
    Likes Received:
    0
    This might help!! put this into a ".txt" file.

    Const ADS_SCOPE_SUBTREE = 2
    Const OPEN_FILE_FOR_WRITING = 2
    Const ForReading = 1


    Wscript.Echo "The output will be written to C:\Computers.txt"

    strFile = "Computers.txt"
    strWritePath = "C:\" & strFile
    strDirectory = "C:\"

    Set objFSO1 = CreateObject("Scripting.FileSystemObject")

    If objFSO1.FileExists(strWritePath) Then
    Set objFolder = objFSO1.GetFile(strWritePath)

    Else
    Set objFile = objFSO1.CreateTextFile(strDirectory & strFile)
    objFile = ""

    End If


    Set fso = CreateObject("Scripting.FileSystemObject")
    Set textFile = fso_OpenTextFile(strWritePath, OPEN_FILE_FOR_WRITING)

    Set objConnection = CreateObject("ADODB.Connection")
    Set objCommand = CreateObject("ADODB.Command")
    objConnection.Provider = "ADsDSOObject"
    objConnection.Open "Active Directory Provider"

    Set objCOmmand.ActiveConnection = objConnection
    objCommand.CommandText = _
    "Select Name, Location from 'LDAP://DC=contoso,DC=org' " _
    & "Where objectClass='computer'"
    objCommand.Properties("Page Size") = 1000
    objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
    Set objRecordSet = objCommand.Execute
    objRecordSet.MoveFirst

    Do Until objRecordSet.EOF
    'Wscript.Echo "Computer Name: " & objRecordSet.Fields("Name").Value
    textFile.WriteLine(objRecordSet.Fields("Name").Value)
    objRecordSet.MoveNext
    Loop

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objArgs = Wscript.Arguments
    Set objTextFile = objFSO.OpenTextFile(strWritePath, ForReading)

    Do Until objTextFile.AtEndOfStream
    strReg = objTextFile.Readline
    Loop

    WScript.Echo "All done!"





    PLEASE MAKE SURE NO WORD WRAPPING IS HAPPENING IN YOUR SCRIPT!!!

    To make this script work you will need one thing!


    1. You will need the OU in which your computer accounts are kept.
    Edit the string LDAP://
    (e.g., 'LDAP://DC=contoso,DC=com')

    The text file will be written to the root of your c:\ drive

    *Make sure you are an administrator to run this.
     
    #2 CraveRummer, Jul 21, 2011
    Last edited: Jul 21, 2011
  3. meniem

    meniem New Member

    Joined:
    Jul 21, 2011
    Messages:
    4
    Likes Received:
    0
    Thanks man for your reply,
    But should i rename the extension of this scrip into ".bat" or what.
    And then i run it once after that.
    Best Regards
     

Share This Page

Loading...