I have been mucking around with getting information in and out of Deploy Studio Server(DSS). DSS uses a web service which, apart from the web page itself, doesn’t appear to be documented anywhere.
After trial and error (using wireshark and my hex editor 0xED) I have managed to get a DSS php class together.
It’s function is currently limited to:
- Add Computer
- Delete Computer
- Add Group
- Add Multiple Computers
- Delete Group
- Get all Groups
Using this class in combination with a bit of dscl scripting, it is possible to ‘mirror’ the group membership of Workgroup Manager (WGM) on OS X server with DSS.
It does not currently ‘sync’ the group membership info, but it may well do that already, I have just not tested it yet.
I have modified the script now to sync the groups and computers. It works as follows:
1. Generate list of groups in workgroup manager
2. Generate list of groups in Deploy Studio
3. From above 2 lists, generate 2 other lists => list of groups in WGM and not in DSS, list of groups in DSS and not in WGM
4. Add groups into DSS that are in WGM and not in DSS.
5. Delete groups in DSS that are in DSS and not in WGM.
6. Generate list of computers in WGM
7. Generate list of computers in DSS
8. From above 2 lists, generate 1 other list => list of computers in DSS not in WGM
9. Add all computers to DSS from list generated in step 6
10. Delete computers from DSS from list generate in step 8.
This method means that if you moved computers (into different groups) this changed would be updated in DSS. It also means that if you apply and workflows at the computer level (and not the group level) the changes will be lost on the next sync.
This new version deprecates the use of the xml class files and xml templates, instead it uses the CFPropertyList class from google code. This class however, needs to be modified to allow the loading of a plist string (My feature request). The changes required to this class are documented there, if you have any questions about this modification, please ask me.
Please feel free to enhance the DSS classes’ functions, but if you do please let me know so that it may be added to this class for all to make use of.
Please see here for my class documentation
- PHP >=5.2.6 (that’s what my test system is on.. – 10.5.8 server) It will probably work on 5.0 and above
- class.curl.php from http://munroe.users.phpclasses.org/browse/package/1988.html
- CFPropertyList-1.0.4 from Here – Note this needs to be modified to allow strings to be loaded, see This post for details.
- If you want to get groups from WGM to DSS then you need command line access to the WGM server
- A little bit of php programming knowledge, while I’m sure my code is working, it is not foolproof. Please use this code with care as I will not accept any liability or responsibility for any data loss or damage caused as a result of running this code in your environment
Files in the zip package
- The DSS class (class.dss_int.php)
- A script (wgmsyncdss.php) which will import group and computer information from WGM to DSS. This script must be run on a machine that is bound to your OD and also has network access to the DSS server. there are some fields you will need to set – DSS_URL, DSS_adminuser, DSS_adminpass. You may also want to filter the WGM computer list – ie if you have a ‘server’ group you probably don’t want this added to DSS.