Exchange Server | Murat Bilici

"Empower your knowledge"

SecuritygrupExportToTxt

Active Directory Security  grubunun txt export’u için aşagıdak script’i kullanabilirsiniz.

 

Option Explicit Dim strMember, strDNSDomain, strContainer Dim objGroup, objRootDSE Dim Stuff, myFSO, WriteStuff Dim arrMemberOf

‘  Bind to Active Directory’ strContainer = “CN=GroupName,OU=Users,” Set objRootDSE = GetObject(“LDAP://RootDSE”) strDNSDomain = objRootDSE.Get(“DefaultNamingContext”)

‘  Get the Builtin Administrators group Set objGroup = GetObject (“LDAP://”& strContainer & strDNSDomain) objGroup.getInfo

arrMemberOf = objGroup.GetEx(“member”)

‘ Loop = For Each …. Next ‘ WScript.Echo “Members of Group ” & strContainer For Each strMember in arrMemberOf ‘Write information to Text File Set myFSO = CreateObject(“Scripting.FileSystemObject”) Set WriteStuff = myFSO.OpenTextFile(“yourtextfile.txt”, 8, True) WriteStuff.WriteLine(strMember) WriteStuff.Close    Next

Wscript.Quit

‘ End of Sample Group Enum Member Script

Categories: Active Directory - Scripts