Follow Us

Soluții pentru problemele tale IT

Home /Servicii baze de date/SQL Server/Login password policy
Home /Servicii baze de date /Login password policy

Login password policy

  • Data 16/11/2020
  • Autor Bogdan Dumitru
  • Categorie Servicii baze de date, SQL Server
  • 7
  • 967
Configurare noua (How To)

Situatie

Am creat o procedura ce este in special folositoare pentru rapoartele de audit. Procedura returneaza pe serverul sql pe care este rulata, pentru fiecare login in parte, politica de parole setata. Ea returneaza in plus si numarul de parole gresit introduse pt fiecare login, data ultimei introduceri gresite de parola, data cand a fost schimbata ultima data parola precum si data cand a fost contul blocat ultima oara.

Solutie

CREATE PROCEDURE BD_ListLoginsPasswordPolicy_prc

as

SELECT
name,
CASE CAST(is_policy_checked AS TINYINT) + CAST(is_expiration_checked AS TINYINT)
WHEN 0 THEN ‘Not Enforced’
WHEN 1 THEN ‘Password – No Expiration’
WHEN 2 THEN ‘Password With Expiration’
END AS PasswordEnforcement ,
LOGINPROPERTY(name,’BadPasswordCount’) AS BadPasswordCount,
LOGINPROPERTY(name,’BadPasswordTime’) AS BadPasswordTime,
LOGINPROPERTY(name,’DaysUntilExpiration’) AS DaysUntilExpiration,
default_database_name,
CASE WHEN LOGINPROPERTY(name,’IsExpired’) = 0 THEN ‘NO’ ELSE ‘YES’ END AS IsExpired,
CASE WHEN LOGINPROPERTY(name,’IsLocked’) = 0 THEN ‘NO’ ELSE ‘YES’ END AS IsLocked,
CASE WHEN LOGINPROPERTY(name,’IsMustChange’) = 0 THEN ‘NO’ ELSE ‘YES’ END AS IsMustChange,
LOGINPROPERTY(name,’LockoutTime’) AS LockoutTime,
LOGINPROPERTY(name,’PasswordLastSetTime’) AS PasswordLastSetTime
FROM sys.sql_logins
ORDER BY name

Tip solutie

Permanent
Etichetare: login password policy

Voteaza

Up Down
(35 din 63 persoane apreciaza acest articol)
Share
Tweet
Share

Despre Autor

Bogdan Dumitru

Solutii Asemanatoare

  • Listare date despre utilizarea bazei TempDB pe un server MSSQL -1
  • Gasire blocaje pe un server MSSQL Server 0
  • Listare joburi ce nu s-au executat cu succes pe un server MSSQL 6
  • Cele mai utilizate baze de pe un server MSSQL 3
  • Listare indexi nefolositi pe o baza de date MSSQL Server 7
  • Listare proceduri/queryuri ce folosesc un anumit index -10

Leave A Comment? × Cancel Reply

30524

Soluții Disponibile

0 Articole

In ultima saptamana

Cele mai recente soluții

  • How to fix Task Manager duplicate process bug on Windows 11 using ViveTool
    • 11
    • 2 days ago
  • How to fix Task Manager duplicate process bug on Windows 11 using the Registry
    • 11
    • 03/11/2025
  • How to fix Task Manager duplicate process bug on Windows 11 using the Command Prompt
    • 12
    • 03/11/2025
  • Ce este SSD TRIM, de ce este util și cum verifici dacă este activat?
    • 11
    • 03/11/2025
  • Cum blochezi reclamele din Windows 11
    • 13
    • 03/11/2025
© Askit.ro, 2014 - 2025. All rights reserved. Done by Class IT
Share
Tweet
Share