|
I'm working on writing something that will allow you to create distribution groups in Exchange 2010.
The problem I am having is I am passing string arrays to my service for the Members and ManagedBy parameters.
This is how I attempted to make this work:
var members = new MultiValuedProperty<object>();
foreach (string s in group.Members)
members.Add(s);
cmd.AddParameter("Members", members);
The problem I'm having is it is returning an error because it appears it wants Microsoft.Exchange.Configuration.Tasks.RecipientWithAdUserGroupIdParameter within the MultiValuedProperty.
I'm a little confused because it then looks like the RecipientWithAdUserGroupIdParameter contains an array of RecipientIdParameter:
Error: System.ServiceModel.FaultException: System.Management.Automation.RemoteException: Cannot process argument transformation on parameter 'Members'. Cannot convert value "8caf8910-86d0-4d00-a452-8c30c0f62373 cfa01a55-6b35-4e61-bf0e-9050308623c7" to type "Microsoft.Exchange.Data.MultiValuedProperty`1[Microsoft.Exchange.Configuration.Tasks.RecipientWithAdUserGroupIdParameter`1[Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter]]". Error: "Cannot convert the "8caf8910-86d0-4d00-a452-8c30c0f62373" value of type "Deserialized.Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter" to type "Microsoft.Exchange.Configuration.Tasks.RecipientWithAdUserGroupIdParameter`1[Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter]"." at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection`1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke() at CloudPanel.Exchange.ExchPs.RunPowershell(PSCommand pscmd, String script) at CloudPanel.Exchange.ExchPs.RunPowershell(PSCommand pscmd, String script) at CloudPanel.Exchange.ExchPs.New_DistributionGroup(DistributionGroup group, String companydn)
Anyone have an idea what I can do to accomplish this? There are some stuff out on the web about using ICollection when reading from Exchange but i'm trying to send commands to exchange.
|
|
|
|
|
RecipientIdParameter is the baseclass for RecipientWithAdUserGroupIdParameter so I think by passing the RecipientWithAdUserGroupIdParameter with the MultiValuedProperty might solve this error.
Note:I havent used this before.
Jibesh V P
|
|
|
|
|
The problem is RecipientWithAdUserGroupIdParameter is another array.
so it has to be done like this:
var members = new MultiValuedProperty<RecipientWithAdUserGroupIdParameter<RecipientIdParameter>>();
But then I can't add to the RecipientWithAdUserGroupIdParameter because it doesn't have that method.
new RecipientWithAdUserGroupIdParameter<RecipientIdParameter>().
Only has these methods:
Equals
GetHashCode
GetObjects<>
GetType
ToString
|
|
|
|