Script Download: 22250.ziphttp://gallery.technet.microsoft.com/Create-User-Collections-2814d53a
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 http://aka.ms/onescriptingallery