Esempio n. 1
0
        /// <summary>
        /// Creates organization domain
        /// </summary>
        /// <param name="organizationDistinguishedName"></param>
        /// <param name="domain"></param>
        private void CreateOrganizationDomainInternal(string organizationDistinguishedName, string domain)
        {
            HostedSolutionLog.LogStart("CreateOrganizationDomainInternal");

            string path = ActiveDirectoryUtils.AddADPrefix(organizationDistinguishedName, PrimaryDomainController);

            ActiveDirectoryUtils.AddUPNSuffix(path, domain);
            HostedSolutionLog.LogEnd("CreateOrganizationDomainInternal");
        }
Esempio n. 2
0
        private OrganizationUser GetManager(DirectoryEntry entry)
        {
            OrganizationUser retUser = null;
            string           path    = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Manager);

            if (!string.IsNullOrEmpty(path))
            {
                path = ActiveDirectoryUtils.AddADPrefix(path, PrimaryDomainController);
                if (ActiveDirectoryUtils.AdObjectExists(path))
                {
                    DirectoryEntry user = ActiveDirectoryUtils.GetADObject(path);
                    retUser             = new OrganizationUser();
                    retUser.DisplayName = ActiveDirectoryUtils.GetADObjectStringProperty(user, ADAttributes.DisplayName);

                    retUser.AccountName = ActiveDirectoryUtils.GetADObjectStringProperty(user, ADAttributes.Name);
                }
            }

            return(retUser);
        }