Domanda

Voglio correre un report per assicurarsi che la password di ogni utente è impostato per scadere ogni 30 giorni, ma l'intervallo di scadenza non sembra essere immagazzinato in syslogins?

È stato utile?

Soluzione

è possibile ottenere report con seguente proc:

use sybsystemprocs
go
----------------------------------------------------------------------------
print 'sp__helpexpire'
----------------------------------------------------------------------------
if exists (select 1 from sysobjects where  type = "P" and  name = "sp__helpexpire")
        drop proc sp__helpexpire
go
create procedure sp__helpexpire
as
begin
  set nocount on
  declare @swexpire int
  select @swexpire=value from master.dbo.sysconfigures
    where name = 'systemwide password expiration'
  print "Serverwide password expire: %1!" ,@swexpire
  print ""
  print "Logins:"
  print "=============================================================="
  select l.name login , case a.int_value
      when null then @swexpire
      else a.int_value end "expire in days"
    from master.dbo.syslogins l , master.dbo.sysattributes a
    where l.suid *= a.object
      and a.object_type='PS'
      and a.attribute=0
      and object_cinfo='login'
  print ""
  print "Roles:"
  print "=============================================================="
  select r.name "role name", case a.int_value
      when null then @swexpire
      else a.int_value end "expire in days"
    from master.dbo.syssrvroles r , master.dbo.sysattributes a
    where r.srid *= a.object
      and a.object_type='PS'
      and a.attribute=0
      and object_cinfo='role'
end
go

è sempre una buona idea controllare il codice sorgente di quelle procedure di sistema (memorizzati nella banca dati sybsystemprocs) che manipolano con i record che state cercando (in questo caso è sp_addlogin, sp_modifylogin)

Altri suggerimenti

È possibile utilizzare sp_configure per impostare tutte le password degli utenti data di scadenza

sp_configure "systemwide password expiration", 30
go

imposterà tutte le password degli utenti per scadere dopo 30 giorni. Non so se questo valore può essere letto per un report però. Il valore di default è 0.

try

exec sp_displaylogin

per ottenere i permanenti per le impostazioni per un singolo utente, connessi come tale utente.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top