Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-11-18
6
Medium Priority
?
2,152 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:Anthony K O365
  • 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:Anthony K 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:Anthony K 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
 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

 
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 2000 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:Anthony K O365
ID: 40459971
This script was very helpful.

Thank you!
0

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

Question has a verified solution.

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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
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…
Loops Section Overview

824 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