Solved

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

Posted on 2014-11-18
6
1,833 Views
Last Modified: 2014-11-22
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,
0
Comment
Question by:K Anthony O365
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:Mai Ali (MVP)
ID: 40450282
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
http://www.techysnippets.com/export-lync-user-info-to-csv/
0
 

Author Comment

by:K Anthony O365
ID: 40450348
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.
0
 

Author Comment

by:K Anthony O365
ID: 40450379
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}
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 5

Expert Comment

by:Mai Ali (MVP)
ID: 40450642
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
http://blogs.technet.com/b/meacoex/archive/2011/04/24/powershell-script-get-group-members-and-check-for-users-that-are-not-enabled-for-lync-and-enable-these-users-using-e-mail-address.aspx
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 40452525
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.
UserA
UserB
UserC

Open in new window

You can also use Export-csv to export the result to a csv file..
0
 

Author Closing Comment

by:K Anthony O365
ID: 40459971
This script was very helpful.

Thank you!
0

Featured Post

Are You Headed to Black Hat USA 2017?

Getting ready for Black Hat next week? Kick things off with the WatchGuard Badge Challenge and test your puzzle and cipher skills. Do you have what it takes to earn our limited edition Firebox Badge? Get started today - https://crimsonthorn.net

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief introduction to what I consider to be the best editor for PowerShell.
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
The goal of the tutorial is to teach the user how to instant message and make a video call in Skype.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question