restrict a specific login for a specific amount of time?

  • Is there a way to restrict a specific login for a specific amount of time from connecting to a user db?

    Thank you

  • There are a few ways to do that.

    1 would be a server logon trigger.

    Another (better imho) method is to use an AD account. Then place login restrictions at the domain level for the account (http://technet.microsoft.com/en-us/library/cc781861(v=ws.10).aspx).

    Another method would be via firewall rules (do you have your databases segmented from the rest of the network via firewall??).

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I think Jason's approach is better, but you could just disable the login from a SQL Agent job and then have another at the scheduled interval to disable the login. Not as good or as sophisticated as Jason's, but functional.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (2/17/2014)


    I think Jason's approach is better, but you could just disable the login from a SQL Agent job and then have another at the scheduled interval to disable the login. Not as good or as sophisticated as Jason's, but functional.

    Hadn't thought of that approach but that is perfectly viable too.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • N/A.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Thanks for all the replies. Disabling the account is definitely simple and perfect for my scenario. Thanks again.

  • paulaalkz 9229 (2/17/2014)


    Thanks for all the replies. Disabling the account is definitely simple and perfect for my scenario. Thanks again.

    Good to hear and glad you have a solution.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

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

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