私は、既存のメールボックスのパスワードをリセットするためにpowershellコマンドを使用していますが、「パラメータ名 'Password'に一致するパラメータが見つかりません。 " 「パスワード」はMSDN http://technet.microsoft.com/en-us/library/bb123981.aspxに従ったパラメータなので、変です。私は何か見落としてますか? マイコード:ドキュメントからが見つかりませんpowershellを使用してメールボックスのパスワードをリセットする際のパスワード引数
using (Runspace remoteRunspace = RunspaceFactory.CreateRunspace(connectionInfo))
{
try
{
remoteRunspace.Open();
PowerShell ps = PowerShell.Create();
ps.Runspace = remoteRunspace;
ps.AddCommand("Set-Mailbox");
string PrincipalName = userId + emailDomain;
ps.AddParameter("Identity", identity);
ps.AddParameter("UserPrincipalName", PrincipalName);
ps.AddParameter("Name", name);
ps.AddParameter("DisplayName", name);
ps.AddParameter("Password", emailPwd);//emailPwd is defined as securestring and set value previously, so it cannot be the exception reason
ps.Invoke();
return true;
}
catch (Exception ex)
{
throw ex;
return false;
}
finally
{
remoteRunspace.Close();
}
パスワードをリセットするにはどうすればよいですか? –