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
  • 6
  • 990
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 64 persoane apreciaza acest articol)
Share
Tweet
Share

Despre Autor

Bogdan Dumitru

Solutii Asemanatoare

  • Listare cea mai recenta data de accesare a bazelor de date de pe MSSQL Server 1
  • Listare tabele si informatii despre compresie 3
  • Listare restaurari efectuate pe un server MSSQL 2
  • Listare backup-uri efectuate pe un server MSSQL 1
  • Listare date despre utilizarea bazei TempDB pe un server MSSQL 1
  • Gasire blocaje pe un server MSSQL Server 6

Leave A Comment? × Cancel Reply

30924

Soluții Disponibile

0 Articole

In ultima saptamana

Cele mai recente soluții

  • Cum selectezi si editezi text dintr-o imagine pe Windows 11
    • 36
    • 3 days ago
  • Microsoft January 2026 Windows Update: what you need to know
    • 51
    • 14/01/2026
  • Solutia Proxmox pentru business
    • 48
    • 14/01/2026
  • Cum configurati un server privat de chat vocal Mumble pe Windows 11?
    • 49
    • 14/01/2026
  • How to install Discord on Ubuntu 24.04
    • 51
    • 14/01/2026
© Askit.ro, 2014 - 2026. All rights reserved. Done by Class IT
Share
Tweet
Share