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.csv

note: it's one long line

UPDATE: And here's a link to the MSDN on the UserAccountControl flag

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

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h3> <blockquote> <img>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options