Am working on a script to pull PrimarySMTPaddress based on WindowsLiveID. I have a csv file of WindowsLiveIDs. I save the contents variable $List = import-csv -path path\file.csv ... The next step is a foreach:
foreach($addressin$list) {get-mailbox$address|select-objectPrimarySMTPaddress,displayName,windowsliveid}
Which errors out, as this becomes a hashtable:
Cannot convert value "@{01test=addr1}" to type "Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter".
The table is for every ID in the list (in this instance, "01test" is the first in the list, "addr1" is the second. This continues as "01test" is compared against every other address e.g. "addr1", "addr2""addr3" and so on). Of course, just { $address } instead of get-mailbox is fine. Have not done much with Powershell lately, and am sure I'm just missing something though at this point am not sure what.
Thanks for any help,
--Joe