During MMS 2016 I demonstrated how to use a web service to query AD groups in order to install ConfigMgr Packages and Applications dynamically during OS Deployment, here is the code and sample scripts.
Cred: Thanks to Patrik Felix and Pontus Wendt for granting me permission to post the solution to the community.
A little while back, one of our customers wanted to have the OSD task sequence query AD groups to install packages and applications during deployment, so I wrote a web service that did it. The solution (web service) enumerates all AD groups that the computer is a member of, and queries the AdminDescription value of each group to create a list of packages and applications to install. Then the task sequence calls the web service, and the default Install Software and Install Applications actions installs them dynamically.
Here is the download, and to make it work you do the following:
1. Create an AD group named with the ConfigMgr package or application name. The name doesn't have to match exactly, but it helps if they are somewhat alike 🙂
2. Using Active Directory User and Computers (select View / Advanced Features to get the Attribute Editor), edit the AdminDescription attribute of the group. Use a prefix of PKG: if it's a legacy package, and APP: if it's an application model application.
3. Configure the task sequence to query the web service by adding two command line actions in the state restore phase, before the actions that installs packages and applications. The commands are:
4. Add the scripts and CustomSettings.ini to the scripts folder of your MDT package. Modify the CustomSettings.ini file with your server name, and then update the package.
5. Copy the web service to a folder on your site server, I used the E:\ViaMonstraWebServices\Applist in this example.
6. On your site server (my is named CM01), using Internet Information Services (IIS) Manager, expand CM01 (VIAMONSTRA\Administrator), and expand Sites.
7. Right-click the Default Web Site, and select Add Application. Use the following settings:
Physical Path: E:\ViaMonstraWebServices\Applist
8. Expand the Default Web Site, and select the applist application. Configure the following authentication settings:
Anonymous Authentication: Enabled
ASP.NET Impersonation: Enabled
Forms Authentication: Disabled
Windows Authentication: Disabled
9. Using Internet Explorer, verify that the webservice works by navigating to http://cm01/applist/configmgr.asmx and run the two web methods.