sharepointmaintenance-mode

How can I create a 'maintenance mode' for SharePoint?


I need to disable access to a SharePoint application between 6 PM and 7 AM. SharePoint 2007 doesn't seem to have an out-of-the-box "maintenance mode," so I'm looking for a solution. Presently someone moves users out of a security group to limit access to the application, so in the very least, automating that process would work.

Is there a PowerShell script or SharePoint feature or something I can add to my server to enable a maintenance mode for an application? Perhaps sample code for an SPJobDefinition?


Solution

  • you could automate the removal of users in a bat file with the

    stsadm -o userrole -url <url> -userlogin <DOMAIN\name> -role <role name> [-add] [-delete]
    

    Check out this link for a way to enumerate sharepoint with Powershell:

    link