Solved

Get SIP Addresses from a CSV list

Posted on 2016-09-17
7
149 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
[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
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

705 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