<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<title>Parallels knowledgebase (KB)</title>
<link>http://kb.parallels.com/</link>
<description>Parallels knowledgebase (KB)</description>
<language>en</language>
<copyright>Copyright 2008 Parallels</copyright>
<pubDate>Wed, 10 Sep 2008 00:00:00 +0600</pubDate>
<lastBuildDate>Wed, 10 Sep 2008 00:00:00 +0600</lastBuildDate>
<webMaster>rt-team@parallels.com</webMaster>

<item>
<title><![CDATA[GAL lookup on Good Mobile devices does not work for Exchange mailboxes]]></title>
<link>http://kb.parallels.com/en/1664</link>
<description><![CDATA[<div id="article">
	




	<div id="kb" class="kb">
		<div class="article-container">
			<h2 class="title">GAL lookup on Good Mobile devices does not work for Exchange mailboxes</h2>
			<div class="ab-frame"><div class="bl"><div class="br"><div class="tl"><div class="tr"><!-- frame -->
				<div class="articleProperty">
					<div>Article ID: 1664&nbsp;</div>
					<div>Last Review: Feb,9 2009</div>
					<tr>
						<td>Author: </td>
						<td>Vitaly Filatov</td>
					</tr>
					<br/>
					<tr>
						<td>Last updated by: </td>
						<td>Vitaly Filatov</td>
					</tr>
					<strong>APPLIES TO:</strong>
					<div class="articleApplies">
						<ul>
							<li>Parallels Operations Automation 2.6</li>
						</ul>
					</div>
				</div><!-- articleProperty -->
			</div></div></div></div></div><!-- frame -->

			<div class="article-internal-flag"></div>

			<div id="article-content">
				<div class="article-part">
					<h2>Symptoms</h2>
					In POA versions <strong>2.6</strong> and <strong>2.6 update 1</strong> mailboxes&nbsp;with Good Link support&nbsp;could not use &quot;<strong>GAL Lookup</strong>&quot; feature<em>.</em>
				</div>
				<div class="article-part">
					<h2>Cause</h2>
					GAL Lookup feature uses value from&nbsp;<strong>msExchQueryBaseDn</strong> attribute and expects that it stores distinguished name (DN) of organization unit (OU) of the organization. Since POA version 2.6 until version 2.6 update 2 this attribute stores the DN of organization's address list.
				</div>
				<div class="article-part">
					<h2>Resolution</h2>
					<strong><br /></strong><ol><li>Log on to MPS server (<strong>MPS01</strong>).</li><li>Copy the following text and paste to the new file <strong>fixMsQueryBaseDn.vbs</strong>.<br /><div class="commandline"><code><br />Option Explicit<br />Dim fso<br />Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)<br />Dim logFile<br />Dim logFilename<br />logFilename = WScript.ScriptFullName &amp; &quot;.log&quot;<br />Set logFile = fso.CreateTextFile( logFilename, True, True )<br /><br />Dim argsObj<br />Set argsObj = WScript.Arguments<br />If argsObj.Length &lt;&gt; 1 Then<br />&nbsp;Usage<br />ElseIf LCase(argsObj(0)) = &quot;all&quot; Then<br />&nbsp;ProcessItems GetHostingOuDn(), 0<br />Else<br />&nbsp;Dim userObj<br />&nbsp;logFile.WriteLine &quot;Processing &quot; &amp; argsObj(0)<br />&nbsp;Set userObj = GetObject(argsObj(0))<br />&nbsp;ProcessUser userObj, GetObject(userObj.parent), 0<br />End If<br /><br />WScript.Echo &quot;Executed successfully. See log file &quot; &amp; logFilename &amp; &quot;.&quot;<br />WScript.Quit(0)<br /><br />Sub Usage()<br />&nbsp;Dim stdErr<br />&nbsp;Set stdErr = WScript.StdErr<br />&nbsp;stdErr.WriteLine &quot;Usage:&quot;<br />&nbsp;stdErr.WriteLine &quot;1. For fixing all mailboxes in Hosting OU and under it:&quot;<br />&nbsp;stdErr.WriteLine &quot; cscript.exe /nologo fixMsQueryBaseDn.vbs ALL&quot;<br />&nbsp;stdErr.WriteLine &quot;2. For fixing only one mailbox:&quot;<br />&nbsp;stdErr.WriteLine &quot; cscript.exe /nologo fixMsQueryBaseDn.vbs LDAP://&lt;LDAP path of mailbox&gt;&quot;<br />&nbsp;stdErr.WriteLine &quot;example: cscript.exe /nologo fixMsQueryBaseDn.vbs &quot;&quot;LDAP://cn=john,ou=neverhood inc,ou=provider,ou=Hosting,dc=he,dc=local&quot;&quot;&quot;<br />&nbsp;WScript.Quit(1)<br />End Sub<br /><br />Function GetHostingOuDn()<br />&nbsp;Dim ObjSrv<br />&nbsp;Set ObjSrv = GetObject(&quot;LDAP://RootDse&quot;)<br /><br />&nbsp;Dim dcSuffix<br />&nbsp;dcSuffix = ObjSrv.Get(&quot;defaultNamingContext&quot;)<br />&nbsp;Dim PemConfigObj<br />&nbsp;Set PemConfigObj = GetObject(&quot;LDAP://CN=PEM Configuration,CN=System,&quot; &amp; dcSuffix)<br /><br />&nbsp;Dim xmlObj<br />&nbsp;Set xmlObj = CreateObject(&quot;Microsoft.XMLDOM&quot;)<br />&nbsp;xmlObj.validateOnParse = True<br />&nbsp;xmlObj.async = False<br />&nbsp;xmlObj.loadXML(PemConfigObj.Get(&quot;adminDescription&quot;))<br /><br />&nbsp;Dim hostingOuPath<br />&nbsp;hostingOuPath = xmlObj.SelectSingleNode(&quot;//config/hostingOUName&quot;).text<br /><br />&nbsp;GetHostingOuDn = &quot;OU=&quot;&amp; hostingOuPath &amp;&quot;,&quot; &amp; dcSuffix<br />End Function<br /><br />Sub ProcessItems( byval name, byval level )<br />&nbsp;Dim containerObj<br />&nbsp;Set containerObj = GetObject(&quot;LDAP://&quot;&amp; name )<br />&nbsp;containerObj.Filter = Array(&quot;user&quot;, &quot;organizationalUnit&quot;)<br />&nbsp;Dim objUser<br />&nbsp;For Each objUser In containerObj<br />&nbsp;&nbsp;Dim x<br />&nbsp;&nbsp;For each x in objUser.objectClass<br />&nbsp;&nbsp;&nbsp;If x = &quot;user&quot; Then<br />&nbsp;&nbsp;&nbsp;&nbsp;ProcessUser objUser, containerObj, level<br />&nbsp;&nbsp;&nbsp;&nbsp;Exit For<br />&nbsp;&nbsp;&nbsp;ElseIf x = &quot;organizationalUnit&quot; Then<br />&nbsp;&nbsp;&nbsp;&nbsp;ProcessOU objUser, level<br />&nbsp;&nbsp;&nbsp;&nbsp;Exit For<br />&nbsp;&nbsp;&nbsp;End If<br />&nbsp;&nbsp;Next<br />&nbsp;Next<br />End Sub<br /><br />Function GetADPropertyAsString(obj, propName)<br />&nbsp;Dim lastErr<br />&nbsp;Dim propValue<br />&nbsp;On Error Resume Next<br />&nbsp;propValue = obj.Get(propName)<br />&nbsp;lastErr = Err.Number<br />&nbsp;On Error Goto 0<br />&nbsp;' &amp;h8000500D&nbsp; - PROPERTY NOT SET<br />&nbsp;If (lastErr &lt;&gt; 0) And (lastErr &lt;&gt; &amp;h8000500D) Then Err.Raise lastErr<br />&nbsp;GetADPropertyAsString = &quot;&quot; &amp; propValue<br />End Function<br /><br />Sub ProcessUser( byval objUser, byval parentObj, byval level )<br />&nbsp;logFile.Write Replace(Space(level), &quot; &quot;, &quot;.&quot;) &amp; &quot; user &quot;&amp; objUser.cn &amp; &quot; ... &quot;<br />&nbsp;If &quot;&quot; = GetADPropertyAsString(objUser, &quot;homeMDB&quot;) Then<br />&nbsp;&nbsp;logFile.WriteLine &quot; not a mailbox - skipping&quot;<br />&nbsp;ElseIf LCase(GetADPropertyAsString(objUser, &quot;msExchQueryBaseDn&quot;)) &lt;&gt; LCase(parentObj.distinguishedName) Then<br />&nbsp;&nbsp;objUser.Put &quot;msExchQueryBaseDn&quot;, parentObj.distinguishedName<br />&nbsp;&nbsp;objUser.SetInfo<br />&nbsp;&nbsp;logFile.WriteLine &quot; &quot;&quot;msExchQueryBaseDn&quot;&quot; replaced&quot;<br />&nbsp;Else<br />&nbsp;&nbsp;logFile.WriteLine &quot; mailbox is OK&quot;<br />&nbsp;End If<br />End Sub<br /><br />Sub ProcessOU( byval objOu, byval level )<br />&nbsp;logFile.WriteLine Replace(Space(level), &quot; &quot;, &quot;.&quot;) &amp; &quot; Processing &quot;&amp; objOu.distinguishedName<br />&nbsp;ProcessItems objOu.distinguishedName, level+1<br />End Sub<br /></code></div></li><li>Save the file <strong>fixMsQueryBaseDn.vbs </strong>and execute it from the command line (<strong>Programs &gt; Accessories &gt; Command Prompt</strong>) to&nbsp;fix mailboxes:<br />for fixing all hosted mailboxes:<br /><div class="commandline"><code><br />C:\&gt;cscript.exe /nologo fixMsQueryBaseDn.vbs ALL<br /></code></div><br />for fixing individual mailbox:<br /><div class="commandline"><code><br />C:\&gt;cscript.exe /nologo fixMsQueryBaseDn.vbs LDAP://&lt;LDAP path of mailbox&gt;<br /></code></div></li><li>Check the file <strong>fixMsQueryBaseDn.vbs.log</strong> for execution results.</li></ol>
				</div>
				<div class="keywords"><strong>Keywords:</strong> gal lookup</div>
			</div>
		</div><!-- article-container -->


			<br/><br/>

			<div id="SubscriptionLink24Article" class="subscriptionLink2">
<a href="http://kb.parallels.com/subscriptions/index.html?Type=Article&ArticleID=1664&ArticleLanguage=en&Product=&Category="><img src="http://kb.parallels.com/images/mail.png" width="15" height="15" alt="Subscription for changes to this article"></a>
<a href="http://kb.parallels.com/subscriptions/index.html?Type=Article&ArticleID=1664&ArticleLanguage=en&Product=&Category=">Subscription for changes to this article</a>

<script type="text/javascript">

$(document).ready(function() {
	$('#SubscriptionLink24Article a').each(function(){
		$(this).click(function(event) {
			event.preventDefault();
			MainPageContentHide();
			$('#subscription').html('');
			$.get('/Stuff/Subscription', {
													'Type' : 'Article',
													'ArticleID' : '1664',
													'ArticleLanguage' : 'en',
													'Product' : '',
													'Category' : ''
												}, function(data) {
																	$('#subscription').html(data);
																	$('#subscription').show();
																	SUBbuildsubmenus_product();
																});
		});
	});
});

</script>

</div>





	</div><!-- kb -->

</div><!-- article -->


]]></description>
<author>Vitaly Filatov</author>
<guid isPermaLink="false">1302 LastUpdated: 2009-02-09 03:56:21</guid>
<pubDate>2007-01-26 05:03:45</pubDate>
</item>
</channel>
</rss>



