Remote Desktop Services (per user) license monitoring with a script

With Windows Server 2008 (R2) and the new Remote Desktop Services, you need CALs. They’re essentially the same as the Terminal Services CALs that you used to get, and with Server 2008 you get a lovely little GUI that allows you to generate reports of the current users who have valid licenses etc.

What you can’t do (easily) is use something like the old lsreport.exe to generate a list of who’s using a CAL at a given point in time.

After alot of searching I found a blog post which helped over at the Remote Desktop Services Team Blow: http://blogs.msdn.com/b/rds/archive/2009/11/09/per-user-cal-reporting-script.aspx – it dumps a .csv file of current CAL users and their licence state (valid or expired).

Because what I actually wanted was just an updated csv file every hour so I could trend usage, I added a few lines to the script that looked like this:


objTextFile.WriteLine "time, valid, expired, total"
objTextFile.WriteLine Now() & "," & NumOfW2K8_Valid & "," & NumOfW2K8_Expired & "," & NumOfW2K8_Total

And commented out all the others before setting on a repeating task.