Register
: :
Login
Home
Forums
Blogs
Podcast
Directories
Scripts
Downloads
Community
User Group Support
Learning Resources
We have a new sponsor! Introducting
Pragma Systems
. See the home page for details.
Unanswered
Active Topics
Forums
Search
Members
Forums
>
Using PowerShell
>
General PowerShell
Problem with Array
Last Post 11 Jan 2010 06:05 PM by
Ayth
. 0 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
Ayth
Basic Member
Posts:171
11 Jan 2010 06:05 PM
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.
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
Forums
>
Using PowerShell
>
General PowerShell
Active Forums 4.1
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008