IIS and SQL on separate servers - how do you setup a user account for .net app? [closed] - sql

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
Is there a site with details on how to setup a web .net app hosted on IIS requiring access to a db on a remote server? I can do this when both IIS and SQL Server are on the same box, using AppPool user...but don't know how to do this when the SQL server is remote. Our setup:
AD, both SQL Server and IIS servers are in same domain,IIS 7.8 and 8,SQL 2008 and 2012,Databases to be accessed by >1 IIS server. IIS is anonymous access
Is the most secure method to contune to use an app pool user on IIS, and to create a user on SQL with domainname\machinename$
Would I be right in thinking that this would work as the app pool user uses machinename$ Thus both IIS and SQL are using machinename$?

There are really 2 methods to do this:
1) Use SQL server authentication. Create a SQL user and use a connection string in the following format for SQL 2012:
Server=myServerAddress;Database=myDataBase;User Id=myUsername;
Password=myPassword;
2) Use mixed mode authentication and authenticate as a Windows user. Your connection string would look like this:
Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;
You'd first go onto the web servers and create a Windows user. Remove it from the domain users group.
Then you'd go into SQL, add the user you're trying to connect with to the list of users, then grant read/write to the database you're trying to access.
If you go with this method, you'd set your app pool to run as the user you created and then add that user to the IIS_WPG group if you're running Windows 2003 or to the IIS_IUSRS group if you're running Windows 2008 or later.
Either one of these methods are perfectly acceptable. If you're running the webservers in the DMZ (not in your Windows domain), you'll want to go with option 1. If the webservers are in the domain, some would argue that option 2 is marginally safer because you're not storing the password in plain text, but you could still do option 1 if you felt like it.
Also, here's a pretty good site with a list of formats of connection strings for various versions of Windows/.NET/SQL:
https://www.connectionstrings.com/sql-server-2012/

Related

How to fix this login failed for user? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 months ago.
Improve this question
User,privilege and role
This is my first time using MS studio I am learning by myself
I tried going to the login properties and tweaking the properties nothing happen. My teacher didn't teach how to use this btw. I follow the instructions, but I'm stuck here.
This is what I am aiming for result
New user login
What you want to do is change the server authentication mode to "SQL Server and Windows Authentication mode". Currently your server is only set to "Windows Authentication mode" which does not allow logins from SQL Server "Login" accounts.
To do so, you'll need to login to your server as an account that has access (either an authenticated Windows account or the SA account) and then follow these instructions:
Change authentication mode with SSMS
In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.
On the Security page, under Server authentication, select the new server authentication mode, and then click OK.
In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.
In Object Explorer, right-click your server, and then click Restart. If SQL Server Agent is running, it must also be restarted.

