我想运行一个报告,以确保每个用户的密码设置为每30天过期,但过期间隔似乎不会存储在syslogins中?
答案 0 :(得分: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)
答案 1 :(得分:0)
您可以使用sp_configure设置所有用户密码到期日期
sp_configure "systemwide password expiration", 30
go
会将所有用户密码设置为在30天后过期。不确定是否可以为报告读取此值。默认值为0.
答案 2 :(得分:0)
尝试
exec sp_displaylogin
获取以该用户身份登录的单个用户的设置权限。