• Embed Doc
  • Readcast
  • Collections
  • 2
    CommentGo Back
 
OPTION ExplicitOn Error Resume NextConst ADS_PROPERTY_UPDATE = 2DIM username, ou, n, arrStrDIM strFullName, strAddress1, strAddress2DIM strCity, strState, strZIP, strPhone, strEmailDIM strAreaCode, strExchange, strDID, strTelephoneDIM objUser, objFSO, objCSVFile, objConnection, objCommandDim objShell, objFile, objNetworkSet objShell = CreateObject("WScript.Shell")Set objFSO = CreateObject("Scripting.FileSystemObject")'Read CSVSet objCSVFile = objFSO.OpenTextFile("UserInfo.csv",1)Set objConnection = CreateObject("ADODB.Connection")Set objCommand = CreateObject("ADODB.Command")objConnection.Provider = "ADsDSOObject"objConnection.Open "Active Directory Provider"Set objCommand.ActiveConnection = objConnection'set counter valuen = 0Do while NOT objCSVFile.AtEndOfStreamarrStr = split(objCSVFile.ReadLine,",")strFullName = arrstr(n) & " " & arrstr(n+1)strAddress1 = arrstr(n+2)strAddress2 = arrstr(n+3)strCity = arrstr(n+4)strState = arrstr(n+5)strZip = arrstr(n+6)strPhone = arrstr(n+7)'build a traditional phone numberstrAreaCode = mid(strPhone,1,3)strExchange = mid(strPhone,4,3)strDID = mid(strPhone,7,4)strTelephone = "(" & strAreaCode & ") " & strExchange & "-" & _strDIDstrEmail = arrstr(n+8)' Call function to find OU from computer nameou = getOUByUserName(strFullName)if ou = "" thenwscript.echo strFullNameelsei = 0Set objUser = GetObject("LDAP://cn=" & strFullName & "," & _ou & "")do while i < 1If err.number <> 0 then
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...

hi, this sript can be of great use to me but where do you run it?

This vacuums! I dont want to download a .TXT file without and NEWLINES or download a .PDF without INDENTATION. I understand (but do not like, as it serves me no purpose) the necessity of flash embedding, but at least grant us the option of downloading a decently formatted source file.

You must be to leave a comment.
Submit
Characters: ...