Microsoft SQL Server 2014 too many services [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have a problem. I can't start SQL Server 2014.
It's ok when I connect to a server as a Windows authentication, but when I try to connect as SQL Server authentication with username sa and my password, O get a SQL Server error 18456.
Why? When installing Management Studio with youtube video, there were few differences:
When installing new instance SQLExpress, there was error because the instance with this name already existed so I changed the name of instance to MSSQLServer...
Also in SQL Server Configuration Manager in SQL Server Services,there are 5 services and I think there shouldn't be so many:
Each SQL Server instance has their own services for different usages. Here you've 2 instances {"SQLEXPRESS", "MSSQLSERVER"}, each has its own SQL Agent. This is normal.
... but when I try to connect as SQL Server authentication with username sa and my password, O get a SQL Server error 18456. Why?
If you want to connect with system administrator account sa, you need to enable the mixed running mode of the target SQL Server instance, e.g. SQLEXPRESS. Because sa is not windows authentication. You've 2 options:
Enable this mixed running mode during the installation. Choose Windows Authentication and SQL Server Authentication.
Connect to your SQL Server instance with an adminstrator account using Windows Authentication and then change the server running mode.
If the server is already running on mixed mode, but you're still getting the same error. Then you're probably using a wrong password for sa. Did you use your windows password by mistake?

Cannot Connect from Hyper-V Manager on Windows 10 to Hyper-V Server 2012 R2 [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 months ago.
Improve this question
Just as the title says, I'm having a bit of a problem connecting from a Hyper-V Manager instance on a Windows 10 machine to a Hyper-V Server 2012 which is found on the same network. Neither of them, however, is joined to AD/DNS/etc... they are both running in WORKGROUP and I'm trying to access the server with the \server\user path and with a user on the server with admin rights and privileges to all of the connected services.
I keep getting the following:
"An error occurred while attempting to connect to server. Check that
the Virtual Machine Management service is running and that you are
authorized to connect to the server." "You do not have the required
permission to complete this task. Contact the administrator of the
authorization policy for the computer."
I have pretty much depleted all of Google's natural resources on this topic and this particular error and I can confirm that nothing from different workarounds/tutorials worked and that all of the relevant services are in fact started/working etc.
Any ideas please? :)
Add the target account credentials to the Windows Credential Manager from the command line and try reconnecting
cmdkey /add:TARGET /user:TARGET\USER /pass
If you are not signed in as administrator, when you open hyper-v manager "run as administrator"
Make sure you run the PowerShell terminal as administrator ("run as administrator")

Access SQL Server 2012 Online [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a database on my home PC. It is on Microsoft SQL Server 2012. I would like to access this data at work. There are 2 options that I am considering and would like to know how to achieve either.
Connect to the DB (home) via Visual Studio (work) online. How to do this?
Turn my home computer into a server. How to do this?
My PC is new and it is on the house wifi network. It is running Windows Server 2012.
If there are better suggestions I am willing to consider. This is for personal use- one user with roughly 50-100 mb data transfer daily to server.
As far as I know, you can connect to Your database from anywhere you want. But for achieving this You need to perform the following actions:
You need to check that Your SQL Server is configured to use both SQL
and Windows authentication (check link
http://technet.microsoft.com/en-us/library/ms188670.aspx).
You need to add a SQL login with needed permissions to Your database(s). Script can be achieved from here. But this operation can also be performed in UI on Your home computer.
You need to check that the port which Your SQL server listening on
is opened in your firewall (list of ports per protocols and Firewall
configuration described here:
http://technet.microsoft.com/en-us/library/ms144228.aspx)
You must have a static IP address on Your home computer. Otherwise the connection can be problematic. The "static" IP can be achieved using dynamic DNS. One of the possible solutions is described here
If all of the above were successfully configured, then you simply can connect to your SQL server by IP address with supplying needed credentials (user name created in the (2), password, target database).
Hope that this was helpful.

Web-based, hosted admin tool for SQL Server database access [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I work extensively with MySQL and have no experience with SQL Server. But I have an upcoming project where the existing site's database is on SQL Server. I will be needing to make periodic glances at the existing database, to make SQL dumps most likely so I can write a migration script to the new site database in MySQL. The client will be regularly updating this existing database so just asking for a one-time dump will not help.
Ideally I am looking for a web-based (or desktop based) tool which will allow me to log in to the SQL Server database (I have remote access) and allow me to make a dump or perhaps browse the database structure. Something similar to phpMyAdmin would be nice.
Update: I should clarify that web-based tools which are ASP based are not ideal. As much as I'd like to learn more about ASP, I do not have the time to set up another environment just to run the tool. Something hosted by a 3rd party would do the trick.
Several options are available (probably quite a few more, too):
SQL Web Data Administrator
SQL Server Web Tools
Article on web based admin tools
CiberSQL Web Admin
myLittleAdmin (commercial)
SqlWebArchitect
MSSQL Web Admin (broken link)
DBHawk (commercial)
You can also connect via ODBC to your remote MSSQL server then use MSAccess or OpenOffice to connect, browse or backup.