Exemplo n.º 1
0
 private void DeleteSiteCollection()
 {
     if (string.IsNullOrEmpty(this.ExternalDirectoryObjectId))
     {
         ObjectIdMapping objectIdMapping = new ObjectIdMapping(base.ADSession);
         objectIdMapping.Prefetch(new string[]
         {
             this.SmtpAddress
         });
         this.ExternalDirectoryObjectId = objectIdMapping.GetIdentityFromSmtpAddress(this.SmtpAddress);
     }
     using (SharePointNotification sharePointNotification = new SharePointNotification(SharePointNotification.NotificationType.Delete, this.ExternalDirectoryObjectId, base.AccessingUser.OrganizationId, base.ActAsUserCredentials, base.ActivityId))
     {
         sharePointNotification.Execute();
     }
 }
Exemplo n.º 2
0
        private void DeleteAAD()
        {
            if (!base.IsAADEnabled)
            {
                return;
            }
            string objectId;

            if (!string.IsNullOrEmpty(this.ExternalDirectoryObjectId))
            {
                objectId = this.ExternalDirectoryObjectId;
            }
            else
            {
                ObjectIdMapping objectIdMapping = new ObjectIdMapping(base.ADSession);
                objectIdMapping.Prefetch(new string[]
                {
                    this.SmtpAddress
                });
                objectId = objectIdMapping.GetIdentityFromSmtpAddress(this.SmtpAddress);
            }
            base.AADClient.DeleteGroup(objectId);
        }