export-activeLCSusers
This applies to LCS 2005sp1 environments but should also work on OCS2007 environments.
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.
Get-WmiObject msft_sipesusersetting -filter "Enabled = true" | Select-Object DisplayName
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.
# NAME: export-activeLCSuser.ps1
# DATE : 5/13/2008
#
# 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.csvnote: it's one long line
UPDATE: And here's a link to the MSDN on the UserAccountControl flag

Theme by
Thanks for the link.. Glad to
Thanks for the link.. Glad to be of help, your site has been essential in my PowerShell growth.
Post new comment