Skip to content

NTSEQ:- A IT Infrastructure and Cyber Security Blogs

Author:

Hide all user databases in SQL SERVER

Hide all databases USE MASTER GO DENY VIEW ANY DATABASE TO PUBLIC GO  

Continue reading

How to disable and Enable sa login in SQL Server

–make sure you have a login that is part of the sysadmin role before doing this!!!! USE [master] GO ALTER

Continue reading

Enable Windows Authentication & Mixed Mode Authentication in SQL SERVER

 –Enable Windows Authentication (requires a restart of services) USE [master] GO EXEC xp_instance_regwrite N’HKEY_LOCAL_MACHINE’, N’SoftwareMicrosoftMSSQLServerMSSQLServer’, N’LoginMode’, REG_DWORD, 1 GO –Enable

Continue reading

How to Drop the BUILTINadministrators in SQL SERVER?

–Drop the BUILTINadministrators USE MASTER IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N’BUILTINAdministrators’) DROP LOGIN [BUILTINAdministrators] GO –Verfiy

Continue reading

How to get information about BUILTINadministrators in SQL SERVER ?

EXEC master..xp_logininfo @acctname = ‘BuiltinAdministrators’, @option = ‘members’

Continue reading

How to Get information of all SQL Logins and Windows users in SQL SERVER

SELECT name AS Login_Name,TYPE, type_desc AS Account_Type FROM sys.server_principals WHERE TYPE IN (‘U’, ‘S’, ‘G’) ORDER BY name, type_desc

Continue reading

How to view all users that have access to SQL Server

SELECT name, type_desc, is_disabled FROM sys.server_principals

Continue reading

List all access to a sql user or windows user/group in SQL SERVER

–List all access  to a sql user or windows user/group directly SELECT [UserName] = CASE princ.[type] WHEN ‘S’ THEN princ.[name]

Continue reading

Who are having Sysadmin role in SQL SERVER

we can find out the login names having sysadmin rights from below query EXEC sp_helpsrvrolemember ‘sysadmin’

Continue reading

List all access permission or provisioned to a SQL user or Windows user/group directly

SELECT         [UserType] = CASE princ.[type]                      

Continue reading

Posts pagination

«Previous Posts 1 … 29 30 31 32 33 34 Next Posts»
  • C Programming
  • C++
  • Cyber Security
  • Interview FAQ
  • Java
  • Linux
  • MySQL
  • Netseq.com
  • Oracle
  • PHP
  • Python
  • SQL
  • SQL Server -DBA
  • Active Directory Security: Strategies to Safeguard Your Organization
  • PowerShell scripts for Active Directory (AD)
  • Top 50 Essential Active Directory PowerShell Commands and Administrative Tools
  • Critical Windows Event ID’s to SOC Team Must Monitor
  • Top Cybersecurity Threats in 2025 and How to Protect Yourself
WordPress Theme: Wellington by ThemeZee.