I found this code to create an account
ICollection<PSObject> results;
RunspaceConfiguration runspaceConf = RunspaceConfiguration.Create();
PSSnapInException PSException = null;
PSSnapInInfo info = runspaceConf.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.Admin", out PSException);
Runspace runspace = RunspaceFactory.CreateRunspace(runspaceConf);
runspace.Open();
Pipeline pipeline = runspace.CreatePipeline();
Command createMailbox = new Command("Enable-Mailbox");
createMailbox.Parameters.Add("identity",txtnombres.Text + " " + txtapellidos.Text);
createMailbox.Parameters.Add("database", @"TEST2\First Storage Group\Mailbox Database");
pipeline.Commands.Add(createMailbox);
results = pipeline.Invoke();
but gives me this error:
erver Error in '/' Application.
----------------- ...
Go to the complete details ...