有关 Sybase ASE 12.5 中各个密码过期间隔的报告

发布于 2024-07-27 02:13:16 字数 62 浏览 4 评论 0原文

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

I want to run a report to make sure the password of every user is set to expire every 30 days, but the expiration interval doesn't seem to be stored in syslogins?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦里人 2024-08-03 02:13:16

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

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)

you can get report with following 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

it is always a good idea to check source code of those system procedures (stored in sybsystemprocs database) which manipulate with records you are looking for (in this case it is sp_addlogin, sp_modifylogin)

忆沫 2024-08-03 02:13:16

您可以使用 sp_configure 设置所有用户密码过期日期,

sp_configure "systemwide password expiration", 30
go

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

You can use sp_configure to set all users password expiration date

sp_configure "systemwide password expiration", 30
go

will set all users passwords to expire after 30 days. Not sure if this value can be read for a report though. The default is 0.

傾旎 2024-08-03 02:13:16

尝试

exec sp_displaylogin

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

try

exec sp_displaylogin

to get the perms for the settings for an individual user, logged in as that user.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文