WebService special characters in variable

Sep 24, 2014 at 8:14 AM
Im having some problem using the web service to move a computer to a OU that contains a special character.

The following vars are used:


OSDComputerName=NL-VM002
MachineObjectOU=OU=Users & Computers,OU=Amsterdam,OU=Netherlands,OU=Countries,OU=EMEA,DC=domain,DC=local

[MoveComputer]
WebService=HTTP://NL-WDS01.DOMAIN.LOCAL/MDTWebService/AD.asmx/MoveComputerToOU
Parameters=OSDComputerName,MachineObjectOU
OSDComputerName=ComputerName
MachineObjectOU=OUPath

Debug log:
2014-09-24 10:09:13.1229|DEBUG|MaikKoster.Deployment.WebService.AD|Called method: MoveComputerToOU
2014-09-24 10:09:13.1229|DEBUG|MaikKoster.Deployment.WebService.AD|Specified Domain is
2014-09-24 10:09:13.1229|DEBUG|MaikKoster.Deployment.WebService.AD|No Username configured. Using Application pool account
2014-09-24 10:09:13.1229|DEBUG|MaikKoster.Deployment.WebService.AD|Creating new AD Controller
2014-09-24 10:09:13.3779|DEBUG|MaikKoster.Deployment.AD.Controller|Created new controller Instance for Domain domain.local.
2014-09-24 10:09:13.3779|INFO|MaikKoster.Deployment.WebService.AD|Requested to move computer NL-VM002 to OU OU=Users
2014-09-24 10:09:13.3779|INFO|MaikKoster.Deployment.WebService.AD|Getting local Domain controller of requester

As you can see OU is truncated at the "&" character.

Is there a way to use special characters in the web service call ? using the web service web page will work with special characters.
Sep 24, 2014 at 9:46 AM
Have solved it by adding the following code to ZTIDataAccess.vbs:

Line 881 after:
        ' Find the value to work with

        If oEnvironment.ListItem(sElement).Count > 0 then
            Set tmpValue = oEnvironment.ListItem(sElement)
        ElseIf oEnvironment.Item(sElement) <> "" then
            tmpValue = oEnvironment.Item(sElement)
        Else
            oLogging.CreateEntry "No value specified for parameter '" & sElement & "', web service results could be unpredictable.", LogTypeInfo
            tmpValue = ""
        End If 


        ' Replace special characters

        tmpValue = Replace(tmpValue, "%", "%25")
        tmpValue = Replace(tmpValue, "&", "%26")
        tmpValue = Replace(tmpValue, "+", "%2B")