在Sybase ASE 12.5个人密码过期间隔报告
-
18-09-2019 - |
题
我想运行一个报告,以确保所有用户的密码设置为每30天到期,但到期时间间隔似乎并没有被存储在syslogins?
解决方案
您可以用以下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
它总是要检查这些系统程序(存储在sybsystemprocs数据库),它与你正在寻找记录操作的源代码是一个好主意(在这种情况下,sp_addlogin的,sp_modifylogin)
其他提示
可以使用sp_configure来设置所有用户密码过期日期
sp_configure "systemwide password expiration", 30
go
将设置所有用户的密码在30天后到期。不知道这个值可以被读取的报告虽然。缺省值是0。
试
EXEC的sp_displaylogin
以获取设置的烫发为单个用户,登录的该用户。
不隶属于 StackOverflow