Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Am getting "@{01test=addr1} when I should be getting ... well, just "01test"

$
0
0

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


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>