Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export folder content from Access Manager to .txt

Status
Not open for further replies.

navshiv

MIS
Feb 15, 2002
91
0
0
US
Following the posts on how to export lists from Access Manager into a text file. Does anyone know how to export the content of a folder from access manager rather than the root userclass which is what the example on the cognos website does?

I find that the users are repeated if I export from root user class and I just want a list of users which is in a folder called 'Users'(!).

Thanks
Naveen
 
Try this (you can paste this into a text document and give it a name that ends in '.vbs'). It will run under cscript.exe or wscript.exe and creates a file 'Users.txt' on your c: drive with the names of your users. <admin-user> is the signon of an admin user and <password> is the password for that admin user:

-------------------------------------------------------
' SysGrunt, 02/23/2004
set objAuthApp = CreateObject("Authenticator2.Application")
set objAuthDoc = objAuthApp.Documents.OpenWithBasicSignon _("default", "<admin-user>", "<password>")

Set fso = CreateObject("Scripting.FileSystemObject")

Set ts = fso_OpenTextFile("c:\Users.txt", 2, 1)

' gets users for each UserFolder

Set objOne = objAuthDoc.UserFolder
Set objTwo = objOne.Users

For each person in objTwo
ts.WriteLine person
Next

ts.Close

Set fso = Nothing
set objAuthDoc = Nothing
set objAuthApp = Nothing

wscript.echo "Done!"
--------------------------------------------------------

You will have to have AccessAdmAuto.exe on the box you run this from, and the default namespace must be the namespace you wish to query.
 
Thanks for that, looks like it has done the job. Although I get a few Application Errors on DDE Server Window: AccessAdmAuto.exe. The machine it runs on does have this exe installed. The first few times it, not all names came through into the text file but when I tried it with cscript.exe before the .vbs parameter it did seem to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top