User does not have permission to access a database - sql

I'm trying to connect to a database using Windows Authentication. I believe that my current user does not have access to it.
How can I enable a user to login to SQL Server, and use the database?

You need to use the SQL Server Management Studio program to grant access for the user. You'll need to connect in with a login that has administration privileges for the database. If you have don't have those privileges you'll need to contact someone that does.
If you do have a login with those privileges:
open Management Studio
connect to the database server the database is on and look for the Security node in Object Explorer.
Expand the Security node and look for the name of the user in the list of Logins. The user's name should be the same as the user's Windows login if you are using Windows Authentication DOMAIN\Username format.
If the user is there, you will need to grant that user appropriate permissions to the database (read, execute SPs, etc.).
If the user isn't there you will need to add them.
Permission can also be added by group so you should check for groups that the user belongs to as well.

I had a scenario where I inherited a PC from another developer that left the organization. I couldn't access the default instance using Windows Authentication.
Here was the solution:
Open up SQL Server Configuration Manager
Click on "SQL Server Services"
Locate the Instance in the right pane and double-click for its properties
In the "Log On" tab, notice the "Log on as:" radio button option is set to "Built-in account".
Change the option to "This account" and add your Windows Authentication account with your domain and username and enter your password.
Click "Apply". Click "Yes" when it asks you if you want to restart the instance.
This will automatically add your Windows Authentication user account (Active Directory or local user) to the SQL Server instance. You will now be able to connect right away to the selected instance. As best practice, reset the settings back to the Built-in user account (most likely Network Service).
That's it!

Related

Microsoft SQL Server Management Studio dbcreator permission

