<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; VBS : Созадть Почтовый ящик для пользователя]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=6826</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6826&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «VBS : Созадть Почтовый ящик для пользователя».]]></description>
		<lastBuildDate>Wed, 15 Feb 2012 12:02:14 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[VBS : Созадть Почтовый ящик для пользователя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=56867#p56867</link>
			<description><![CDATA[<div class="codebox"><pre><code>Dim oIADSUser
Dim oMailbox

Set oIADS = GetObject(&quot;LDAP://RootDSE&quot;)
strDefaultNC = oIADS.Get(&quot;defaultnamingcontext&quot;)
MsgBox FindAnyMDB(&quot;CN=Configuration,&quot; &amp; strDefaultNC)

&#039;TODO: Use the newly created domain user account to replace the &quot;UserName&quot;.
Set oIADSUser = GetObject(&quot;LDAP://CN=dsa,CN=Users,&quot; &amp; strDefaultNC)

If oIADSUser Is Nothing then
    MsgBox &quot;The oIADSUser is Nothing.&quot;
Else
    MsgBox &quot;The oIADSUser is created successfully.&quot;
End If

Set oMailBox = oIADSUser
oMailbox.CreateMailbox FindAnyMDB(&quot;CN=Configuration,&quot; &amp; strDefaultNC)
oIADSUser.SetInfo

Function FindAnyMDB(strConfigurationNC)
    Dim oConnection
    Dim oCommand
    Dim oRecordSet
    Dim strQuery

    &#039; Open the Connection.
    Set oConnection = CreateObject(&quot;ADODB.Connection&quot;)
    set oCommand = CreateObject(&quot;ADODB.Command&quot;)
    Set oRecordSet = CreateObject(&quot;ADODB.Recordset&quot;)

    oConnection.Provider = &quot;ADsDSOObject&quot;
    oConnection.Open &quot;ADs Provider&quot;

    &#039; Build the query to find the private MDB.
    strQuery = &quot;&lt;LDAP://&quot; &amp; strConfigurationNC &amp; &quot;&gt;;(objectCategory=msExchPrivateMDB);name,adspath;subtree&quot;

    oCommand.ActiveConnection = oConnection
    oCommand.CommandText = strQuery</code></pre></div><p>ТУТ Выдает ошибку http://clip2net.com/s/1AZcN<br /></p><div class="codebox"><pre><code>Set oRecordSet = oCommand.Execute</code></pre></div><div class="codebox"><pre><code>    &#039; If you have an MDB, return the first one.
    If Not oRecordSet.EOF Then
        oRecordSet.MoveFirst
        FindAnyMDB = CStr(oRecordSet.Fields(&quot;ADsPath&quot;).Value)
    Else
        FindAnyMDB = &quot;&quot;
    End If


    &#039;Clean up.
    oRecordSet.Close
    oConnection.Close
    Set oRecordSet = Nothing
    Set oCommand = Nothing
    Set oConnection = Nothing
End Function</code></pre></div><p>Помогите кто сталкивался, просто не силен в VBS</p>]]></description>
			<author><![CDATA[null@example.com (afteroot)]]></author>
			<pubDate>Wed, 15 Feb 2012 12:02:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=56867#p56867</guid>
		</item>
	</channel>
</rss>
