header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Problem with Array
Last Post 11 Jan 2010 10:05 AM by Ayth. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
AythUser is Offline
Basic Member
Basic Member
Posts:232
Avatar

--
11 Jan 2010 10:05 AM
    Hello,

    I know I've ran into this before, but cannot remember how I worked around it. I have a CSV that has a list of contact records in it. Like so:

    name
    "deGraft-Johnson, AnneMarie"
    "Ming, Adwina"
    "tyers, greg"
    "Oakley, Heather"
    "Alexander, Blake"

    I'm trying to loop through them and get each contact record, then I'll add it to a distribution group. But I'm getting the following error:

    Get-MailContact : Cannot bind parameter 'Identity'. Cannot convert the "@{email
     =omahony, elizabeth}" value of type "System.Management.Automation.PSCustomObje
    ct" to type "Microsoft.Exchange.Configuration.Tasks.MailContactIdParameter".
    At C:\test.ps1:5 char:26
    + Get-MailContact -identity <<<<  $($email) -resultsize unlimited
        + CategoryInfo          : InvalidArgument: (:) [Get-MailContact], Paramete
       rBindingException
        + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Exchang
       e.Management.RecipientTasks.GetMailContact

    From what I can see it's casting the variable into the wrong type, and it's not getting the contact. Can anyone assist? Thanks.
    My Blog about Powershell http://poweroftheshell.blogspot.com/ Follow me on twitter @darrinhenshaw
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer