Friday, February 24, 2012

Can a virtual server have local Windows users and groups?

Hi,
I have a scenario which works fine on a non-clustered SQL server, and I now
want to implement it on a clustered SQL server.
In a stand-alone, non-clustered environment:
- I have local Windows security groups on the machine; call the groups
MyGroup1, MyGroup2.
- I grant these groups login to the server, and access to the DB, as
follows: (later I add them to DB roles)
declare @.servername sysname
declare @.pos int
set @.servername = serverproperty('MachineName')
set @.pos = charindex(N'\', @.servername, 0)
if @.pos > 0
set @.servername = left(@.servername, @.pos-1)
use master
declare @.loginame sysname
set @.loginame = @.servername + '\MyGroup1'
if (not exists (select name from syslogins where name = @.loginame))
begin
exec sp_grantlogin @.loginame
end
exec sp_defaultdb @.loginame, MyDatabase
I'd like to do something similar on a clustered SQL server. But does a
cluster have a concept of local Windows groups, or must they be domain
groups?
How would I go about setting this up?
Thanks,
John.
I think I can answer this, since a cluster requires a domain account to
run - just make domain groups. Besides creating the local ones would be a
pain, think about failover.
Cheers,
Rod
MVP - Windows Server - Clustering
http://www.nw-america.com - Clustering
http://msmvps.com/clustering - Blog
"John [412075]" <John_dot_Knox_hyphen_Davies@.wonderware0com> wrote in
message news:OmdbtRLBFHA.3376@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I have a scenario which works fine on a non-clustered SQL server, and I
> now
> want to implement it on a clustered SQL server.
> In a stand-alone, non-clustered environment:
> - I have local Windows security groups on the machine; call the groups
> MyGroup1, MyGroup2.
> - I grant these groups login to the server, and access to the DB, as
> follows: (later I add them to DB roles)
> declare @.servername sysname
> declare @.pos int
> set @.servername = serverproperty('MachineName')
> set @.pos = charindex(N'\', @.servername, 0)
> if @.pos > 0
> set @.servername = left(@.servername, @.pos-1)
> use master
> declare @.loginame sysname
> set @.loginame = @.servername + '\MyGroup1'
> if (not exists (select name from syslogins where name = @.loginame))
> begin
> exec sp_grantlogin @.loginame
> end
> exec sp_defaultdb @.loginame, MyDatabase
>
> I'd like to do something similar on a clustered SQL server. But does a
> cluster have a concept of local Windows groups, or must they be domain
> groups?
> How would I go about setting this up?
> Thanks,
> John.
>

No comments:

Post a Comment