ok. i am trying to create a script that exports the contect of a group to a
textfile..it should search ad when one doesnt know in which ou the group
resides. please see what i have done so fare cause i can use some help..am
stuck :-)
thanks.
On Error Resume Next
dim target
strdnsdomain="test"
' Bind to Active Directory
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set TextFile = FSO.OpenTextFile("C:\Info.txt", 2, True)
target=inputbox("Choose Attribute Name")
if target="" then wscript.quit 'user clicked cancel
Set objGroup = GetObject ("LDAP://cn="& target& strDNSDomain)
objGroup.getInfo
arrMemberOf = objGroup.GetEx("member")
For Each strMember in arrMemberOf
tempvarMember = tempvarMember & strMember & VbCrLf
Next
TextFile.WriteLine "members '" & target & "' are:" & VbCrLf & tempvarMember
wscript.quit