I want to write one script in STSADM which checks SharePoint 2007 site collection lock status and if any site status is locked/Read-Only/Adding Content Prevented/No Access then the script will Unlock that site.
Following command to check site status: stsadm -o getsitelock -URL Siteurl
Following command for unlock site: stsadm -o setsitelock SiteURL -lock none
I have a list of the site collection in the text file.
Now I need help how to write these in a script and schedule them via Task Scheduler job. In addition, I want to add email sending functionality in the same script if any site gets locked.