Solved

Get SIP Addresses from a CSV list

Posted on 2016-09-17
7
62 Views
Last Modified: 2016-09-19
Hello

I am trying to import a CSV of names and see if any of the users have a SIP Address associated with them

This is what i wrrote...  However instead of just getting the names in the CSV file it just goes directly to Get-CSuser and grabs everyone..

Any thoughts..??

Import-Csv D:\temp\mark\test.csv | foreach{Get-CsUser |Select-Object displayname, sipaddress}
0
Comment
Question by:mwjones75
7 Comments
 

Author Comment

by:mwjones75
ID: 41803343
or this is another way I am trying to get them...  however with this it works however it pulls all of the email address and I just want the Primary and SIP if they have one...

Get-DistributionGroupMember -Identity "Zzzz-" -ResultSize Unlimited |
Select DisplayName,PrimarySMTPAddress -ExpandProperty EmailAddresses | Export-CSV "c:\temp\mark\dl\0915_Zzzz.csv"
0
 
LVL 14

Expert Comment

by:Schnell Solutions
ID: 41803347
It is just that you need to specify the field that you want to use from your CSV file. I do not know what is the name of the column that you are using on the top to represent the User name or the field that you want. But if this is called user you need to include it like the following example:

Notice that I am adding ' $_.User' after your command. It means than that is the field that I want to use each time that a line is processed.

Import-Csv D:\temp\mark\test.csv | foreach {Get-CsUser $_.User |Select-Object displayname, sipaddress}
0
 
LVL 14

Expert Comment

by:Schnell Solutions
ID: 41803348
Which ones are the headers that you have in your file?
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Expert Comment

by:Mark Jones
ID: 41803437
Displaynames
0
 
LVL 14

Accepted Solution

by:
Schnell Solutions earned 500 total points
ID: 41803445
I made one example here and it works for me in this way:

Import-Csv D:\temp\mark\test.csv | foreach {Get-CsUser $_.Displaynames |Select-Object displayname, sipaddress}

Is it working for you? If not... What is it returning to you now?
0
 
LVL 49

Expert Comment

by:Akhater
ID: 41803477
Just add $_ after your get-csuser command

Import-Csv D:\temp\mark\test.csv | foreach{Get-CsUser $_ |Select-Object displayname, sipaddress}
0
 

Author Closing Comment

by:mwjones75
ID: 41805176
This worked perfectly!
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

Suggested Solutions

Title # Comments Views Activity
DCOM errors in Server 2016 2 25
Exchange 2010 RU 16 5 26
Existing Office 365 implement on-premise AD 4 35
Exchange 2013 - Script needed 7 29
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
This video discusses moving either the default database or any database to a new volume.

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now