?
Solved

Get SIP Addresses from a CSV list

Posted on 2016-09-17
7
Medium Priority
?
207 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
Ransomware Attacks Keeping You Up at Night?

Will your organization be ransomware's next victim?  The good news is that these attacks are predicable and therefore preventable. Learn more about how you can  stop a ransomware attacks before encryption takes place with our Ransomware Prevention Kit!

 

Expert Comment

by:Mark Jones
ID: 41803437
Displaynames
0
 
LVL 14

Accepted Solution

by:
Schnell Solutions earned 2000 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

Bringing Advanced Authentication to the SMB Market

WatchGuard announces the acquisition of advanced authentication provider, Datablink, with one mission – to bring secure authentication to SMB, mid-market, and distributed enterprises with a cloud-based solution, ideal for resale via their established channel & MSSP community.

Question has a verified solution.

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

In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses
Course of the Month15 days, 1 hour left to enroll

771 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