Hi guys,

I want to run the following in a c# loop but I just don't know how to pass a multi value for a parameter with a comma. The actual cmdlet would be below and does work in exchange powershell:

Set-CalendarProcessing –ResourceDelegates [email]jonDoe@test.com,johnnydoe@test.com[/email] -identity testroom@test.com –AutomateProcessing AutoUpdate

I know my code connection works but it's the "–ResourceDelegates [email]jonDoe@test.com,johnnydoe@test.com[/email]" I don't know how to pass, shown below:

Sample part of the code is here:

command.AddCommand("Set-CalendarProcessing");
command.AddParameter("-ResourceDelegates", "userA@test.com,userB@test.com");
command.AddParameter("-Identity", "test@test.com");
command.AddParameter("-AutomateProcessing", "AutoUpdate");

Thanks
Steve

Perhaps this will work differently?

CommandParameter cp = new CommandParameter("-ResourceDelegates", "userA@test.com,userB@test.com");
command.Parameter.Add(cp);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.