Zscript.exe Cannot Set Values for Hyphenated Attributes (313717)



The information in this article applies to:

  • Microsoft Metadirectory Services 2.1
  • Microsoft Metadirectory Services 2.2
  • Microsoft Metadirectory Services 2.2 SP1

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   = "localhost"
strMMSPort     = "390"
strMMSUserName = "CN=Administrator,DSAName=mmstest_srv,OU=Applications,DC=com"
strMMSPassword = "mmstest_srv"

' 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( "LDAP:" )

str	= "LDAP://" & strMMSServer & ":" & strMMSPort & "/" & strMADN

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

set MAObject = prov.OpenDSObject( "LDAP://" & strMMSServer & ":" & strMMSPort & "/" & 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 "true" on a Management Agent:
  1. 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   = "<I BRACKET="YES">localhost (name of your MMS server)</I>"
    strMMSPort     = "390"
    strMMSUserName = "CN=Administrator,DSAName=mmstest_srv,OU=Applications,DC=com"
    strMMSPassword = "mmstest_srv"
    					
  2. Save the file as Myscript.vbs in the Zoomserv\Bin folder on the MMS server.
  3. Select the MA.
  4. Click Design MA.
  5. Click the Control MA Operations tab.
  6. Click the MA Control Script tab.
  7. Add the following line to your Management Agent's control script:
    EXECUTE MyScript.vbs "Put the DN or your Management Agent Here" "msMMS-DsInDeltaMode" "TRUE"
    					
  8. Save these changes, and then run the Management Agent.

Modification Type:MajorLast Reviewed:5/28/2003
Keywords:kbenv kbfix kbprb KB313717