<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript: Формирование списка пользователей из ADirectory в Excel]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=2915&amp;type=atom" />
	<updated>2010-04-28T08:54:29Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=2915</id>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: Формирование списка пользователей из ADirectory в Excel]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=35141#p35141" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>boodoo пишет:</cite><blockquote><p>... Задача - в новую АД перенести пользователей из старой, выгрузив их в текстовый файл.</p></blockquote></div><p>Может быть проще воспользоваться встроенной командой &quot;csvde&quot;?<br />Выгрузить: csvde -f c:\ad.csv<br />Загрузить:&nbsp; csvde -i -f c:\ad.csv</p>]]></content>
			<author>
				<name><![CDATA[TCTF_AiS]]></name>
			</author>
			<updated>2010-04-28T08:54:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=35141#p35141</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: Формирование списка пользователей из ADirectory в Excel]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=35001#p35001" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>boodoo пишет:</cite><blockquote><p>... но objUser.Put &quot;name&quot; , arrUserFields(1) &quot;Сервер не склонен обрабатывать...</p></blockquote></div><p>Какое именно свойство &quot;учётки&quot; Вы пытаетесь таким оператором настроить?</p><p>Запустите приведённый ниже сценарий из-под какой-либо готовой &quot;учётки&quot;:<br /></p><div class="codebox"><pre><code>Dim objSysInfo, objUser, strDN
