On Error Resume Next '================================================================ Set db = Wscript.CreateObject("ADODB.Connection") Set fso = CreateObject("Scripting.FileSystemObject") Set XL = WScript.CreateObject("Excel.Application") set wshNetwork = WScript.CreateObject( "WScript.Network") set WshShell = CreateObject("WScript.Shell") XL.Visible = TRUE XL.WorkBooks.Add domain = inputbox("Enter a object") 'wshNetwork.userdomain adspath = "WinNT://" & domain & "" set adsobj = GetObject(adspath) XL.Range("1:1").Select XL.Selection.Font.Bold = True 'XL.Selection.Interior.ColorIndex = green 'XL.Selection.Font.ColorIndex = 2 XL.Selection.HorizontalAlignment = &hFFFFEFDD ' xlLeft l=0 XL.Cells(1, l+1).Select XL.Cells(1, l+1).Value = "Имя" Xl.Cells(1, l+1).EntireColumn.AutoFit XL.Cells(1, l+2).Select XL.Cells(1, l+2).Value = "Класс" Xl.Cells(1, l+2).EntireColumn.AutoFit XL.Cells(1, l+3).Select XL.Cells(1, l+3).Value = "Полное имя" Xl.Cells(1, l+3).EntireColumn.AutoFit XL.Cells(1, l+4).Select XL.Cells(1, l+4).Value = "Описание" Xl.Cells(1, l+4).EntireColumn.AutoFit XL.Cells(1, l+5).Select XL.Cells(1, l+5).Value = "Скрипт" Xl.Cells(1, l+5).EntireColumn.AutoFit XL.Cells(1, l+6).Select XL.Cells(1, l+6).Value = "LastLogin" Xl.Cells(1, l+6).EntireColumn.AutoFit XL.Cells(1, l+7).Select XL.Cells(1, l+7).Value = "LastLogoff" 'Xl.Cells(1, l+7).EntireColumn.AutoFit XL.Cells(1, l+8).Select XL.Cells(1, l+8).Value = "Expired?" 'Xl.Cells(1, l+8).EntireColumn.AutoFit XL.Cells(1, l+9).Select XL.Cells(1, l+9).Value = "Группы" Xl.Cells(1, l+9).EntireColumn.AutoFit intIndex=2 l=0 for each prop in adsobj if prop.Class="User" then Set usr1 = GetObject("WinNT://" & domain & "/" & Prop.name & ",user") 'grp.members.filter = Array("Гость") For Each grp In usr1.Groups grp1=grp1 & grp.Name & ";" Next End if XL.Cells(intIndex, l+1).Select XL.Cells(intIndex, l+1).Value = Prop.name Xl.Cells(intIndex, l+1).EntireColumn.AutoFit XL.Cells(intIndex, l+2).Select XL.Cells(intIndex, l+2).Value = Prop.Class Xl.Cells(intIndex, l+2).EntireColumn.AutoFit if Prop.Class="User" then XL.Cells(intIndex, l+3).Select XL.Cells(intIndex, l+3).Value = Prop.FullName Xl.Cells(intIndex, l+3).EntireColumn.AutoFit XL.Cells(intIndex, l+4).Select XL.Cells(intIndex, l+4).Value = Prop.Description Xl.Cells(intIndex, l+4).EntireColumn.AutoFit XL.Cells(intIndex, l+5).Select XL.Cells(intIndex, l+5).Value = Prop.LoginScript Xl.Cells(intIndex, l+5).EntireColumn.AutoFit XL.Cells(intIndex, l+6).Select XL.Cells(intIndex, l+6).Value = Prop.LastLogin Xl.Cells(intIndex, l+6).EntireColumn.AutoFit XL.Cells(intIndex, l+7).Select XL.Cells(intIndex, l+7).Value = Prop.LastLogoff Xl.Cells(intIndex, l+7).EntireColumn.AutoFit XL.Cells(intIndex, l+8).Select XL.Cells(intIndex, l+8).Value = Prop.PasswordExpired Xl.Cells(intIndex, l+8).EntireColumn.AutoFit XL.Cells(intIndex, l+9).Select XL.Cells(intIndex, l+9).Value = grp1 Xl.Cells(intIndex, l+9).EntireColumn.AutoFit grp1="" end if intIndex=intIndex+1 'XL.Cells(intIndex, 1).Select next db.Close Set db = Nothing WshShell.sendkeys "^{Home}" ' ­  ­ з «® бва ­Ёжл 'WshShell.sendkeys "^{f}"' Џ®ЁбЄ 'XL.WorkBooks.SaveAs("c:\"&objNet.ComputerName&".xls") XL.WorkBooks.SaveAs("d:\users_" & domain &".xls") XL.Quit