Exchange Server 2003 - Can't connect to exchange server in same machine - active-directory

I have an Exchange Server running in a remote machine.
We also have an application that connects to this Exchange Server through ActiveDirectory and Independentsoft's WebDav.
This works perfectly when I run the application locally, but if I install it in the machine where the Exchange Server is running I only have connectivity with Active Directory, through WebDav I can't access any mailbox with the following URL template "LDAP://MyDomain/exchange/test#test.com", the Exist() method returns false.
Using this code:
"
var _Credential = new NetworkCredential(domain.AccessUsername, domain.AccessPassword);
var _WebdavSession = new WebdavSession(_Credential);
_WebdavSession.UserMailbox = _Url;
var _Resource = new Resource(_WebdavSession);
_Resource.Exists(); <-------
"
In the other hand, I installed the application in another machine and tried to do the exact same but I couldn't connect by ActiveDirectory, I get a "The server is not operational" (0x8007203A) error; through WebDav I get "System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond".
All this with exactly the same LDAP URL, credentials, and everything.
Any help would be appreciated.

In the end I solved it, it seems to be a problem with Amazon servers: you can't connect from one to another, but you CAN connect to 127.0.0.1 (but not, for some reason, to localhost).

Related

AWS RDS Instance is not connecting to Jmeter

I am trying to connect my RDS instance to a Jmeter load test however no matter what I try, I keep getting this error message in the Results Tree:
Cannot create PoolableConnectionFactory (The connection to the host database-1.cqdkrfikhe1t.us-east-1.rds.amazonaws.com, named instance database-1 failed. Error: "java.net.SocketTimeoutException: Receive timed out". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434. For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host.)
I feel it may be a problem with my Database URL in JDBC Connection Configuration.
The picture below shows the summary report.
I have mainly tried rewriting the Database URL multiple different ways but none of them seem to work. I have also tried removing and reinstalling the JDBC Drivers but that doesn't seem to work either. I have absolutely no idea what the problem could be. Could someone please help me out with this problem?
Edit: When I change the Database URL I sometimes get this error
message as well:
Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets
Layer (SSL) encryption. Error: "PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target".
ClientConnectionId:9b700d73-f3f0-4cf6-b3a4-607fa9827219)
I think you need to use port 1433
Check out Connecting to a DB instance running the Microsoft SQL Server database engine article
So cross check the port number, VPC options, public accessibility, etc. with the values from the JDBC Connection Configuration
More information: The Real Secret to Building a Database Test Plan With JMeter

How to fix connectex error when trying to access SQL Server instance on Cloud SQL using SSMS via Proxy