RE: Permissions
Program - Microsoft SQL Server Management Studio v.17.1
When attempting to create a new database through Object Explorer, I get the following error:
Screenshot #1
To fix this, I did the following and got another error:
Screenshot #2
I have searched the internet and all posts and articles say that I need to log in as administrator or SA. I am logged in as administrator and still can not gain permission to create a database.
How do I assign permission to the SA account to create a new database?
Problem here is that you are logged in with the local Windows Administrator account. You have two logins for your SQL Server instance as can be seen in your Image #2. One is SA (SQL Admin). The other is BUILTIN\USERS. That is a default group which every user that logs into the machine will be a part of. But unless you give that group permissions, or create other logins (I recommend this), you will be very limited to what you can do.
As you have found, that user group cannot modify permissions, especially for the SA user. The SA user is special, you cannot modify SA permissions at all. This is why you are receiving errors (partly because you don't have permissions to change them with the user you are logged in as, and partly because SA permissions cannot be modified).
The resolution to your issue is to login with the SA account. You will need to choose "SQL Login" at the login screen, as opposed to Windows login. SSMS will prompt you for a password. This password was configured by the person who installed the SQL instance. If the person who installed SQL Server did not specify a password, it will be most likely be a blank password or "Password123".
Once you are logged into the SA account, you can create new SQL or Windows Authentication logins and and provision them permissions as needed.

SSRS2012 The permissions granted to user ' are insufficient for performing this operation

I already:
Disabled UAC
Run IE as Admin
Added my local Reporting Services server to the list of trusted sites
However, I still get this error:
SSRS2012 The permissions granted to user ' are insufficient for performing this operation
Although no need to enter username & password, still show the following
baby-pc/ReportServer - /
Microsoft SQL Server Reporting Services Version 11.0.2100.60
This is talking about Sql Server permissions. It has nothing to do with the local machine at all, and therefore nothing to do with UAC or Internet Explorer. Messing about with those will have no effect at all, as you've seen. You may has well put those things back how they where.
What you need to do instead is log in to Sql Server (using a tool like Sql Server Management Studio) with an account that has the ability to change permissions (such as the sa account, but hopefully you have a non-sa account that can do this as well) and grant your account the ability to use reporting services and select from any tables used in your reports.
It happened because you entered invalid credentials previously. Try to open the reporting service in FireFox and enter your valid credentials. If you have success with it, tune the group policy on the local machine for not storing user credentials. Do the next steps:
Computer Configuration->Administrative Templates->Windows Components->internet Explorer->Internet Control Panel->Security Page
Select the required zone
In this folder find the option "Logon options"
Set up that as "Enabled" and set up "Logon options" to "Authomatic logon with current username and password" or anything else.
Even I had faced this issue. But it was resolved when I added the particular user to Administrator group.

User '' does not have required permissions, SSRS 2008 on Windows 8

When you try to log into SSRS's root site at http:// (servername)/Reports it displays:
User '' does not have required permissions. Verify that sufficient permissions have been granted and Windows User Account Control (UAC) restrictions have been addressed.
This is on a 64 bit edition of Windows 8 Pro, running SQL Server 2008 enterprise. Everything should be using the local system as the account of execution.
I have tried changing the execution account as my user which is admin, I have added the site as the trusted site, I have UAC turned completely off, I have tried to hit the site with IE AS ADMIN, Chrome, and Firefox. Everything I try the site states back that I don't have the rights. I go into SQL Server and ensure my roles are everything for my user. It does not care. I am currently reinstalling the SSRS node of the SQL Server install but am curious if anyone else had this issue yet.
I am going to try to change my account to a 'local' account as I am thinking that may be an issue yet I don't understand why SQL Server can recognize my login integrated just fine. Honestly I never ran into this and am wondering if this is an issue just with Windows 8 accessing SQL Server 2008. I would upgrade but I have a full version of SQL Server 2008 and not of 2012 so I am hesitant to just upgrade unless Express 2012 will come with Business Intelligence Development Studio and SSRS site with tools.
EDIT: 3-8-2016:
No answer with: "Just turn on site settings" is valid as this is the first time installing as the admin of the server or machine locally and not able to access the landing page as that admin.
No answer with: "Just run IE as admin" will work last I tested that.
Answers with "Trusted SITE settings MAY WORK" on Windows 8 and higher as I had a similar problem to this with Windows 10 and on Windows 10 it did fix it. I am not going to rollback two OS versions to check at home though, sorry.
I don't get how this question can be existing for a while and people are now on a mission to claim it is duplicate when the very answer is different than the potential duplicate. That whole thread deals with someone able to get into the site with elevated permission and just not setting up roles and users after the fact. This is the main user of the machine not getting to the landing page as an admin to the site listed as the default landing. Not even the same ballpark. Getting into a page as an admin to let local users in versus the highest level God user not getting in is not the same.
Everything in this answer is true but don't reinstall all of SSRS thats nonsense...
Windows 8
Disable UAC
Enable Administrator Account (You can go to Control Panel > Computer Management > Users)
Restart PC
Run IE ad Administrator when prompted login with your local Administrator account you enabled.
You will need to adjust site settings security and folder settings security. Easy fast fix just add "Everyone" in both of those with full rights.
Problem solved!
I ran into the same issue myself but with Windows 7 and SQL Server 2008. I resolved the issue following the instructions from Suresh Kumar's blog post at http://skamie.wordpress.com/2010/06/24/ssrs-and-uac/
In a nutshell here are the steps you need to take to resolve this issue:
Start your browser using 'run as Administrator'.
Navigate to the report manager and under Site Settings -> Security assign your account or the local administrators group to the System Administration role.
Then navigate to the home folder and under the security settings assign your account or the local administrators group to the Browser, Conent Manager, My Reports, Publisher and Report Builder roles.
Now you should be able to run your browser as normal and access SSRS without any issues.
Okay this is really annoying what needed to be done but here goes.
From what I kept reading Windows 8 does not by default enable the default administrator account.
I usually don't use this account but in this case I was desperate as my account could not get in.
I understand ONCE YOU ARE IN you can set the site settings, that does not help if you cannot even see the site's main landing page to see that setting.
The steps I took to finally resolve were;
Uninstall SSRS Node COMPLETELY by going to control panel>SQL Server 2008>Remove>Check Reporting Services
Enable default admin account: command prompt>run as administrator>net user administrator p#ssw0rD, hit enter.
New line: net user administrator /active:yes
Reboot
Reinstall SSRS from disc with logging in as default administrator
Install SP3 as administrator
Go to IE.exe DIRECTLY in Windows 8: C:\Program Files\Internet Explorer\iexplore.exe>Run as administrator.
Go to http:// (servername)/Reports
You SHOULD now be able to finally see site settings. NOW YOU CAN FOLLOW everyone's directions of adding YOUR USER under site settings. Also go to folder permissions and add the user as a default here as well.
(optional) For safety I would hide the default admin account now by using step 2 but substitute /active:no in.
If your main admin can't open the door, no one is getting in. That was the main issue I was having. My default admin could not get in. Now everything is working fine and dandy like it should with deploying from BIDS as well.
I had the same problem on my Windows 8 system (32 bit) with SQL Server 2008R2. When I started IE using 'run as Administrator' it still asked for a user name and password and resulted in "user does not have permissions"-error when I entered my user name and password. This is what fixed it for me:
I disabled UAC in the registry (Set HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA to 0). I first set notify-level under Control Panel | System and Security | Change User Account Control to the lowest level but that didn't make any difference.
After reboot I started IE using 'run as Administrator'. Went to Report Manager | Site Settings | Security: added my account as System administrator.
Still in Report Manager I went to Home | Folder Settings and added my account with role Content Manager.
I enabled UAC through Control Panel | System and Security | Change User Account Control settings by setting it to default level again. (Reboot required)
When I run IE as Administrator now and supply my user name and password it does show the homepage of the report manager.
Run Internet Explorer as administrator (right click on the Taskbar icon)
Step 1 :: Add your local username to the Site Settings security roles page. (Security - System Administrator)
Step 2 :: Add your local username to the Folder Settings on the home page. (Select Content Manager)
Close the Administrator IE session.
Open IE in normal mode under your user account.
Windows 8.1
I resolved this with help from the answer by Austin McLaughlin posted earlier. In my case I had been logged in with a local account that had administrator privileges, but attempting to http://127.0.0.1/Reports (hearinafter referred to as "the Reporting Services Manager") produced the error reported by the OP.
The key for me was that the Administrator account was disabled by default in my Windows 8.1 laptop. Note that I did not originally have Windows 8.1 Pro, so there was no "Local Users and Groups" under "Computer Management". Thus, I had to purchase the Windows 8.1 Pro Pack online from MS for $100.
In Windows Explorer, right click on the Computer node and select "Manage".
Navigate to Local Users and Groups > Users
Right click on Administrator and select Properties
De-select "Account is disabled"
Restart PC
Log in to the PC as Administrator (I did not have to enter a password for the Administrator account on first login.)
From the desktop, run IE. No need to run as Administrator, of course, since you logged in as Administrator.
Navigate to the Reporting Services Manager.
At this point you should be logged in to the Report Administrator and on the Home screen. I had not been able to get this far before.
On the Home screen, click "New Role Assignment"
In "Group or user name", enter the local administrator account you use for development; i.e.: [yourmachine]\[username]
Select all the checkboxes (shortcut is to click the checkbox to the left of "Role") and click OK.
In the upper right hand side of the page, click Site Settings.
On the left side of the page, click Security.
Click "New Role Assignment"
In "Group or user name" enter the same account as in step 10
Check "System Administrator" checkbox and click OK
As a precaution, disable the Administrator account that you enabled in step 4.
Log out, then back in with your local account from step 10.
In IE, browse to the Reporting Services Manager. Note: It was not necessary for me to start IE as Administrator.
At this point you should be able to access Reporting Services Manager page, and configure reporting services further.
Change service account type as "Network Service" in service account tab then stop and start service and run IE as Administrator.
From Reporting Services Configuration Manager you can get to the node Report Manager Url. The URL works from this screen. Now you can use the Folder Settings to add yourself as a Content Manager, etc... Now the url will work for your user.
In IE, just add Add the reporting services website to "Local intranet" sites.
That's it.
Just open IE as Run As Administrator and just type URL as http://localhost/reports

SQL Reporting Services 2005 not Showing Contents or Properties

I installed and configured SQL Server 2005 with Reporting Services, Workgroup Edition on Windows 7. I have updated to Service Pack 4. The problem is that when I navigate to http://localhost/reports/Pages/Folder.aspx, Reporting Services don't show/display Contents or Properties menus, all I see is the SQL Server Reporting Services header with the Home/Help button.
EDIT: I figured it out. You need to create role assignments that explicitly grant you access together with full permissions. To do this, follow these steps:
Start Internet Explorer together with the Run as administrator option. To do this, click Start, click All Programs, right-click Internet Explorer, and then click Run as administrator.
Open Report Manager. By default, the Report Manager URL is http://ServerName/reports.
If you use SQL Server Express with Advanced Services SP2, the Report Manager URL is http://ServerName/reports$sqlexpress. If you use a named instance of Reporting Services, the Report Manager URL is http://ServerName/reports$InstanceName
In the Home dialog box, click Properties.
Click New Role Assignment.
Type a Windows user account name by using the following format:
Domain\User
Click to select the Content Manager check box.
Click OK.
In the Home dialog box, click Site Settings.
Click Configure site-wide security.
Click New Role Assignment.
Type a Windows user account by using the following format:
Domain\User
Click System Administrator.
Click OK.
Close Report Manager.
I figured it out. You need to create role assignments that explicitly grant you access together with full permissions. To do this, follow these steps: Start Internet Explorer together with the Run as administrator option. To do this, click Start, click All Programs, right-click Internet Explorer, and then click Run as administrator. Open Report Manager. By default, the Report Manager URL is http://ServerName/reports.
If you use SQL Server Express with Advanced Services SP2, the Report Manager URL is http://ServerName/reports$sqlexpress. If you use a named instance of Reporting Services, the Report Manager URL is http://ServerName/reports$InstanceName In the Home dialog box, click Properties. Click New Role Assignment. Type a Windows user account name by using the following format: Domain\User Click to select the Content Manager check box. Click OK. In the Home dialog box, click Site Settings. Click Configure site-wide security. Click New Role Assignment. Type a Windows user account by using the following format: Domain\User Click System Administrator. Click OK. Close Report Manager.

how to access vista system remotely using vb.net?

I tried to access xp to vista system manually, its working,but programatically how to do it ?
like,by selecting view workgroup computers in network tasks and click one computer in workgroup computers.it shows connect to "system name" window, contains username and password
if i enter username and password.the seleted computer will able to access in registry
otherwise i can't able to access that selected system.
how to do this manual process in vb.net coding? is it possible or not?
please help me
You can use OpenRemoteBaseKey to access the remote registry but before that you need to impersonate an account with the correct access rights using WindowsIdentity.Impersonate.
The following MSDN link contains a complete sample to login as a different user programmatically:
http://msdn.microsoft.com/en-us/library/system.security.principal.windowsimpersonationcontext.aspx