Question Hello,
I have this script:
This code prints the last logon timestamp for a user.
' ------ SCRIPT CONFIGURATION ------
strUserDN = "<UserDN>" ' e.g. cn=rallen,ou=Sales,dc=rallencorp,dc=com
' ------ END CONFIGURATION ---------
This script works perfectly for one user. I am asking for your help to modify this script to work for a list of users which i have in a txt(every user is on a new line in the txt) and to make an export of the result in a tab delimited file.
Can you help me?
Many thanks in advance.
Answer Raducu,
create a text file and save as "userlist.txt" at "c:\" and past your all userdn. Make sure there will be no header row in text file.
Try below code and let me know if any issue there.
Subbu.
dim userDN
' Get a free file number
nFileNum = FreeFile
' Open a text file for input
Open "C:\userlist.txt" For Input As nFileNum
' Read the contents of the file
Do While Not EOF(nFileNum)
Line Input #nFileNum, userDN
'MsgBox snextline
------ SCRIPT CONFIGURATION ------
strUserDN = userDN ' e.g. cn=rallen,ou=Sales,dc=rallencorp,dc=com
' ------ END CONFIGURATION ---------