Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to create a policy that will periodically check the membership of sysadmin?


How to create a policy that will periodically check the membership of sysadmin?

Author
Message
KoldCoffee
KoldCoffee
SSC Eights!
SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)

Group: General Forum Members
Points: 961 Visits: 1905
Specifically, I need to know how to set up the condition. In other words, which facet and properties do I use to set up such a policy? Thank you!!!!!!
Steve Jones
Steve Jones
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: Administrators
Points: 40450 Visits: 18846
Please put your question in the post, not the subject. It cuts off and can't be read.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Steve Jones
Steve Jones
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: Administrators
Points: 40450 Visits: 18846
Sorry, you also need to define what you mean by "check"? How does SQL Server know when the policy fails?

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
KoldCoffee
KoldCoffee
SSC Eights!
SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)SSC Eights! (961 reputation)

Group: General Forum Members
Points: 961 Visits: 1905
I am going straight out of the MS SQL Server 2008 Training Kit, chapter review for Policy Based Management. Suggested Practice:

"Configure policies to checkthe membership of the sysadmin and db_owner roles".

In this context does this make more sense?
FTdenali
FTdenali
SSC Veteran
SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)

Group: General Forum Members
Points: 297 Visits: 572
Has anyone has a solution to this question as i also need some tutorials on Policy based management on sql 2008.
please guys.
Jon.Morisi
Jon.Morisi
Say Hey Kid
Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)

Group: General Forum Members
Points: 675 Visits: 1142
similar here
http://www.sqlservercentral.com/Forums/Topic1100990-1550-1.aspx?Update=1

I blogged about what I did to solve the problem here
http://jonmorisissqlblog.blogspot.com/2011/04/configure-policy-to-checks-that.html
princessthedba
princessthedba
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 32
Can you explain what you wrote in 'field' part? The part starting with ExecuteSql...
princessthedba
princessthedba
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 32
and I think, these code returns all sysadmin groups. I also need to get some of the sysadmin groups. For example I want to check if one desired group is sysadmin or not.
Jon.Morisi
Jon.Morisi
Say Hey Kid
Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)Say Hey Kid (675 reputation)

Group: General Forum Members
Points: 675 Visits: 1142
It's a SQL statement in the field textbox, Google ExecuteSQL. The select statement is:
SELECT serverroles.name
FROM sys.server_principals AS serverroles
JOIN sys.server_role_members serverrolemembers
ON serverrolemembers.role_principal_id = serverroles.principal_id
JOIN sys.server_principals serverrolemember
ON serverrolemembers.member_principal_id =
serverrolemember.principal_id
WHERE serverrolemember.name = 'BUILTIN\Administrators'

You can change the where clause if your interested in more than just the 'BUILTIN\Administrators' group.
princessthedba
princessthedba
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 32
Now I have another question. I want to check if default port is 1433 or not. If so, when I evaluate the condition I want to see "x" in target details part.. However, I could not create condition, it gives an error "make sure string constants are enclosed in single quotes and facet properties are prefixed with "@" sign." and I can not click "ok".

How do you think I can solve this problem?

And here it is the script I've been tring to create condition.

ExecuteSql('Numeric','declare @Server as varchar(128)
declare @KeyToInterogate as varchar(200)
declare @Version as varchar (512)
declare @PortNumber as varchar(8)
set @Server = @@ServerName
set @Version = left(@@Version, 38)
set @KeyToInterogate = 'SOFTWARE\MICROSOFT\MSSQLSERVER\MSSQLSERVER\SUPERSOCKETNETLIB\TCP'
if charindex('\',@@ServerName) > 0
begin
set @KeyToInterogate = 'SOFTWARE\Microsoft\Microsoft SQL Server\'
set @KeyToInterogate = @KeyToInterogate + substring(@@ServerName,charindex('\',@@ServerName) + 1,len(@@ServerName) - charindex('\',@@ServerName))
set @KeyToInterogate = @KeyToInterogate + '\MSSQLServer\SuperSocketNetLib\Tcp'
end
exec xp_regread
@rootkey = 'HKEY_LOCAL_MACHINE',
@key = @KeyToInterogate,
@value_name = 'TcpPort',
@value = @PortNumber output
select @PortNumber
')
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search