Script Download: The script is available for download from http://gallery.technet.microsoft.com/How-to-assign-License-to-a920873d. You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.
This script will auto assign License to unlicensed users if there's only one type of SKU in an organization. If an organization has multi-type SKUs, an excel sheet will be popped out for edition after you run the script. Then the script will assign license based on the excel file.
You can find more All-In-One Script Framework script samples at http://aka.ms/onescriptingallery