Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Machine names of Network 1

Status
Not open for further replies.

jester4281

IS-IT--Management
Sep 12, 2002
160
US
Is there a command like the GETFILE() that will allow a user to browse through the network neighborhood and then select a machine and return the machine name.

I am making a small chat app that I want to get the machine name of the desired reciever.
 

Take a look at faq814-1824, perhaps you can modify it to suit your needs.


Mike Gagnon [μ].[γ].

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Try this

oNet = CREATEOBJECT('Wscript.network')
STORE onet.computername TO mmachine

 
faq184-4449 Enumerate Available Shares and Current Mapping

Should be adaptable for your needs.

Brian
 
Brian and jaa69

How do your suggestion meet this request? "a user to browse through the network neighborhood and then select a machine"



Mike Gagnon [μ].[γ].

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike, why a FAQ on parsing on the Visionael network inventory solutions forum... which FAQ did you mean to point to?

Anyway, the FAQ I posted includes the return of all available machine names regardless of shares.

Brian
 
Brian

Mike, why a FAQ on parsing on the Visionael network inventory solutions forum... which FAQ did you mean to point to?

Sorry, the moved it on me again [blush], it is now faq184-1821.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Brian,

How would I get it to list all the machines. Currently it only shows the machines in my WorkGroup, I have not set up a domain yet. Is there a way to get it to show the machine name, currently it shows share letter and share UNC ? sorry for being such a pain.
 
JESTER4281

Perhaps this might help:

Code:
#Define  ssfNETWORK  17
Local S
S =''
shlApp = Createobject("shell.application")
nethood = shlApp.namespace(ssfNETWORK )
For Each Item In nethood.items
	S = S + Item.Name +Chr(13)
Next
Messagebox( S)

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Jester4281

Or perhaps this is more appropriate (This will list all computers in a given domain) (Note this needs to be run on the server where the domain is located)
Code:
colWorkgroups = GetObject("WinNT:")
colWorkgroups.Filter = "Domain"
For Each objWorkgroup in colWorkgroups 
    strWorkgroup = "Name:     " + objWorkgroup.Name   +CHR(13) +;
    "Class:    " + objWorkgroup.Class   +CHR(13) +;
    "GUID:     " + objWorkgroup.GUID   +CHR(13) +;
    "ADsPath:  " + objWorkgroup.ADsPath +CHR(13) +;
    "Parent:   " + objWorkgroup.Parent  +CHR(13) +;
    "Schema:   " + objWorkgroup.Schema
    MESSAGEBOX( strWorkgroup)
    colComputers = GetObject(objWorkgroup.ADsPath)
    colComputers.Filter = 'Computer'
    For Each objComputer in colComputers
        strComputer = "Name:     " + objComputer.Name    +CHR(13) +;
        "Class:    " + objComputer.Class   +CHR(13) +;
        "GUID:     " + objComputer.GUID    +CHR(13) +;
        "ADsPath:  " + objComputer.ADsPath +CHR(13) +;
        "Parent:   " + objComputer.Parent  +CHR(13) +;
        "Schema:   " + objComputer.Schema
        MESSAGEBOX(strComputer)
    Next
Next

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike, that works, I should be able to modifiy it to work the way I need it to (populate a list box with values). I am getting an OLE IDispatch exception code 0 from active directory: The specified directory property is not supported.
 
jester4281 said:
Mike, that works, I should be able to modifiy it to work the way I need it to (populate a list box with values). I am getting an OLE IDispatch exception code 0 from active directory: The specified directory property is not supported.

Were you running it from a server? and does this server have Windows scripting installed on it?
Windows scripting download page




Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top