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!

pulling OS from AD

Status
Not open for further replies.

cynic006

MIS
Nov 24, 2004
16
US
i am working on a script to pull all of the servers out of my active directory structure. so far the way i have decided to do it is by using an existing script i have that runs through all of the machines in my structure & the filtering based on operating system.

so here is the script i have to dump the machines

domain = Array(*list of domains*)

strOutputFile = "MachineDump.xls"
Set objfso = CreateObject("Scripting.FileSystemObject")
Set tf = objfso.CreateTextFile(strOutputFile, True)

for j = 0 to 15

strDomain = domain(j) & "*rest of domain*"
set objContainer = GetObject("WinNT://" & strDomain)
objContainer.filter = Array("Computer")

for each objMember in objContainer
tf.writeline objMember.Name
' wscript.echo objMember.Name
next

next

wscript.echo("done")


is there a property to pull the operating system? am i going about this incorrectly?

thanks in advance
 
Try
wscript.echo objMember.Name & " - " & objMember.operatingSystem & " - " & objMember.operatingSystemVersion
 
fosterr2000, thanks!

i tried that with less than stellar results. here is what im getting.

if the machine is off the script crashes. i forced it to skip to my machine (which is running windows XP) & it returns windows NT 5.1 as the OS.

any thoughts?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top