This script shows how to create user collections based user groups in System Center 2012 Configuration Manager SP1.
Currently, you often need to create user collections based on user groups in Active Directory. After that, you can deploy applications and packages for specific users. Usually an Active Directory contains a lot of user groups, but it's a time consuming task to create collections based on user groups in SCCM console.
So you need to use a script to reduce your workload.
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery