匯出本機或遠端電腦USERS組中的使用者

hexiaomail發表於2008-09-11

strComputer = "."

Set colGroups = GetObject("WinNT://" & strComputer & "/Users")

'Set bjFSO = CreateObject("Scripting.FileSystemObject")
'Set bjTextFile = objFSO.CreateTextFile("D:\Users.txt")

'Wscript.echo "Object Name: " & colGroups.Name
'Wscript.echo "Object Path: " & colGroups.ADsPath
'Wscript.echo "Object Class: " & colGroups.Class
'Wscript.echo "Object Schema: " & colGroups.Schema
'Wscript.echo "Object Parent: " & colGroups.Parent

For Each objUser In colGroups.Members
    'objTextFile.WriteLine objUser.Name
     Wscript.echo objUser.Parent&"\"&objUser.Name
     'Wscript.echo objUser.Name
Next

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9932141/viewspace-445545/,如需轉載,請註明出處,否則將追究法律責任。

相關文章