The challenge was to generate a list of LCS enabled users that were not disabled. I have a WMI query that will generate a list of LCS users, but I really wanted to be able to filter out the disabled users.
Install Powershell 1.0 or later on LCS server
Get-WmiObject msft_sipesusersetting -filter "Enabled = true" | Select-Object DisplayName >LCSuserslist.txt
As I had some other needs at the time, I added the telephone information as well to the query. Using get-member you can find a number of other different pieces of useful information to gather as well.
A lot of the 'engine' on how/where to get this information I found here and a nod to Eric Woodford for helping with the only enabled users filter.
#
#
# COMMENT: Requires Quest Active Directory Extension 1.1
#
# Get date for file name
$day = Get-Date -UFormat "%Y%m%d"
Get-QADUser -SizeLimit 0 -LDAPFilter '(&(msRTCSIP-UserEnabled=TRUE)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))' -IncludedProperties 'msRTCSIP-Line' | Select-Object displayName, msRTCSIP-Line, telephoneNumber, Mobile | Export-Csv -Path .\$day-LCSuser.csv
It’s interesting to read content. nice post.
ReplyDeleteMS Dynamics Online Training