Basically this script collects user counts based on registrar pool and Conferencing policy, puts it into a couple nice tables, and emails the report to me. This script provided here looks at two registrar pools and three Conferencing policies. You should be able to modify this as needed for your environment.
I have run this on my Lync 2010 and 2013 Front End servers.
Download the script here. Some of the HTML code included in the script doesn't show up correctly in the preview below.
#****************************************** # # DESCRIPTION: Email Report of Lync users based on Registrar Pool and Conferencing Policy # VERSION: 1.0 # UPDATED: # AUTHOR: Brad Roberts # CONTACT: brad@thatucguy.com # BLOG: http://www.thatUCguy.com # BLOG ENTRY: http://www.thatucguy.com/2014/04/powershell-lync-user-report.html # # DISCLAIMER: You running this script means you won't blame me if this breaks your stuff. This script is provided AS IS and is not guaranteed to work perfectly in your environment. Testing is always a good idea. Any risk in running this script is entirely on you. # #****************************************** #****************************************** # # Variable Definitions # #****************************************** $strSubject = "Lync User Report" $strSMTPServer = "smtp.thatucguy.com" $strToEmail = "lync.admin@thatucguy.com" $strFromEmail = "no-reply@thatucguy.com" # Registrar Pools $poolAmericasFQDN = "lync-pool-americas.thatucguy.com" $poolAmericas = "Americas Users" $poolEMEAFQDN = "lync-pool-emea.thatucguy.com" $poolEMEA = "EMEA Users" # Conferencing Policies $ConfSilver = "Lync-Conferencing-Silver" $ConfGold = "Lync-Conferencing-Gold" $ConfPlatinum = "Lync-Conferencing-Platinum" #****************************************** # # Load Required PS Modules # #****************************************** if ((Get-Module ActiveDirectory) -eq $null){Import-Module ActiveDirectory} if ((Get-Module Lync) -eq $null){Import-Module Lync} $blnDebug = $false #******************************** # # Get User counts, total and for each pool # #******************************** $counttotal = (Get-CsUser -OnLyncServer).count $countamericas = (Get-CsUser -filter {registrarpool -eq $poolAmericasFQDN}).count $countemea = (Get-CsUser -filter {registrarpool -eq $poolEMEAFQDN}).count $usercount = $usercount + "Lync User Report
" $usercount = $usercount + "" $usercount = $usercount + "
Total Users | $poolAmericas | $poolEMEA |
---|---|---|
$counttotal | $countamericas | $countemea |
Lync User Report by Conferencing Policy
" $ConfCount = $ConfCount + "" $ConfCount = $ConfCount + "Silver Users | Gold Users | Platinum Users |
---|---|---|
$countSilver | $countGold | $countPlatinum |
Hope this helps!
brad
Fun Fact:
Louisiana is the first state to have an Official Crustacean and it is the crawfish.
No comments:
Post a Comment