Set objRootDSE = GetObject("LDAP://rootDSE") strADsPath = "LDAP://" & objRootDSE.Get("defaultNamingContext") Set objDomain = GetObject(strADsPath) Set objCommand = CreateObject("ADODB.Command") Set objConn = CreateObject("ADODB.Connection") objConn.Open "Provider=ADsDSOObject;" Set objCommand.ActiveConnection = objConn objCommand.CommandText = "SELECT distinguishedName,samAccountName FROM "+"'"+strADsPath+"'"+" WHERE objectClass = 'user'" objCommand.Properties("searchscope") = 2 objCommand.Properties("Page Size") = 1000 Set objRecordSet = objCommand.Execute While Not objRecordSet.EOF ChangeVal(objRecordSet.Fields("distinguishedName")) objRecordSet.MoveNext Wend FindExcluded Sub ChangeVal(strDN) qstring = "LDAP://" & strDN set objUser = GetObject(qstring) objUser.PutEx 2, "protocolSettings",ARRAY("IMAP4§0§1§4§ISO-8859-1§0§1§0§0") objUser.setinfo Set objUser = Nothing End Sub Sub FindExcluded Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("exclude.txt", 1) Do Until objFile.AtEndOfStream strLine = objFile.ReadLine qstring = "LDAP://" & strLine set objUser = GetObject(qstring) objUser.PutEx 2, "protocolSettings",ARRAY("IMAP4§1§1§4§ISO-8859-1§0§1§0§0") objUser.setinfo Loop ObjFile.Close Set objFSO = Nothing Set objFile = Nothing End Sub