我需要知道是否有任何EWS-JS API(例如https://github.com/gautamsi/ews-javascript-api)支持EWS UserConfiguration对象及其Update方法来更新OWA签名。
这是EWS + PowerShell代码,我需要将其转换为EWS JS API,并从Node.js代码执行:
$owaUserOptions= [Microsoft.Exchange.WebServices.Data.UserConfiguration]::Bind( $exService,"OWA.UserOptions",
[Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Root,
[Microsoft.Exchange.WebServices.Data.UserConfigurationProperties]::All);
if (-not $owaUserOptions.Dictionary.ContainsKey("signaturehtml")) {
if (-not [System.String]::IsNullOrEmpty($HtmlSignature)) {
$owaUserOptions.Dictionary.Add("signaturehtml",$HtmlSignature)
}
}
$owaUserOptions.Update()
答案 0 :(得分:0)
var HtmlSignature = "signature html";
UserConfiguration.Bind(service,"OWA.UserOptions", WellKnownFolderName.Root, UserConfigurationProperties.All)
.then(owaUserOptions =>{
if(!owaUserOptions.Dictionary.ContainsKey("signaturehtml")){
if(StringHelper.IsNullOrEmpty(HtmlSignature)){
owaUserOptions.Dictionary.Add("signaturehtml",HtmlSignature)
owaUserOptions.Update().then(()=>{
console.log("update complete");
});
}
}
});