October 23, 2014 at 8:37 am
So I have an AD account that is a member of an AD group that has sa on our SQL 2008 R2 server.
How can I set the ownership of the DBs on that server to that account, ideally using PoSh + smo (although ALTER AUTHORIZATION is not out of the question)?
Does it really require an individual SQL login for that AD account?
Because $DB.SetOwner("Domain\AD_Account") is throwing me an error.
Thanks,
P
October 23, 2014 at 10:30 am
What is the error?
Gaz
-- Stop your grinnin' and drop your linen...they're everywhere!!!
October 23, 2014 at 10:34 am
Exception calling "SetOwner" with "1" argument(s): "Set owner failed for Database DB"
+ $db.SetOwner("[Domain\User]")
October 23, 2014 at 11:09 am
The online help specifies that for Database.SetOwner the loginName is:
A String value that specifies the SQL Server logon that is the new database owner.
i.e. a SQL Server account.
Gaz
-- Stop your grinnin' and drop your linen...they're everywhere!!!
October 24, 2014 at 5:34 am
OK, but that account already owns quite a few DBs, while not having a "personal" login. So I wondered if there was a way.
Thanks Gary.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply