Yes. It will also include disabled users, just keep that in mind. It you need to eliminate all disabled users then I can help with that, but some admins delete old users while others make the accounts disabled. Let me know if you would like to filter out the disabled accounts.
Glad I could help.
This will list the users and there profile path out to a csv text file. Don't forget to replace "YourDomainHere" with your domain.
Set fso = CreateObject("Scripting.FileSystemObject")
set txtStream = fso.OpenTextFile("UserProfileList.csv", 2, True)
txtStream.WriteLine "Begin : " & date & " " &...
This information is in AD. It is in the attribute msExchHomeServerName for each user object. This will enumerate the AD tree and return the name and Mailserver for each user.
'****************Setup ADSI connection and populate ADSI Collection************************************************...
Try adOpenStatic instead of adOpenKeyset as such maybe.
mySourceRecordset.Open "Select * from tbltempmkt", mySourceConn, adOpenStatic, adLockOptimistic
Good luck.
Here is a link to a script that does exactly what you are looking for.
http://cwashington.netreach.net/depo/view.asp?Index=1014&ScriptType=vbscript
Hope it helps.
When setting up the task schedular info in the run as box be sure to enter a username with appropriate rights. Also be sure to include the domain name for a domain account (ie.. "your_domain\johndoe") or if it is a local account that this should run under then (ie.. "computer_name\johndoe")
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.