Login | |
|
 |
RE: listing computers - 8/16/2005 11:48:17 AM
|
|
 |
|
| |
spar75
Posts: 8
Score: 0
Joined: 6/20/2005
From:
Status: offline
|
You can also get the listing within active directory. If you want to have the informationput into a file all, you have to do is right click on the organizational unit that holds all the computer accounts (i.e. computers or workstations) and choose export to file.
|
|
| |
|
|
|
 |
RE: listing computers - 8/16/2005 7:11:38 PM
|
|
 |
|
| |
ginolard
Posts: 1082
Score: 21
Joined: 8/10/2005
Status: offline
|
Shameless plug warning!! You could also take a look at my ManagePC HTA in the "Post a Vbscript" forum. It will import all machines from a domain and present you with various WMI data as well letting you perform several remote actions on the machine.
|
|
| |
|
|
|
 |
RE: listing computers - 8/16/2005 11:40:42 PM
|
|
 |
|
| |
mbouchard
Posts: 1924
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
|
You could use WinNT Dim WshShell : Set WshShell = WScript.CreateObject ("WSCript.shell") Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject") Dim F : Set F = Fso.CreateTextFile("c:\ComputersInDomain.txt", TRUE) Set oContainer = GetObject("WinNT://YOURDOMAINNAMEHERE") oContainer.Filter = Array("computer") For Each oComputer1 in oContainer F.WriteLine(oComputer1.name) Next f.close WshShell.Run "notepad.exe c:\ComputersInDomain.txt"
_____________________________
Mike For useful Scripting links see the Read Me First stickey! Always remember Search is your friend.
|
|
| |
|
|
|
 |
RE: listing computers - 5/21/2007 2:25:20 AM
|
|
 |
|
| |
4scriptmoni
Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
|
cool code! To automatic get the domain u can use: Set objExecObject = objShell.Exec("cmd /c echo %USERDOMAIN%") Do While Not objExecObject.StdOut.AtEndOfStream userdomain = objExecObject.StdOut.ReadLine() 'gets %userdomain% trim(userdomain) loop
_____________________________
Enterprise Microsoft Scripts Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc... http://www.felipeferreira.net
|
|
| |
|
|
|
 |
RE: listing computers - 5/21/2007 2:30:00 AM
|
|
 |
|
| |
ebgreen
Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
|
Or two ways to get the domain without shelling out: Option Explicit Dim oWsh:Set oWsh = CreateObject("WScript.Shell") Dim oWSN:Set oWSN = CreateObject("WScript.Network") WScript.Echo oWsh.ExpandEnvironmentStrings("%USERDOMAIN%") WScript.Echo oWSN.UserDomain
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|