Category Archives: Powershell

Create quota templates

Last year I was involved in a project where the goal was to migrate the users home directories from an old Windows 2003 server to a new Windows 2012 and going from no quotas to 30 different quotas. In the POC I created this script to setup the quota templates with warning messages and thresholds, and I am glad i did since the project changed the template size and the body in the email a couple of times.


Populate AD Group from profile

Today we needed to collect all the users who had logged in the last 90 days on one of our remote desktop servers. This script looks at the user profile directories last write time to determine last login and then put all users who has logged in last 90 days in an array. After that it creates a new AD-group and populates the group with the users from the array.

Count AD group members

Every year we have to count and report licenses on different systems. Since we use centralized Active Directory security groups to decide which users who gain access to RDS servers etc etc… it`s a pretty easy task to count the users in those groups to find out how many CALs we need. When the boss interrupts you more then once it´s time to use powershell to solve it. This script include one level nested groups.