Hello,
Could you please confirm if the code below is not working? If so, I need guidance on how to change the OWA user signature globally, as we plan to reflect the company branding for all users.
The OWAConfig does not include any key related to user's signature.
Below is the code I'm using.
var cca = ConfidentialClientApplicationBuilder
.Create(clientId)
.WithClientSecret(clientSecret)
.WithTenantId(tenantId)
.Build();
var ewsScopes = new string[] { "https://outlook.office.com/EWS.AccessAsUser.All" };
var authResult = await cca.AcquireTokenForClient(ewsScopes).ExecuteAsync();
var ewsClient = new ExchangeService();
ewsClient.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
ewsClient.Credentials = new OAuthCredentials(authResult.AccessToken);
ewsClient.ImpersonatedUserId =
new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "email@domain");
ewsClient.HttpHeaders.Add("X-AnchorMailbox", "email@domain");
var OWAConfig = UserConfiguration.Bind(ewsClient, "OWA.UserOptions", WellKnownFolderName.Root,
UserConfigurationProperties.All);