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
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 5/28/2003 |
---|
Keywords: | kbenv kbfix kbprb KB313717 |
---|
|