What I'm trying to do
I am trying to manage my SQL Server instance on Cloud SQL (GCP) with SQL Server Management Studio (SSMS).
What I've done
I followed the steps in the Google Cloud documentation (here).
I followed steps 1-5 (condensed version below):
Install Cloud SQL
Run gcloud init
Run gcloud auth login (P.S. I'm Owner on Project level)
Download and install Google Cloud SQL Proxy (as per the instructions here)
Enable Cloud SQL Admin API
Install the proxy client (Windows PC for me, x64 - renamed file to cloud_sql_proxy.exe)
Determine proxy authentication method (as per documentation here). I chose Cloud SDK since I need to download it in step 1 anyway
Skip (not using service account authentication)
Determine proxy instance specification (as per documentation here). Using Instances specified on proxy invocation method.
I only have private IP, so by default it will select the correct IP (as per documentation here)
Same as step 5 (below)
5 . Start the proxy. I ran (in cmd) ./cloud_sql_proxy -instances=<INSTANCE_CONNECTION_NAME>=tcp:1433 (obviously replacing the <INSTANCE_CONNECTION_NAME> portion with my instance name.
At this point, everything seems to be working:
Listening on 127.0.0.1:1433 for <INSTANCE_CONNECTION_NAME>
Ready for new connections
New connection for <INSTANCE_CONNECTION_NAME>
New connection for <INSTANCE_CONNECTION_NAME>
Now following the instructions here, I attempt to connect to the database instance using SSMS (127.0.0.1, SQL Server Authentication, sqlserver, my super awesome password), Connect.
My issue
I now get the following error messages in the Cloud SDK window:
couldn't connect to <INSTANCE_CONNECTION_NAME>: dial tcp <PRIVATE_IP>:<PORT>: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Throttline refreshCfg(<INSTANCE_CONNECTION_NAME>: it was only called XXXs ago
(and it repeats a few times)
In SSMS I get the following prompt:
My question
How do I fix this issue and properly connect to my database instance?
When setting the Connectivity settings for the SQL Server instance, I changed it to Private IP and unchecked the Public IP setting. Re-enabling the Public IP setting allowed me to establish a connection:
External applications can still connect to the instance through the Cloud SQL Proxy
This indirectly indicates to me that Cloud SQL Proxy needs the Public IP option to be enabled in order to establish a connection.

Can't reach docker-hosted SQL server from web app docker on same host

On the same virutal machine (remote, ubuntu), I have
An SQL Server running in a Docker
An .NET Core 2.2 (IdentityServer) application running in a docker
An instance of jwilder.nginx-proxy serving as a reverse-proxy for every web application on the machine
A multitude of other .NET Core apps
I am able to connect to all of my websites using both machine IP + port and domain name, which means the reverse proxy works as expected and the dockers are well-configured
I am able to connect to the SQL Server using SSMS from my local machine, which means that the SQL Server docker properly forwards the TCP connection on port 1433
The IdentityServer .NET Core 2 web application is able to connect to the SQL Server when run on my local machine.
The remote-docker IdentityServer application can't reach the SQL Server instance with the following error (shortened for clarity - removed stack trace)
System.Data.SqlClient.SqlException (0x80131904):
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: TCP Provider, error: 40 - Could not open a connection to SQL Server) at [...]
I know that the SQL server is running and reachable from the internet, and I know that the application's code is not at fault because I tested both.
So I deduced it had to be the IdentityServer docker that was blocking the connexion. So I tried:
Using the --expose 20 command on the IdentityServer docker
Opening mapping the port 20 inside the container to some port outside -p 45264:20 in addition to the already exposed port 80
I originally worked on using the port 1433 on both sides of the mapping but since it didn't work I tried using an other port on the outside (20). Didn't change anything
Here is the connexion string used by the IdentityServer (sensitive data hidden):
Data Source=***.***.***.***,20;Initial Catalog=Identity;Persist Security Info=True;User ID=**;Password=******************
Why can't my IdentityServer docker reach the SQL Server docker while the SQL Server itself is perfectly reachable? How can I make this setup work?
When wrapping SQL server into Docker, the first thing to anticipate is the way you connect. SQL Server prefers named pipes and you have to explicitly set mode to tcp.
If connection is done locally, don't use localhost, change it to 127.0.0.1. Also writing explicit tcp: prefix may help, like this: Server=tcp:x.y.z.q,1433
As I understood you run Sql Server and IdentityServer (which has connection problem) in separate docker containers.
If this is so then referring to localhost (i.e. 127.0.0.1) is not correct. Because in this case IdentityServer tries to connect to itself. This would work if the IdentityServer have run on the host machine, since you forward SQL server port to it. But in your case, you should connect to the SQL server container IP instead.
Considering all above I see three options for you to solve this:
You can get ip address of SQL Server container by running docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <sql_container_name_or_id>
Run SQL container with static IP via docker run --ip <static_ip_value> <sql_container_name_or_id> and then use static ip you have specified in connection string.
Run SQL container with specified host name via docker run --hostname <sql_host_name> <sql_container_name_or_id> and then use specified hostname in the connection string.
It is up to you which way to go.
Use tcp, 127.0.0.1 and host port to connect. Mention in the identity server docker settings that it depends on sql database server container. Like this,
identityservice:
...
depends_on:
- sqldataservice
This way the database container will be made available first.
"ConnectionString": "Server=tcp:127.0.0.1,8433;Database=dbname;User Id=sa;Password=abc#1234;"
I ended up giving up on getting this to work using a single host, so I simply decided to have the SQL Server run in a separate machine.

Internal server error Login failed for user 'DOMAIN\MACHINENAME$'

I am stuck and can't figure this one out.
I am using VS2017 to deploy a Angular 6 application with a Dot Net Core 2 back end that talks to a SQL Server DB on a remote server. I am not using and ORM or EF system, just straight ADO connections.
I am getting this error =
error: "Internal server errorLogin failed for user 'DOMAIN\MACHINENAME$'."
500 Internal Server Error
I have tried the following things:
making Sure the connection string does not have Integrated Security = true
making sure App Pool is set to No Managed Code
that the app is not set up to use NETWORK SERVICE or LocalSystem as login
This all seemed to start in the past 2 weeks. Before then, while the app was more simple, it was still connecting to DB just fine. So I am not sure what would cause this error.
I do not get this error when using the site locally on my dev machine (loccalhost). Everything connects and gets data just fine there.
This is only when I deploy to our servers...
Ideas?
EDIT FOR QUESTIONS
Connection string = data source=<IPADDRESS>;initial catalog=<DBNAME>;user id=<DBUSERNAME>;password=<DBPW>;Trusted_Connection=True;
You have Trusted_Connection=True; in your connection string; remove it, since you are trying to use a username and password rather than Windows authentication.

How do I configure Windows Server 2008 R2 to allow sending of email from an Integrated Services Package in SQL Server

How do I configure Windows Server 2008 R2 to allow sending of email from an Integrated Services Package in SQL Server?
I am trying to send an email from an SSIS package that that has been imported into the MSDB stored packages.
When I run the package I get the below error:
[Send Mail Task] Error: An error occurred with the following error
message: "Failure sending mail. System.Net.WebException: Unable to
connect to the remote server System.Net.Sockets.SocketException: An
attempt was made to access a socket in a way forbidden by its access
permissions
I have tried the same thing using a script task and MailMessage() and SmtpClient() in .NET and the task does not fail but it also does not send the email.
As a sidenote: I know there is a website setup on the server through IIS that is able to send emails via port 25.
I have given the package the same host IP address and port number, but it I still get an error.
Does anyone know what I can troubleshoot for finding a way to make this work?
Thanks
Does the package send the email successfully when running in debug mode on your dev workstation? If so, then I'm guessing the SMTP server is denying the SQL Server Integration Services server permission to connect. Perhaps the ip address of the SSIS server needs to be granted connect and/or relay permission in the SMTP product?
To test this, and other connectivity issues, telnet from the SSIS server to the SMTP server on port 25 (http://support.microsoft.com/kb/153119).
Additionally, set up Database Mail in SQL Server Database Services and test email from there. This also tests that the SMTP server allows the SSIS/MSSSQL server to connect and send mail.
Always test using both an internal email address and an external email address - that way you test relay permissions as well.
The problem was that the server had changed to use something other than the default TCP port.
The SSIS send email task only supports port 25, so I updated the script tasks and used them.

Resources