July 4, 2010 at 6:27 pm
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!!!!!!
July 4, 2010 at 7:18 pm
Please put your question in the post, not the subject. It cuts off and can't be read.
July 4, 2010 at 7:18 pm
Sorry, you also need to define what you mean by "check"? How does SQL Server know when the policy fails?
July 4, 2010 at 7:28 pm
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?
March 8, 2011 at 12:41 am
Has anyone has a solution to this question as i also need some tutorials on Policy based management on sql 2008.
please guys.
April 29, 2011 at 3:49 pm
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
August 28, 2012 at 2:47 am
Can you explain what you wrote in 'field' part? The part starting with ExecuteSql...
August 28, 2012 at 2:50 am
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.
August 28, 2012 at 11:56 am
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.
September 4, 2012 at 5:12 am
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
')
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply