Hi Expers
I have developed the wcf web service for creating the user mailboxes and mail users in office 365. This web service deployed in IIS 7.5 in Windows 7.
I was not able to create the Mail Users using the Web Service and Its throwing Exception while creating the mail users.
Web Service Code to Create The Mail Users
Command command= new Command();
RunspaceInvoke rsi = new RunspaceInvoke();
System.Security.SecureString sBlock = (System.Security.SecureString)rsi.Invoke("(ConvertTo-SecureString -String 'Pa$$word1' -AsPlainText -Force)")[0].BaseObject;
command.Parameters.Add("Password",sBlock );
command.Parameters.Add("MicrosoftOnlineServicesID","abc@abcoffice365-dev.com");
command.Parameters.Add("Name","abc123");
PowerSehll ps= PowerShell.CreatePowerShell();
ps.Commands.AddCommand(command);
ps.invoke();
Exception Details
processPowerShell Remote Parameter set cannot be resolved using the specified named parameters.
System.Management.Automation.RemoteException: Parameter set cannot be resolved using the specified named parameters.
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 LiveConnector.liveedu.LCSCommon.processPowerShell(ICollection`1 processCommands, LCSOperationStatus status)
Error Record Details from Exceptionerror.FullyQualifiedErrorId :AmbiguousParameterSet,New-MailUser
error.CategoryInfo.Category :InvalidArgument
error.CategoryInfo.Activity :New-MailUser
error.CategoryInfo.Reason :ParameterBindingException Any Idea Why it is throwing exception while creating mail users in Office 365 using IIS Web Service.
Help is greatly appreciated.
Thanks
Ameer Basha