It often comes handy to be able to generate invitation with script, indeed you could integrate this process to an internal company’s portal or to simply change the flow of how it goes.

There is many ways to do that we will just cover what you need to generate an OTP. If you want me to go further in another article just ask I will be glad to cover that.

Determine if OTP WebServices are activated

1. From a browser go to : https://XDMFQDN:PORT/zdm/cxf/soap/OtpService?wsdl

If you end up with a WSDL description it means OTP Services are activated.

If you get a blank page or an error it means you need to activate OTP Services as described below.

Activate OTP Services on XDM

  1. In folder : C:\Program Files (x86)\Citrix\XenMobile Device Manager\tomcat\webapps\zdm\WEB-INF\classes
  2. Open the file ewconfig.properties
  3. Seek for zdm.ws.soap.otp-service.enabled=true
  4. Restart XDM Service
  5. Check by doing what’s describe in Determine if OTP WebServices are activated

Why not making a webpage?

Because goal of those first articles is for you to understand, so command line is enough for that. Moreover you’ll be able to copy/paste the code to reuse it since I split into functions.

How to leverage the resulting script

  1. Download the script GenerateOTPInvitation : GenerateOTPInvitation.zip
  2. Like in the previous article we have a config-xdm.ini file to put our server information in it.
  3. Our command script needs arguments : just launch it without one it will show you :
  4. If you enter a wrong user for example, it will throw an error as below, I don’t bother checking if the user exists (that could be overcome).
  5. If everything is good :
  6.  

Mr. Geek Explanation

  1. The function you want to seek for first is the below one CreateOTP, code speaks for itself :
  2. The below is also important since we do need to authenticate differently 🙂
  3. We also need to override a bit our SoapClient, thanks to my brother for that, ‘ninsuo’ !

You now have everything to generate an invitation on your own.
Do not hesitate to ask if you have any question or would like to see an article with a special subject :).