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 (physicalDeliveryOfficeNam e) 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 = strphysicalDeliveryOfficeN ame
Set myFSO = CreateObject("Scripting.Fi leSystemOb ject")
Set WriteOffice = myFSO.OpenTextFile("c:\tem p data\efax\office.txt", 8, True)
WriteStuff.WriteLine(Stuff )
WriteStuff.Close
SET WriteStuff = NOTHING
SET myFSO = NOTHING
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 = strphysicalDeliveryOfficeN
Set myFSO = CreateObject("Scripting.Fi
Set WriteOffice = myFSO.OpenTextFile("c:\tem
WriteStuff.WriteLine(Stuff
WriteStuff.Close
SET WriteStuff = NOTHING
SET myFSO = NOTHING
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.