繁体   English   中英

如何使用C#编辑全局地址列表Office 365

[英]How to edit Global Address List office 365 using c#

这是我编辑GAL的代码,出现错误

Message =您没有足够的权限对​​此对象执行此操作。 源= Microsoft Outlook。

无法通过Outlook API管理员用户进行编辑?

Outlook.Application oApp = new Outlook.Application( );

Outlook.AddressEntry dlEntry = oApp.GetNamespace("MAPI").AddressLists["Global Address List"].AddressEntries["Global Employees"];
Outlook.AddressEntries members = dlEntry.Members;


foreach (Outlook.AddressEntry member in members)
{
    MessageBox.Show(member.Name + ":" + member.Address + ":" + member.GetExchangeUser().JobTitle);
    member.Name =  member.Name  + " Edited";
    member.GetExchangeUser().JobTitle = member.GetExchangeUser().JobTitle  + " Edited";;
    member.Update();
}

GAL(全局地址列表)是从Active Directory元素生成的。 因此,您需要编辑不间断的活动目录,而不是直接编辑GAL。 就您使用Exchange Online(Office 365的一部分)而言,它是底层的Azure Active Directory。

如果使用DirSync / Azure AD Connect,则还可以更新本地Active Directory环境中的内容,以便将其与Azure Active Directory同步。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM