User Profile
Kieran_Mees
Copper Contributor
Joined 4 years ago
User Widgets
Recent Discussions
Re: Take CSV with UPNs and add DisplayName, PrimarySMTPAddress and GUID
I figured it out. The script I used is as following: Import-CSV C:\TestCSV.csv| ForEach-Object {Get-Mailbox -id $_.UserPrincipalName} | Select Name,DisplayName,UserPrincipalName,GUID,PrimarySMTPAddress | export-csv -NoTypeInformation c:\TestCSV2.csv4.2KViews0likes0CommentsRe: Take CSV with UPNs and add DisplayName, PrimarySMTPAddress and GUID
VasilMichev Ok that seemed to work, however it grabs those values of everyone on the Exchange. I only want the values for the specific ones from the CSV. E.g. the server has 20 users, in my CSV I have 10 users I want the GUID, Primary SMTP and display name for. Additionally, how would I put this all back into the CSV? When I try to export-csv, I get an error because of the $_ variable and when I try putting "$_ Out-File C:\example.csv" the example.csv only has a weird greek symbol which I assume is an error.3.9KViews0likes1CommentTake CSV with UPNs and add DisplayName, PrimarySMTPAddress and GUID
Hi, I'm currently looking for a way to amend my code Get-Mailbox -Resultsize Unlimited | select DisplayName,PrimarySMTPAddress,UserPrincipalName,GUID| Export-csv C:\O365Users.csv So that this takes from a CSV with a selection of UPNs and outputs the DisplayName, PrimarySMTP and GUID of only those from that imported CSV. Is this possible and how would I go about it? I'm very new to PowerShell so any and all help would be great.Solved4.2KViews0likes3Comments
Recent Blog Articles
No content to show