Microsoft KB Archive/313717

= Zscript.exe Cannot Set Values for Hyphenated Attributes =

Article ID: 313717

Article Last Modified on 5/28/2003

-

APPLIES TO


 * Microsoft Metadirectory Services 2.1
 * Microsoft Metadirectory Services 2.2 Service Pack 1
 * Microsoft Metadirectory Services 2.2 Service Pack 1

-



This article was previously published under Q313717



SYMPTOMS
Zscript.exe is a directory-aware batch program that the Metadirectory Management Agents use to start its various processes and to set directory attributes. When you try to set an attribute with Zscript.exe that contains a hyphen, the following error message is generated:

There is an error in the script for 'ma=TestMA,dsaname=server,ou=applications,dc=microsoft,dc=com' on or before line 4: '-' was unexpected.



CAUSE
This problem occurs because of a problem with Zscript.exe.



RESOLUTION
The following sample Microsoft Visual Basic script can be called from Zscript.exe to set an attribute in Microsoft Metadirectory Services (MMS). Instead of using the Zscript.exe SET statement to configure this attribute, call the following sample script by using the EXECUTE statement to start this script (that sets the hyphenated attribute): Set objArgs = WScript.Arguments

strMMSServer  = &quot;localhost&quot; strMMSPort    = &quot;390&quot; strMMSUserName = &quot;CN=Administrator,DSAName=mmstest_srv,OU=Applications,DC=com&quot; strMMSPassword = &quot;mmstest_srv&quot;

' first parameter will be the MA DN strMADN           = objArgs(0)

' second parameter will be the attribute name strMAAttribute     = objArgs(1)

' third parameter will be the attribute value strMAPropertyValue = objArgs(2)

dim MAObject dim prov dim str

set prov = GetObject( &quot;LDAP:&quot; )

str = &quot;LDAP://&quot; & strMMSServer & &quot;:&quot; & strMMSPort & &quot;/&quot; & strMADN

wscript.echo str wscript.echo strMMSUserName wscript.echo strMMSPassword

set MAObject = prov.OpenDSObject( &quot;LDAP://&quot; & strMMSServer & &quot;:&quot; & strMMSPort & &quot;/&quot; & strMADN, strMMSUserName, strMMSPassword, 0 )

MAObject.Put strMAAttribute, strMAPropertyValue MAObject.SetInfo

'WScript.Quit



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
With the script that is included earlier in this article, the following example describes how to set the msMMS-DsInDeltaMode attribute to &quot;true&quot; on a Management Agent:   Copy the script that is included earlier in this article into Notepad, and then configure the first four parameters of the script for your MMS server-specific information: strMMSServer  = &quot;localhost (name of your MMS server)&quot; strMMSPort    = &quot;390&quot; strMMSUserName = &quot;CN=Administrator,DSAName=mmstest_srv,OU=Applications,DC=com&quot; strMMSPassword = &quot;mmstest_srv&quot;  Save the file as Myscript.vbs in the Zoomserv\Bin folder on the MMS server. Select the MA. Click Design MA.</li> Click the Control MA Operations tab.</li> Click the MA Control Script tab.</li>  Add the following line to your Management Agent's control script: EXECUTE MyScript.vbs &quot;Put the DN or your Management Agent Here&quot; &quot;msMMS-DsInDeltaMode&quot; &quot;TRUE&quot; </li> Save these changes, and then run the Management Agent.</li></ol>

Additional query words: zoomit

Keywords: kbfix kbenv kbprb KB313717

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.