Set objSysInfo = CreateObject(&quot;ADSystemInfo&quot;)
strDN = objSysInfo.UserName
Set objSysInfo = Nothing
Set objUser = GetObject(&quot;LDAP://&quot; &amp; strDN)
WScript.Echo objUser.name &amp; vbNewLine &amp; objUser.cn &amp; vbNewLine &amp; objUser.displayName &amp; vbNewLine &amp;_
            objUser.sAMAccountName &amp; vbNewLine &amp; objUser.userPrincipalName
Set objUser = Nothing
WScript.Quit 0</code></pre></div><p>Думаю, что сразу станет понятной причина ошибки.</p>]]></content>
			<author>
				<name><![CDATA[Dmitrii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=13351</uri>
			</author>
			<updated>2010-04-22T13:15:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=35001#p35001</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: Формирование списка пользователей из ADirectory в Excel]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=34998#p34998" />
			<content type="html"><![CDATA[<p><strong>Dmitrii</strong>, спасибо!&nbsp; Подскажите еще, пожалуйста, как можно модифицировать существующие свойства объекта? Задача - в новую АД перенести пользователей из старой, выгрузив их в текстовый файл. Код, приведенный ниже работает,&nbsp; <br /></p><div class="codebox"><pre><code>&#039; Создаем пользователей d Active directory из 
&#039; текстового файла ADCreateUser.txt. Структура файла:
&#039; - каждая строка из двух полей (cn, sAMAccountName),
&#039; разделенных &quot;;&quot;
&#039; - строка закрыта vbCrLf

Option Explicit
Dim objRoot, objAD, objUser, objFSO, objFile, objUserModify
Dim arrFileLines(), arrUserFields, strArr
Dim strDomain, strUser,strContainer, strPassword, strUserList, strUserName
Dim timeStart, timeStop, timeConn, i, j, k

Const ADS_PROPERTY_UPDATE = 2

timeStart = Time()

&#039;Определяем пространство имен
Set objRoot = GetObject(&quot;LDAP://RootDSE&quot;)
strDomain = objRoot.Get(&quot;DefaultNamingContext&quot;)

&#039;Инициализируем переменные
strContainer = &quot;cn=users,&quot; &amp; strDomain
strPassword = &quot;QAZwsx123&quot;
strUserList = &quot;ADdUsers.txt&quot;
i = 0
j = 0
k = 1

&#039;Открываем файл со списком пользователей
Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set objFile = objFSO.OpenTextFile(strUserList, 1)

&#039;Считываем содержимое файла в массив
Do Until objFile.AtEndOfStream
     Redim Preserve arrFileLines(i)
     arrFileLines(i) = objFile.ReadLine
     i = i + 1
Loop

&#039;Закрываем файл
objFile.Close

&#039;Выбираем пользователя из массива и добавляем его в контейнер Users
For j = Ubound(arrFileLines) to LBound(arrFileLines) Step -1
    &#039;Подключаемся к контейнеру Users для добавления пользователя
    Set objAD = GetObject(&quot;LDAP://&quot; &amp; strContainer)
    arrUserFields = Split(arrFileLines(j), &quot;;&quot;)
    Set objUser = objAD.Create(&quot;User&quot;, &quot;cn=&quot; &amp; arrUserFields(0))
    objUser.Put &quot;sAMAccountName&quot;, arrUserFields(0)
    objUser.Put &quot;userPrincipalName&quot;, arrUserFields(0) &amp; &lt;domain&gt;
    objUser.Put &quot;displayName&quot;, arrUserFields(1)
    objUser.SetInfo

    &#039;objUser.Put &quot;name&quot; , arrUserFields(1)
              &#039;objUser.PutEx ADS_PROPERTY_UPDATE, &quot;name&quot; , arrUserFields(1)
    objUser.AccountDisabled = False
    objUser.SetPassword strPassword &#039;задать пароль
    objUser.SetInfo
    k = k + 1
    
Next

timeStop = Time()
msgbox &quot;Added accouns: &quot; &amp; k &amp; vbCrLf &amp; timeStop &amp; vbCrLf &amp; timeStart

&#039;Ликвидируем оъекты
Set objRoot = Nothing
Set objAD = Nothing
Set objUser = Nothing
Set objUserModify = Nothing
Set objFSO = Nothing
Set objFile = Nothing</code></pre></div><p>но objUser.Put &quot;name&quot; , arrUserFields(1) &quot;Сервер не склонен обрабатывать...&quot;,<br />а objUser.PutEx ADS_PROPERTY_UPDATE, &quot;name&quot; , arrUserFields(1) вообще дает неопознанную ошибку!</p>]]></content>
			<author>
				<name><![CDATA[boodoo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25843</uri>
			</author>
			<updated>2010-04-22T10:36:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=34998#p34998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: Формирование списка пользователей из ADirectory в Excel]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=34940#p34940" />
			<content type="html"><![CDATA[<p><strong>Dmitrii</strong>, спасибо. И я, наконец <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" />, сподобился прочитать:<br /><a href="http://msdn.microsoft.com/en-us/library/ms677945(v=VS.85).aspx">Serverless Binding and RootDSE (Windows)</a><br /><a href="http://msdn.microsoft.com/en-us/library/ms684291(VS.85).aspx">RootDSE (Windows)</a></p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2010-04-20T06:01:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=34940#p34940</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: Формирование списка пользователей из ADirectory в Excel]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=34939#p34939" />
			<content type="html"><![CDATA[<p><strong>boodoo</strong>, рекомендую имя домена не задавать вручную, а определять программно. Пример:<br /></p><div class="codebox"><pre><code>Set objRoot = GetObject(&quot;LDAP://RootDSE&quot;)
strDNSDomain = objRoot.Get(&quot;DefaultNamingContext&quot;)
WScript.Echo strDNSDomain</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Dmitrii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=13351</uri>
			</author>
			<updated>2010-04-20T05:37:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=34939#p34939</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: Формирование списка пользователей из ADirectory в Excel]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=34938#p34938" />
			<content type="html"><![CDATA[<p>Более корректно, ИМХО, использовать вместо &quot;DisplayName&quot; поле &quot;cn&quot; или выводить их вместе. Кроме этого, мне для переноса юзеров в новый домен интересно еще и поле &quot;UserAccountControl&quot; для исключения мертвых душ. Для нормальных юзеров его значение равно 512, для отключенных - 514 и так далее</p><div class="codebox"><pre><code>&#039;Создаем список пользователей из Active directory в 
&#039;таблицу формата Excel
Option Explicit

Dim objRootDSE, strDNSDomain, strBase
Dim adoCommand, adoConnection, objRS, strFilter, strAttributes, strQuery
Dim objExcel, strName, strPhone, strMail, strOtherphone, arrOtherPhone, strItem
Dim strsAMAccountName,strTitle,strDepartment,strMobile,strHomePhone,strEnUser

On Error Resume Next
strDNSDomain = &quot;dc=&lt;domain&gt;, dc=ru&quot;

Set adoCommand = CreateObject(&quot;ADODB.Command&quot;)
Set adoConnection = CreateObject(&quot;ADODB.Connection&quot;)
adoConnection.Provider = &quot;ADsDSOObject&quot;
adoConnection.Open &quot;Active Directory Provider&quot;
adoCommand.ActiveConnection = adoConnection

&#039;Работаем с Excel
Set objExcel = WScript.CreateObject(&quot;Excel.Application&quot;)
objExcel.Visible = False
objExcel.Workbooks.Add

objExcel.ActiveSheet.Name = &quot;Users &quot; &amp; Left(strDNSDomain,19) &amp; &quot;...&quot;
objExcel.ActiveSheet.Range(&quot;A1&quot;).Activate

objExcel.ActiveCell.Value = &quot;ФИО пользователя&quot;    
objExcel.ActiveCell.Offset(0,1).Value = &quot;Должность&quot;    
objExcel.ActiveCell.Offset(0,2).Value = &quot;Отдел&quot;    
objExcel.ActiveCell.Offset(0,3).Value = &quot;Городской телефон&quot;
objExcel.ActiveCell.Offset(0,4).Value = &quot;Внутренний телефон&quot;
objExcel.ActiveCell.Offset(0,5).Value = &quot;Мобильный телефон&quot;
objExcel.ActiveCell.Offset(0,6).Value = &quot;Домашний телефон&quot;
objExcel.ActiveCell.Offset(0,7).Value = &quot;Учётная запись&quot;
objExcel.ActiveCell.Offset(0,8).Value = &quot;Электронная почта&quot;
objExcel.ActiveCell.Offset(0,9).Value = &quot;Enable&quot;
objExcel.ActiveCell.Offset(1,0).Activate                &#039;переход на следующую строку.


strBase = &quot;&lt;LDAP://&quot; &amp; strDNSDomain &amp; &quot;&gt;&quot;
strFilter = &quot;(&amp;(objectCategory=person)(objectClass=user))&quot;
&#039;strAttributes = &quot;name,mail,telephoneNumber,otherTelephone&quot;
strAttributes = &quot;cn,sAMAccountName,title,department,mail,telephoneNumber,otherTelephone,mobile,homePhone,UserAccountControl&quot;


&#039; Формируем строку запроса.
strQuery = strBase &amp; &quot;;&quot; &amp; strFilter &amp; &quot;;&quot; &amp; strAttributes &amp; &quot;;subtree&quot;

&#039; Выполним запрос.
adoCommand.CommandText = strQuery
adoCommand.Properties(&quot;Page Size&quot;) = 100
adoCommand.Properties(&quot;Timeout&quot;) = 307
adoCommand.Properties(&quot;Cache Results&quot;) = False
Set objRS = adoCommand.Execute


While not objRS.EOF

    strName = objRS.Fields(&quot;cn&quot;).Value
    strMail = objRS.Fields(&quot;mail&quot;).value
    strPhone = objRS.Fields(&quot;telephoneNumber&quot;).Value
    strsAMAccountName = objRS.Fields(&quot;sAMAccountName&quot;).Value
    strTitle = objRS.Fields(&quot;title&quot;).Value
    strDepartment = objRS.Fields(&quot;department&quot;).Value
    strMobile = objRS.Fields(&quot;mobile&quot;).Value
    strHomePhone = objRS.Fields(&quot;homePhone&quot;).Value
    arrOtherPhone = objRS.Fields(&quot;otherTelephone&quot;).Value
    strEnUser = objRS.Fields(&quot;UserAccountControl&quot;).Value
    If IsNull(arrOtherPhone) Then
        strOtherPhone = &quot;&quot;
    Else
        strOtherPhone = &quot;&quot;
        For Each strItem In arrOtherPhone
            If (strOtherPhone = &quot;&quot;) Then
                strOtherPhone = strItem
            Else
                strOtherPhone = strOtherPhone &amp; &quot;, &quot; &amp; strItem
            End If
        Next
    End If
    
    &#039;Заполним поля
    objExcel.ActiveCell.Value = strName
    objExcel.ActiveCell.Offset(0,1).Value = strTitle
    objExcel.ActiveCell.Offset(0,2).Value = strDepartment
    objExcel.ActiveCell.Offset(0,3).Value = strPhone
    objExcel.ActiveCell.Offset(0,4).Value = strOtherPhone
    objExcel.ActiveCell.Offset(0,5).Value = strMobile
    objExcel.ActiveCell.Offset(0,6).Value = strHomePhone
    objExcel.ActiveCell.Offset(0,7).Value = strsAMAccountName
    objExcel.ActiveCell.Offset(0,8).Value = strMail
    objExcel.ActiveCell.Offset(0,9).Value = strEnUser
    objExcel.ActiveCell.AutoFormat
    objExcel.ActiveCell.Offset(1,0).Activate
    
    objRS.MoveNext
Wend

&#039; Чистим память.
Set objRS = Nothing
Set adoCommand = Nothing
Set adoConnection = Nothing
objExcel.Visible = True
msgbox(&quot;Скрипт работу закончил!!!&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[boodoo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25843</uri>
			</author>
			<updated>2010-04-20T03:29:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=34938#p34938</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: Формирование списка пользователей из ADirectory в Excel]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=20617#p20617" />
			<content type="html"><![CDATA[<p>Вопрос снимаю, почитав документацию нашел свою ошибку.</p><p>Рабочий вариант, прошу проверить и сказать есть какие-либо ошибки ?<br />Если кто подскажет что еще добавить, буду признателен.</p><div class="codebox"><pre><code>&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;
&#039;Создаем список активных пользователей из Active directory в 
&#039;таблицу формата Excel
&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;
Option Explicit

Dim objRootDSE, strDNSDomain, strBase
Dim adoCommand, adoConnection, objRS, strFilter, strAttributes, strQuery
Dim objExcel, strName, strPhone, strMail, strOtherphone, arrOtherPhone, strItem

Set objRootDSE = GetObject(&quot;LDAP://RootDSE&quot;)
strDNSDomain = objRootDSE.Get(&quot;defaultNamingContext&quot;)

Set adoCommand = CreateObject(&quot;ADODB.Command&quot;)
Set adoConnection = CreateObject(&quot;ADODB.Connection&quot;)
adoConnection.Provider = &quot;ADsDSOObject&quot;
adoConnection.Open &quot;Active Directory Provider&quot;
adoCommand.ActiveConnection = adoConnection

&#039;Работаем с Excel
Set objExcel = WScript.CreateObject(&quot;Excel.Application&quot;)
objExcel.Visible = True
objExcel.Workbooks.Add

objExcel.ActiveSheet.Name = &quot;Users &quot; &amp; Left(strDNSDomain,19) &amp; &quot;...&quot;
objExcel.ActiveSheet.Range(&quot;A1&quot;).Activate

objExcel.ActiveCell.Value = &quot;Имя пользователя&quot;    
objExcel.ActiveCell.Offset(0,1).Value = &quot;Электронная почта &quot;    
objExcel.ActiveCell.Offset(0,2).Value = &quot;Телефон &quot;    
objExcel.ActiveCell.Offset(0,3).Value = &quot;Моб. Номер &quot;    
objExcel.ActiveCell.Offset(1,0).Activate                &#039;переход на следующую строку.


strBase = &quot;&lt;LDAP://&quot; &amp; strDNSDomain &amp; &quot;&gt;&quot;

&#039; Найти все активные учетные записи.
&#039; По кодам UseraccountControl Смотреть. http://support.microsoft.com/kb/305144
strFilter = &quot;(&amp;(objectCategory=person)(objectClass=user)(|(useraccountControl=66048)(useraccountcontrol=512)))&quot;
strAttributes = &quot;name,mail,telephoneNumber,otherTelephone&quot;


&#039; Формеруем строку запроса.
strQuery = strBase &amp; &quot;;&quot; &amp; strFilter &amp; &quot;;&quot; &amp; strAttributes &amp; &quot;;subtree&quot;

&#039; Выполним запрос.
adoCommand.CommandText = strQuery
adoCommand.Properties(&quot;Page Size&quot;) = 100
adoCommand.Properties(&quot;Timeout&quot;) = 307
adoCommand.Properties(&quot;Cache Results&quot;) = False
Set objRS = adoCommand.Execute


While not objRS.EOF

    strName = objRS.Fields(&quot;name&quot;).Value
    strMail = objRS.Fields(&quot;mail&quot;).value
    strPhone = objRS.Fields(&quot;telephoneNumber&quot;).Value

    arrOtherPhone = objRS.Fields(&quot;otherTelephone&quot;).Value
    If IsNull(arrOtherPhone) Then
        strOtherPhone = &quot;&quot;
    Else
        strOtherPhone = &quot;&quot;
        For Each strItem In arrOtherPhone
            If (strOtherPhone = &quot;&quot;) Then
                strOtherPhone = strItem
            Else
                strOtherPhone = strOtherPhone &amp; &quot; &quot; &amp; strItem
            End If
        Next
    End If
    
    &#039;Заполним поля
    objExcel.ActiveCell.Value = strName
    objExcel.ActiveCell.Offset(0,1).Value = strMail
    objExcel.ActiveCell.Offset(0,2).Value = strPhone
    objExcel.ActiveCell.Offset(0,3).Value = strOtherPhone
    objExcel.ActiveCell.AutoFormat
    objExcel.ActiveCell.Offset(1,0).Activate
    
    objRS.MoveNext
Wend

&#039; Чистим память.
Set objRS = Nothing
Set adoCommand = Nothing
Set adoConnection = Nothing</code></pre></div>]]></content>
			<author>
				<name><![CDATA[dmitry_a]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5879</uri>
			</author>
			<updated>2009-03-13T08:30:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=20617#p20617</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBScript: Формирование списка пользователей из ADirectory в Excel]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=20594#p20594" />
			<content type="html"><![CDATA[<p>Задача: Необходимо создать список пользователей из AD в таблицу Excel, при этом у некоторых пользователей не указаны дополнительные телефоны.</p><p>Вопрос: Проблема состоит в том, что у пользователей с неуказанными дополнительными телефонами поле OtherTelephone = не установлено, соответственно условие (otherTelephone=*) для них не выполняется.</p><p>Каким образом можно построить запрос, чтобы в него попадали и пользователи с дополнительными телефонами, и с пустыми значениями ?</p><br /><p>Сам скрипт: <br /></p><div class="codebox"><pre><code>strDomainDN = &quot;DC=test,DC=LOCAL&quot;  

strBase   =  &quot;&lt;LDAP://&quot; &amp; strDomainDN &amp; &quot;&gt;;&quot;

&#039;По кодам UseraccountControl Смотреть. http://support.microsoft.com/kb/305144
strFilter = &quot;(&amp;(objectClass=person)(objectClass=user)(otherTelephone=*)(|(useraccountControl=66048)(useraccountcontrol=512))(!(objectClass=computer)));&quot; 
strAttrs  = &quot;Name,mail,telephoneNumber,otherTelephone;&quot; &#039;Фильтр
strScope  = &quot;subtree&quot;

Set objExcel = WScript.CreateObject(&quot;Excel.Application&quot;)
objExcel.Visible = True
objExcel.Workbooks.Add

objExcel.ActiveSheet.Name = &quot;UserName &quot; &amp; Left(strDomainDN,19) &amp; &quot;...&quot;
objExcel.ActiveSheet.Range(&quot;A1&quot;).Activate
objExcel.ActiveCell.Value = &quot;Имя пользователя&quot;                        &#039;колонка № 1
objExcel.ActiveCell.Offset(0,1).Value = &quot;Электронная почта &quot;    &#039;колонка 2
objExcel.ActiveCell.Offset(0,2).Value = &quot;Телефон &quot;    &#039;колонка 3
objExcel.ActiveCell.Offset(0,3).Value = &quot;Моб. Номер &quot;    &#039;колонка 4
objExcel.ActiveCell.Offset(1,0).Activate                &#039;переход на следующую строку.


Set objConn = CreateObject(&quot;ADODB.Connection&quot;)
objConn.Provider = &quot;ADsDSOObject&quot;
objConn.Open &quot;Active Directory Provider&quot;
Set objRS = objConn.Execute(strBase &amp; strFilter &amp; strAttrs &amp; strScope)
objRS.MoveFirst
i = objRS.Fields.Count
WScript.Echo i

while Not objRS.EOF
  
For Each Field in objRS.fields(&quot;otherTelephone&quot;).value &#039;Перебераем OtherTelephone, а вдруг там есть еще какие-либо телеофны помимо одного мобильника
 OtherTelephone = OtherTelephone + Field + &quot; &quot;
 WScript.Echo otherTelephone
Next 

    objExcel.ActiveCell.Value = objRS.Fields(0).Value
    objExcel.ActiveCell.Offset(0,1).Value = objRS.Fields(1).Value
    objExcel.ActiveCell.Offset(0,2).Value = objRS.Fields(2).Value
    objExcel.ActiveCell.Offset(0,3).Value = objRS.Fields(3).Value
    objExcel.ActiveCell.Offset(0,3).Value = OtherTelephone
    objExcel.ActiveCell.Offset(1,0).Activate
    objRS.MoveNext
OtherTelephone = Empty
Wend</code></pre></div>]]></content>
			<author>
				<name><![CDATA[dmitry_a]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5879</uri>
			</author>
			<updated>2009-03-12T13:42:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=20594#p20594</id>
		</entry>
</feed>
