Link to home
Start Free TrialLog in
Avatar of americaneldercare
americaneldercare

asked on

vbscript ldap query for office

I am familiar with programming, but am not a programmer.  What I am attempting to do is use a VBScript to lookup a user (by samaccount name) and write their office (physicalDeliveryOfficeName) to a text file.

My users are spread across quite a few OU's so I know that I need to write it as a query with filters.  The only portion of my script that I have pretty much "set" is the write to file.  The actual LDAP portion of it I don't really have anything.  I have tried modifying quite a few different scripts but something keeps going wrong - and I can't seem to extract the portion that would make what I need work (I have about 4 different not-working versions, figured rather than posting all of those I would just not post that portion of the code).


Dim Office, myFSO, WriteOffice

'Write information to Text File
office = strphysicalDeliveryOfficeName

Set myFSO = CreateObject("Scripting.FileSystemObject")
Set WriteOffice = myFSO.OpenTextFile("c:\temp data\efax\office.txt", 8, True)
WriteStuff.WriteLine(Stuff)
WriteStuff.Close
SET WriteStuff = NOTHING
SET myFSO = NOTHING
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial