Apr 04 2022 03:49 AM
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.
Apr 04 2022 09:14 AM
Apr 05 2022 01:45 AM
@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.
Apr 05 2022 03:26 AM
SolutionApr 05 2022 03:26 AM
Solution