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
- In folder :
C:\Program Files (x86)\Citrix\XenMobile Device Manager\tomcat\webapps\zdm\WEB-INF\classes
- Open the file
- Seek for zdm.ws.soap.otp-service.enabled=true
- Restart XDM Service
- 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
- Download the script GenerateOTPInvitation : GenerateOTPInvitation.zip
- Like in the previous article we have a config-xdm.ini file to put our server information in it.
- Our command script needs arguments : just launch it without one it will show you :
- 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).
- If everything is good :
Mr. Geek Explanation
- The function you want to seek for first is the below one CreateOTP, code speaks for itself :
- The below is also important since we do need to authenticate differently 🙂
- 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 :).