public IOnPremisesOrganization Clone(ADObjectId identity)
        {
            OnPremisesOrganization onPremisesOrganization = new OnPremisesOrganization();

            onPremisesOrganization.UpdateFrom(this);
            onPremisesOrganization.Identity = identity;
            return(onPremisesOrganization);
        }
Esempio n. 2
0
        public void SetOnPremisesOrganization(IOnPremisesOrganization configuration, IOrganizationConfig onPremisesOrgConfig, MultiValuedProperty <SmtpDomain> hybridDomains, IInboundConnector inboundConnector, IOutboundConnector outboundConnector, OrganizationRelationship tenantOrgRel)
        {
            Microsoft.Exchange.Management.Hybrid.Entity.OnPremisesOrganization onPremisesOrganization = (Microsoft.Exchange.Management.Hybrid.Entity.OnPremisesOrganization)configuration;
            onPremisesOrganization.HybridDomains            = hybridDomains;
            onPremisesOrganization.InboundConnector         = inboundConnector.Identity;
            onPremisesOrganization.OutboundConnector        = outboundConnector.Identity;
            onPremisesOrganization.OrganizationName         = onPremisesOrgConfig.Name;
            onPremisesOrganization.OrganizationRelationship = (ADObjectId)tenantOrgRel.Identity;
            SessionParameters sessionParameters = this.BuildParameters(configuration);

            sessionParameters.Set("Identity", configuration.Identity.ToString());
            base.RemotePowershellSession.RunCommand("Set-OnPremisesOrganization", sessionParameters);
        }
Esempio n. 3
0
        public IOnPremisesOrganization NewOnPremisesOrganization(IOrganizationConfig onPremisesOrgConfig, MultiValuedProperty <SmtpDomain> hybridDomains, IInboundConnector inboundConnector, IOutboundConnector outboundConnector, OrganizationRelationship tenantOrgRel)
        {
            Microsoft.Exchange.Management.Hybrid.Entity.OnPremisesOrganization onPremisesOrganization = new Microsoft.Exchange.Management.Hybrid.Entity.OnPremisesOrganization(onPremisesOrgConfig.Guid, onPremisesOrgConfig.Name, hybridDomains, inboundConnector.Identity, outboundConnector.Identity, onPremisesOrgConfig.Guid.ToString(), (ADObjectId)tenantOrgRel.Identity);
            SessionParameters sessionParameters = this.BuildParameters(onPremisesOrganization);

            sessionParameters.Set("Name", onPremisesOrganization.Name);
            sessionParameters.Set("OrganizationGuid", onPremisesOrganization.OrganizationGuid);
            Microsoft.Exchange.Data.Directory.SystemConfiguration.OnPremisesOrganization onPremisesOrganization2 = base.RemotePowershellSession.RunOneCommandSingleResult <Microsoft.Exchange.Data.Directory.SystemConfiguration.OnPremisesOrganization>("New-OnPremisesOrganization", sessionParameters, false);
            if (onPremisesOrganization2 != null)
            {
                return(new Microsoft.Exchange.Management.Hybrid.Entity.OnPremisesOrganization
                {
                    Identity = (ADObjectId)onPremisesOrganization2.Identity,
                    OrganizationGuid = onPremisesOrganization2.OrganizationGuid,
                    OrganizationName = onPremisesOrganization2.OrganizationName,
                    HybridDomains = onPremisesOrganization2.HybridDomains,
                    InboundConnector = onPremisesOrganization2.InboundConnector,
                    OutboundConnector = onPremisesOrganization2.OutboundConnector,
                    Name = onPremisesOrganization2.Name,
                    OrganizationRelationship = onPremisesOrganization2.OrganizationRelationship
                });
            }
            return(null);
        }