0

我想运行一个报告以确保每个用户的密码设置为每 30 天过期一次,但过期间隔似乎没有存储在 syslogins 中?

4

3 回答 3

2

您可以使用以下过程获取报告:

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

检查那些处理您要查找的记录的系统过程(存储在 sybsystemprocs 数据库中)的源代码总是一个好主意(在这种情况下是 sp_addlogin、sp_modifylogin)

于 2010-01-15T12:27:12.510 回答
0

您可以使用 sp_configure 设置所有用户的密码到期日期

sp_configure "systemwide password expiration", 30
go

将所有用户的密码设置为 30 天后过期。不确定是否可以为报告读取此值。默认值为 0。

于 2009-07-22T08:22:46.607 回答
0

尝试

执行 sp_displaylogin

获取以该用户身份登录的单个用户的设置权限。

于 2009-08-03T20:05:52.437 回答