public IFederationInformation GetFederationInformation(string domainName) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("DomainName", domainName); sessionParameters.Set("BypassAdditionalDomainValidation", true); Dictionary <string, object> dictionary = null; try { dictionary = this.RemotePowershellSession.GetPowershellUntypedObjectAsMembers("Get-FederationInformation", null, sessionParameters); } catch { } if (dictionary != null) { FederationInformation federationInformation = new FederationInformation(); object value; if (dictionary.TryGetValue("TargetAutodiscoverEpr", out value)) { federationInformation.TargetAutodiscoverEpr = TaskCommon.ToStringOrNull(value); } if (dictionary.TryGetValue("TargetApplicationUri", out value)) { federationInformation.TargetApplicationUri = TaskCommon.ToStringOrNull(value); } return(federationInformation); } return(null); }
public void RemoveRemoteDomain(ObjectId identity) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Confirm", false); sessionParameters.Set("Identity", identity.ToString()); this.RemotePowershellSession.RunOneCommand("Remove-RemoteDomain", sessionParameters, false); }
public void RemoveAvailabilityAddressSpace(string identity) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", identity); sessionParameters.Set("Confirm", false); base.RemotePowershellSession.RunOneCommand("Remove-AvailabilityAddressSpace", sessionParameters, false); }
public void RemoveIntraOrganizationConnector(string identity) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", identity); sessionParameters.Set("Confirm", false); base.RemotePowershellSession.RunOneCommand("Remove-IntraOrganizationConnector", sessionParameters, false); }
public void UpdateEmailAddressPolicy(string identity) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", identity); sessionParameters.Set("UpdateSecondaryAddressesOnly", true); base.RemotePowershellSession.RunOneCommand("Update-EmailAddressPolicy", sessionParameters, false); }
public void SetWebServicesVirtualDirectory(string distinguishedName, bool proxyEnabled) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", distinguishedName); sessionParameters.Set("MRSProxyEnabled", proxyEnabled); base.RemotePowershellSession.RunCommand("Set-WebServicesVirtualDirectory", sessionParameters); }
public DomainContentConfig NewRemoteDomain(string domainName, string name) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Name", name); sessionParameters.Set("DomainName", domainName); return(base.RemotePowershellSession.RunOneCommandSingleResult <DomainContentConfig>("New-RemoteDomain", sessionParameters, false)); }
public void RemoveOutboundConnector(ADObjectId identity) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", identity.ToString()); sessionParameters.Set("Confirm", false); base.RemotePowershellSession.RunOneCommand("Remove-OutboundConnector", sessionParameters, false); }
public void SetFederatedOrganizationIdentifier(string defaultDomain) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("DefaultDomain", defaultDomain); sessionParameters.Set("Enabled", true); base.RemotePowershellSession.RunOneCommand("Set-FederatedOrganizationIdentifier", sessionParameters, false); }
public void NewAcceptedDomain(string domainName, string name) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("DomainName", domainName); sessionParameters.Set("Name", name); base.RemotePowershellSession.RunCommand("New-AcceptedDomain", sessionParameters); }
public void RemoveOrganizationRelationship(string identity) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", identity); sessionParameters.Set("Confirm", false); this.RemotePowershellSession.RunCommand("Remove-OrganizationRelationship", sessionParameters); }
public void SetIntraOrganizationConnector(string identity, string discoveryEndpoint, MultiValuedProperty <SmtpDomain> targetAddressDomains, bool enabled) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", identity); sessionParameters.Set("DiscoveryEndpoint", discoveryEndpoint); sessionParameters.Set <SmtpDomain>("TargetAddressDomains", targetAddressDomains); sessionParameters.Set("Enabled", enabled); base.RemotePowershellSession.RunOneCommand("Set-IntraOrganizationConnector", sessionParameters, false); }
public void AddAvailabilityAddressSpace(string forestName, AvailabilityAccessMethod accessMethod, bool useServiceAccount, Uri proxyUrl) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("ForestName", forestName); sessionParameters.Set("AccessMethod", accessMethod); sessionParameters.Set("UseServiceAccount", useServiceAccount); sessionParameters.Set("ProxyUrl", proxyUrl); base.RemotePowershellSession.RunOneCommand("Add-AvailabilityAddressSpace", sessionParameters, false); }
public void SetFederatedOrganizationIdentifier(string accountNamespace, string delegationTrustLink, string defaultDomain) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("AccountNamespace", accountNamespace); sessionParameters.Set("DelegationFederationTrust", delegationTrustLink); sessionParameters.Set("Enabled", true); sessionParameters.Set("DefaultDomain", defaultDomain); base.RemotePowershellSession.RunOneCommand("Set-FederatedOrganizationIdentifier", sessionParameters, false); }
private void ConfigureOnPremisesRemoteDomains() { foreach (KeyValuePair <string, Tuple <MailFlowTask.RemoteDomainType, MailFlowTask.Operation, DomainContentConfig> > keyValuePair in this.onpremisesRemoteDomains) { string key = keyValuePair.Key; MailFlowTask.RemoteDomainType item = keyValuePair.Value.Item1; MailFlowTask.Operation item2 = keyValuePair.Value.Item2; DomainContentConfig domainContentConfig = keyValuePair.Value.Item3; if (item2 == MailFlowTask.Operation.New) { string name = string.Format("Hybrid Domain - {0}", key); domainContentConfig = base.OnPremisesSession.NewRemoteDomain(key, name); } if (item2 == MailFlowTask.Operation.New || item2 == MailFlowTask.Operation.Update) { SessionParameters sessionParameters = new SessionParameters(); if (item == MailFlowTask.RemoteDomainType.HybridDomain) { sessionParameters.Set("TrustedMailInbound", true); } else if (item == MailFlowTask.RemoteDomainType.Coexistence) { sessionParameters.Set("AllowedOOFType", AllowedOOFType.InternalLegacy); sessionParameters.Set("TrustedMailOutbound", true); sessionParameters.Set("AutoReplyEnabled", true); sessionParameters.Set("AutoForwardEnabled", true); sessionParameters.Set("DeliveryReportEnabled", true); sessionParameters.Set("NDREnabled", true); sessionParameters.Set("DisplaySenderName", true); sessionParameters.Set("TNEFEnabled", true); } base.OnPremisesSession.SetRemoteDomain(domainContentConfig.Identity.ToString(), sessionParameters); } } }
public void NewOrganizationRelationship(string name, string targetApplicationUri, string targetAutodiscoverEpr, IEnumerable <SmtpDomain> domainNames) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Name", name); sessionParameters.Set("TargetApplicationUri", targetApplicationUri); sessionParameters.Set("TargetAutodiscoverEpr", targetAutodiscoverEpr); sessionParameters.Set("Enabled", true); sessionParameters.Set <SmtpDomain>("DomainNames", domainNames, (SmtpDomain d) => d.Domain); this.RemotePowershellSession.RunCommand("New-OrganizationRelationship", sessionParameters); }
private SessionParameters BuildParameters(IOnPremisesOrganization configuration) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set <SmtpDomain>("HybridDomains", configuration.HybridDomains, (SmtpDomain d) => d.Domain); sessionParameters.Set("InboundConnector", TaskCommon.ToStringOrNull(configuration.InboundConnector)); sessionParameters.Set("OutboundConnector", TaskCommon.ToStringOrNull(configuration.OutboundConnector)); sessionParameters.Set("OrganizationRelationship", TaskCommon.ToStringOrNull(configuration.OrganizationRelationship)); sessionParameters.Set("OrganizationName", configuration.OrganizationName); return(sessionParameters); }
public void SetReceiveConnector(IReceiveConnector configuration) { SessionParameters sessionParameters = new SessionParameters(); if (configuration.Identity != null) { sessionParameters.Set("Identity", configuration.Identity.ToString()); } sessionParameters.Set("TLSCertificateName", TaskCommon.ToStringOrNull(configuration.TlsCertificateName)); sessionParameters.Set("TLSDomainCapabilities", TaskCommon.ToStringOrNull(configuration.TlsDomainCapabilities)); base.RemotePowershellSession.RunOneCommand("Set-ReceiveConnector", sessionParameters, false); }
public void NewIntraOrganizationConnector(string name, string discoveryEndpoint, string onlineTargetAddress, bool enabled) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Name", name); sessionParameters.Set("DiscoveryEndpoint", discoveryEndpoint); MultiValuedProperty <SmtpDomain> multiValuedProperty = new MultiValuedProperty <SmtpDomain>(); SmtpDomain item = new SmtpDomain(onlineTargetAddress); multiValuedProperty.TryAdd(item); sessionParameters.Set <SmtpDomain>("TargetAddressDomains", multiValuedProperty); sessionParameters.Set("Enabled", enabled); base.RemotePowershellSession.RunOneCommand("New-IntraOrganizationConnector", sessionParameters, false); }
public void SetEmailAddressPolicy(string identity, string includedRecipients, ProxyAddressTemplateCollection enabledEmailAddressTemplates) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", identity); sessionParameters.Set("ForceUpgrade", true); if (!string.IsNullOrEmpty(includedRecipients)) { sessionParameters.Set("IncludedRecipients", includedRecipients); } if (enabledEmailAddressTemplates != null) { sessionParameters.Set <ProxyAddressTemplate>("EnabledEmailAddressTemplates", enabledEmailAddressTemplates); } base.RemotePowershellSession.RunCommand("Set-EmailAddressPolicy", sessionParameters); }
public void AddFederatedDomain(string domainName) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("DomainName", domainName); base.RemotePowershellSession.RunCommand("Add-FederatedDomain", sessionParameters); }
public void SetSendConnector(ISendConnector configuration) { SessionParameters sessionParameters = this.SetSendConnectorParameters(configuration); sessionParameters.Set("Identity", configuration.Identity.ToString()); base.RemotePowershellSession.RunOneCommand("Set-SendConnector", sessionParameters, false); }
public List <Dictionary <string, object> > GetPowershellUntypedObjectsAsMembers(string command, string identity, SessionParameters parameters) { if (!string.IsNullOrEmpty(identity)) { parameters.Set("Identity", identity); } Collection <PSObject> collection = this.RunCommand(command, parameters, true); if (collection == null || collection.Count == 0) { this.logger.LogInformation(HybridStrings.HybridInfoObjectNotFound); return(null); } List <Dictionary <string, object> > list = new List <Dictionary <string, object> >(); foreach (PSObject psobject in collection) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); foreach (PSMemberInfo psmemberInfo in psobject.Members) { dictionary.Add(psmemberInfo.Name, psmemberInfo.Value); } list.Add(dictionary); } return(list); }
public IntraOrganizationConnector GetIntraOrganizationConnector(string identity) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", identity); return(base.RemotePowershellSession.RunOneCommandSingleResult <IntraOrganizationConnector>("Get-IntraOrganizationConnector", sessionParameters, true)); }
public void SetOutboundConnector(IOutboundConnector configuration) { SessionParameters sessionParameters = this.BuildParameters(configuration); sessionParameters.Set("Identity", configuration.Identity.ToString()); base.RemotePowershellSession.RunCommand("Set-OutboundConnector", sessionParameters); }
public void SetFederationTrustRefreshMetadata(string identity) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", identity); sessionParameters.SetNull <bool>("RefreshMetadata"); base.RemotePowershellSession.RunCommand("Set-Federationtrust", sessionParameters); }
public IEnumerable <IExchangeCertificate> GetExchangeCertificate(string server) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Server", server); return(from c in base.RemotePowershellSession.RunOneCommand <ExchangeCertificate>("Get-ExchangeCertificate", sessionParameters, true) select new PowerShellOnPremisesSession.Certificate(c)); }
private SessionParameters BuildParameters(IOutboundConnector configuration) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Name", configuration.Name); sessionParameters.Set <SmtpDomainWithSubdomains>("RecipientDomains", configuration.RecipientDomains); sessionParameters.Set <SmartHost>("SmartHosts", configuration.SmartHosts); sessionParameters.Set("ConnectorType", configuration.ConnectorType); sessionParameters.Set("TLSSettings", (Enum)configuration.TlsSettings); sessionParameters.Set("TLSDomain", configuration.TlsDomain); sessionParameters.Set("CloudServicesMailEnabled", configuration.CloudServicesMailEnabled); sessionParameters.Set("RouteAllMessagesViaOnPremises", configuration.RouteAllMessagesViaOnPremises); sessionParameters.Set("UseMxRecord", false); return(sessionParameters); }
public IEnumerable <ADWebServicesVirtualDirectory> GetWebServicesVirtualDirectory(string server) { SessionParameters sessionParameters = new SessionParameters(); if (server != null) { sessionParameters.Set("Server", server); } return(base.RemotePowershellSession.RunOneCommand <ADWebServicesVirtualDirectory>("Get-WebServicesVirtualDirectory", (server != null) ? sessionParameters : null, true)); }
public IOutboundConnector GetOutboundConnector(string identity) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", identity); TenantOutboundConnector tenantOutboundConnector = base.RemotePowershellSession.RunOneCommandSingleResult <TenantOutboundConnector>("Get-OutboundConnector", sessionParameters, true); if (tenantOutboundConnector != null) { return(new OutboundConnector(tenantOutboundConnector)); } return(null); }