Bulk Operations with the Personalization Server
*This post originally appeared on the AppSense blog prior to the rebrand in January 2017, when AppSense, LANDESK, Shavlik, Wavelink, and HEAT Software merged under the new name Ivanti.
Often Environment Manager admins ask how they can perform bulk operations against multiple users within their Personalization database. In Environment Manager 8.5 on wards, the Environment Manager Agent automatically cleans up files that are no longer included when application includes or excludes are updated; however we understand this does not accommodate every single scenario.
The Personalization Server API provides a powerful way to accomplish many more operations. In this blog I am going to discuss how the API can be leveraged in conjunction with Windows PowerShell in order to perform some simple tasks.
Most of the scripts I created against the Personalization Server API can be divided into three, simple sections.
Firstly the Personalization Server proxy dll must be loaded and a connection established to the Personalization Server. There are a couple of ways of doing this, but the example below will work in most instances. I recommend that you use at least PowerShell Version 3.
The API expects users to be passed in the format ‘Domain\User’, so if you are writing a script which affects users in multiple domains this will need to be included in the file. Otherwise (as I have done in my examples below) it can literally contain a list of users.
Another option is to query Active Directory for a list of users, this could be based on AD group membership, as in this example:
Another option is to query the Personalization server and return a list of users in a particular Personalization group. The method for doing this is covered in the Personalization Server API Guide.
The third and final step is to iterate through the list of users that you generated and perform the desired operation on each one. I am going to give a couple of examples of some of the operations below.
In this first example, I migrate users from one Personalization group, into a new (existing) Personalization group.
In this second example I roll back the Application Group archive to the most recent for a specified application group.
This is a preview of what can be achieved with the Personalization server API. If you're interested in using this, then I encourage you to review the AppSense Environment Manager Personalization Server API guide. It provides details and description of all the API calls available and gives further examples of how the API can be used. It's included with the installation media and can be found in the AppSense installation directory on the Personalization server. It is also available on the newly launched AppSense Support Portal.