How to determine type(user or group ) of a deleted active directory object using c#

家住魔仙堡 提交于 2019-12-13 08:08:39

问题


According to How to determine the type (AD User vs. AD Group) of an account? objectCategory attribute is used to determine whether object is group or user. but objectCategory attribute is removed when an object is deleted. what is the possible way to determine deleted object type ?

Following attributes can be retrieved for deleted user

         objectclass           : top
         objectclass           : person
         objectclass           : organizationalPerson
         objectclass           : user
 msexchmailboxsecuritydescriptor : System.Byte[]
 usnchanged                 : 1577314
 whencreated                : 26/09/2016 06:40:18
 name                           : gonzalo.pierson
DEL:ff11111f-a730-433f-a03e-2e222da622e2
 whenchanged               : 06/10/2016 05:37:17
 objectsid                      : System.Byte[]
 msexchprevioushomemdb     : CN=Mailbox Database,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=abcdomain2,DC=local
 useraccountcontrol             : 544
 msexchhomeservername     : /o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=abcdomainSERVER
 adspath                    : LDAP://CN=gonzalo.pierson\0ADEL:ff11111f-a730-433f-a03e-2e222da622e2,CN=Deleted Objects,DC=abcdomain2,DC=local
 isdeleted                 : True
         proxyaddresses        : smtp:alias1.gonzalo@abcdomain.com
         proxyaddresses        : SMTP:gonzalo.pierson.abcdomain@abcdomain.com
 cn                             : gonzalo.pierson
DEL:ff11111f-a730-433f-a03e-2e222da622e2
 usncreated                 : 1565752
 legacyexchangedn        : /o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=gonzalo.pierson176
 distinguishedname          : CN=gonzalo.pierson\0ADEL:ff11111f-a730-433f-a03e-2e222da622e2,CN=Deleted Objects,DC=abcdomain2,DC=local
 msexchversion             : 44220983382016
 lastknownparent            : OU=Accounts,OU=Southern Region,OU=SBSUsers,OU=Users,OU=MyBusiness,DC=abcdomain2,DC=local
 isrecycled                     : True
 msexchmailboxguid      : System.Byte[]
 msexchuseraccountcontrol  : 0
 instancetype               : 4
 samaccountname         : gonzalo.pierson
 objectguid                 : System.Byte[]

来源:https://stackoverflow.com/questions/39910792/how-to-determine-typeuser-or-group-of-a-deleted-active-directory-object-using

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!