Tray896
asked on
PowerShell script to set a large number of SharePoint 2013 site collections to "No Access" lock status
I have several hundred sites on my SharePoint 2013 farm that I need to set to "No Access" by locking the site collection. What I would like to do, is use a PowerShell script to read the list of URL's from a text file, loop through each one, and lock the site collection. This is what I have so far, but need some assistance on getting it completed:
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$Sites = Get-Content -Path e:\scripts\SitesToLock.txt
ForEach ($site in $Sites)
{
Set-SPSite -Identity $site.Url -LockState "NoAccess" }
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER