Gracias
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
exec sp_configure 'allow updates', 1
reconfigure with override
go
exec sp_ms_upd_sysobj_category 1
go
checkpoint
go
CREATE PROC xp_GetNTGroups
@acctname sysname = null -- IN: NT login name
as
IF @acctname is NULL
SET @acctname = suser_sname()
select distinct nt.domain+N'\'+nt.name AS NTGroup
from OpenRowset(NetUserGetGroups, @acctname) AS NT
JOIN master.dbo.sysxlogins s
ON s.sid = NT.sid
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
EXEC xp_getntgroups
--
Fernando G. Guerrero
QA Group Ltd., UK
PASS Spanish Group
"Share what you know, learn what you don't"
"Maribel Oliver" <rod...@ayayai.com> wrote in message
news:OZH8$hukAHA.464@tkmsftngp02...
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
exec sp_configure 'allow updates', 1
reconfigure with override
go
exec sp_ms_upd_sysobj_category 1
go
checkpoint
go
CREATE PROC xp_GetNTGroupMembers
@acctname sysname --IN: NT group name
as
select Name
from OpenRowset(NetGroupGetMembers, @acctname) AS NT
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
-- Para probarla:
EXEC xp_getntgroupmembers 'BUILTIN\Administrators'
--
Fernando G. Guerrero
QA Group Ltd., UK
PASS Spanish Group
"Share what you know, learn what you don't"
"Maribel Oliver" <rod...@ayayai.com> wrote in message
news:OX4Fxy4kAHA.1932@tkmsftngp05...