private void ProcessMailboxTransportServerRole(bool isMailboxTransportServer, ITopologyConfigurationSession scSession, ADObjectId configContainerId)
        {
            ADObjectId childId = configContainerId.GetChildId("Mailbox");

            IConfigurable[] array = base.DataSession.Find <MailboxTransportServer>(null, childId, true, null);
            if (isMailboxTransportServer)
            {
                if (array.Length == 0)
                {
                    MailboxTransportServer mailboxTransportServer = new MailboxTransportServer();
                    mailboxTransportServer.NetworkAddress      = this.DataObject.NetworkAddress;
                    mailboxTransportServer.Name                = "Mailbox";
                    mailboxTransportServer.Edition             = ServerEditionType.StandardEvaluation;
                    mailboxTransportServer.AdminDisplayVersion = ConfigurationContext.Setup.InstalledVersion;
                    mailboxTransportServer.VersionNumber       = SystemConfigurationTasksHelper.GenerateVersionNumber(ConfigurationContext.Setup.InstalledVersion);
                    mailboxTransportServer.ExchangeLegacyDN    = LegacyDN.GenerateLegacyDN(Server.GetParentLegacyDN(scSession), mailboxTransportServer);
                    mailboxTransportServer.CurrentServerRole   = ServerRole.Mailbox;
                    mailboxTransportServer.SetId(childId);
                    base.DataSession.Save(mailboxTransportServer);
                    return;
                }
            }
            else if (array.Length > 0)
            {
                base.DataSession.Delete(array[0]);
            }
        }
Пример #2
0
        protected override IConfigurable PrepareDataObject()
        {
            base.PrepareDataObject();
            ITopologyConfigurationSession topologyConfigurationSession = (ITopologyConfigurationSession)base.DataSession;

            this.DataObject.Edition             = ServerEditionType.StandardEvaluation;
            this.DataObject.AdminDisplayVersion = ConfigurationContext.Setup.InstalledVersion;
            this.DataObject.VersionNumber       = SystemConfigurationTasksHelper.GenerateVersionNumber(ConfigurationContext.Setup.InstalledVersion);
            this.DataObject.MailboxRelease      = MailboxRelease.E15;
            if (string.IsNullOrEmpty(this.Name))
            {
                string localComputerFqdn = NativeHelpers.GetLocalComputerFqdn(true);
                int    num = localComputerFqdn.IndexOf('.');
                this.DataObject.Name = ((num == -1) ? localComputerFqdn : localComputerFqdn.Substring(0, num));
                NewExchangeServer.TcpNetworkAddress value = new NewExchangeServer.TcpNetworkAddress(NetworkProtocol.TcpIP, localComputerFqdn);
                this.DataObject.NetworkAddress = new NetworkAddressCollection(value);
            }
            this.DataObject.FaultZone = "FaultZone1";
            ADObjectId childId  = topologyConfigurationSession.GetAdministrativeGroupId().GetChildId("Servers");
            ADObjectId childId2 = childId.GetChildId(this.DataObject.Name);

            this.DataObject.SetId(childId2);
            this.DataObject.ExchangeLegacyDN = LegacyDN.GenerateLegacyDN(Server.GetParentLegacyDN(topologyConfigurationSession), this.DataObject);
            using (RegistryKey registryKey = RegistryUtil.OpenRemoteBaseKey(RegistryHive.LocalMachine, NativeHelpers.GetLocalComputerFqdn(true)))
            {
                using (RegistryKey registryKey2 = registryKey.OpenSubKey(NewExchangeServer.EdgeKeyName))
                {
                    if (registryKey2 == null && this.IsDomainJoined())
                    {
                        this.SetServerSiteInformation(topologyConfigurationSession);
                    }
                }
            }
            return(this.DataObject);
        }
Пример #3
0
        protected override IConfigurable PrepareDataObject()
        {
            Server server = (Server)base.PrepareDataObject();

            server.AdminDisplayVersion = ConfigurationContext.Setup.InstalledVersion;
            server.VersionNumber       = SystemConfigurationTasksHelper.GenerateVersionNumber(ConfigurationContext.Setup.InstalledVersion);
            return(server);
        }