• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2404
  • Last Modified:

How to find users already enabled in Lync 2013 Server using CSV or Text file?

I have a CSV or Text file containing usernames. I need to use it in a PS script to see if they are already enabled in Lync Server.

Thank you,
Anthony K O365
Anthony K O365
  • 3
  • 2
1 Solution
Mai Ali (MVP)Senior Infrastructure ConsultantCommented:
using the Lync management shell type this command:
get-csuser | Select-Object DisplayName, SAMAccountname, SIPAddress >e:\user.csv
user file will be filled with the lync enabled user.
Also you can check below command
Anthony K O365Author Commented:
Actually, what I'm looking for is to take a list of users from a text or CSV and use it as a filter to see if they are enabled in Lync.  Your script simply shows how to export a list of users into a CSV file.
Anthony K O365Author Commented:
How can I use filter below to find users in a text file to see if they are enabled on Lync or not?

Get-CsAdUser –Filter {CsEnabled –eq $False}
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Mai Ali (MVP)Senior Infrastructure ConsultantCommented:
The above command will list to you all enable users if you want to run command from Lync Server.
To filter which is enable or not. That based on AD by checking sip address who have sip address is enable.
Also you can run below script
So if you are trying to verify the user accounts from a list then the following code will help you..
Import-Module lync
GC C:\user.txt | %{
Try{Get-CsUser $_ -ea stop | Out-Null;$Status = "Enabled"}Catch{$Status = "Disabled"}
$_ | Select @{N="User";E={$_}},@{N="Lync";E={$Status}}

Open in new window

C:\user.txt Input file should be like.

Open in new window

You can also use Export-csv to export the result to a csv file..
Anthony K O365Author Commented:
This script was very helpful.

Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now