Script to chack BUILTIN\Administrator is enable or disable

  • hi,

    i am using sql server 2000 and 2005 , now a days we are facing audit

    for that i need to check every user rights , also i am using builtin\administrator account.

    i need a script throuh this i could find the status either builtin\administrator is enable or disable.

    if any one have knowledge kindly help me out .

    regards

    Shah

  • We use this one at sql2000.

    Select @@servername as Servername, getdate() as RunDate

    /*

    * Show members of serverrole sysadmind

    */

    exec sp_helpsrvrolemember @srvrolename = 'sysadmin' -- =SA

    go

    /*

    * show members of the hosting servers builtin\administrators windows group.

    * (will only give results if builtin\administrators is activated for SQLServer

    */

    EXEC master..xp_logininfo @acctname = 'builtin\administrators',@option = 'members'

    go

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • The best practice is to create a Windows group to hold all the DBA accounts. Grant this group login rights to SQL Server and add it to the Sysadmin role.

    Then delete the BUILTIN\Administrators login.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • For SQL2008 also have a look at Brians overview at http://www.mssqltips.com/tip.asp?tip=1714

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • hi all,

    one more question.

    when we create a windows group what all right apart those which the dba will give at sql server should be given ?

    thanks.

  • It is a good idea to give the DBA group full control rights on all folders containing database files, database backups, SQL Server binaries, etc.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply