EWS 用户配置 class 到 EWS-JS API

EWS UserConfiguration class to EWS-JS API

我需要知道是否有任何 EWS-JS API(例如 https://github.com/gautamsi/ews-javascript-api)支持 EWS UserConfiguration 对象及其更新方法来更新 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()

免责声明:我是该库的作者。 Laeeq 也通过电子邮件私下联系了我。为社区利益发布我的答案。代码块使用打字稿。

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");
            });
        }
    }
});