Error DataBase-One Place all Solutions Forums Blog Glossary    Contact Us
Search  
   
Browse by Category
Error DataBase-One Place all Solutions .: Operating Systems .: Windows Operating Systems .: Windows Scripts and Batch Files .: How to extract details from Active Directory using Script

How to extract details from Active Directory using Script

' This will create a text file listing members of a group
' It saves a copy of the file with the group name in the %TEMP% Directory
' It then opens the file up in notepad

 

Set WshShell = CreateObject("Wscript.Shell")
Temp = WshShell.ExpandEnvironmentStrings("%TEMP%")

groupname = "Group Details"
groupname = InputBox("Please enter the name of the Group",groupname)

If (groupname = "") Then
  Wscript.Quit
End If

wshShell.Run "CMD /c net group /domain " & chr(34)& groupname &chr(34) & " > " & Chr(34) & Temp & chr(92) & groupname & ".txt" & Chr(34),0,1

wshShell.Run "notepad.exe "& chr(34) & temp & chr(92) & groupname & ".txt"

' end of script


How helpful was this article to you?

Related Articles

article VB Script to Find PC in Active Directory
On Error Resume Next PCName =...

(No rating)  3-24-2008    Views: 133   
article How to Import or Export Active Directory data to a file using CSVDE / LDIFDE commands (Directory Exchange)
Import or Export Active Directory data to a...

(No rating)  3-7-2008    Views: 348   
article How to Use the Directory Service Command-Line Tools to Manage Active Directory Objects in Windows Server 2003
This article describes how to use the Directory...

(No rating)  6-3-2008    Views: 211   

User Comments

Add Comment
No comments have been posted.