Grant All User to view Server State

nikeman77
Member Posts: 517
Hi All,
I need to transfer all users from LIVE to another Server.
Export part was done using query: exec sp_help_revlogin which will provide a lists of login id's and password. i copied this to a text file.
CREATE LOGIN [BruceLee] WITH PASSWORD = 0x01002A52EF6D9FBDB5DC11780391626B2DD9E3E2511F46138952 HASHED, SID = 0x0056703E08AE099D999453A4382428AA, CHECK_POLICY = ON, CHECK_EXPIRATION = OFF;
1.When I execute this query of create login it give me error:
Msg 15433, Level 16, State 1, Line 1
Supplied parameter sid is in use.
2. Also how or where can I get a script to grant all users that is created in the above lists to view State?
PS: I am a newbie in SQL
I need to transfer all users from LIVE to another Server.
Export part was done using query: exec sp_help_revlogin which will provide a lists of login id's and password. i copied this to a text file.
CREATE LOGIN [BruceLee] WITH PASSWORD = 0x01002A52EF6D9FBDB5DC11780391626B2DD9E3E2511F46138952 HASHED, SID = 0x0056703E08AE099D999453A4382428AA, CHECK_POLICY = ON, CHECK_EXPIRATION = OFF;
1.When I execute this query of create login it give me error:
Msg 15433, Level 16, State 1, Line 1
Supplied parameter sid is in use.
2. Also how or where can I get a script to grant all users that is created in the above lists to view State?
PS: I am a newbie in SQL
0
Comments
-
nikeman77 wrote:2. Also how or where can I get a script to grant all users that is created in the above lists to view State?
USE [master]
GO
GRANT VIEW SERVER STATE TO [public]
2
If you want go grant VIEW SERVER STATE permission ONLY to the users created by your script (and personally I can't see any good reason why not to grant VIEW SERVER STATE to public role) copy a list of users taken from Windows Login table to some Excel speadsheet and prepare a list of GRANT VIEW SERVER STATE TO [user 1], GRANT VIEW SERVER STATE TO [user 2] and so on statements. Copy and paste it into SSMS and you are done.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Slawek Guzek,
thanks for advising, I'll be granting ALL users with GRANT VIEW SERVER STATE.
is the syntax exactly >> USE [master] GO GRANT VIEW SERVER STATE TO [public]
by the way, how do I create user based on the users lists (text format) generated ?0 -
nikeman77 wrote:is the syntax exactly >> USE [master] GO GRANT VIEW SERVER STATE TO [public]nikeman77 wrote:by the way, how do I create user based on the users lists (text format) generated ?
It is enought if you create SQL Server LOGINs corresponding to users found in Database User and or Windows Login tables. NAV will create users in the database for you when you re-validate entries or synchronize security,
For LOGINS using database authentication (entries found in Database User table)CREATE LOGIN [BruceLee] WITH PASSWORD = 0x01002A52EF6D9FBDB5DC11780391626B2DD9E3E2511F46138952 HASHED
For LOGINS using Windows Authentication (entries found Windows Logins table)CREATE LOGIN [domain\BruceLee] FROM FROM WINDOWS
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Why don't you try it yourself ? Is it too hard to copy these 3 lines to SSMS and run them ? Harder than post here ?
PS: I click on Database Server> Query> Paste the code
USE [master]
GO
GRANT VIEW SERVER STATE TO [public]Create USERs or create LOGIN?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions