In this article, I’ll show you how to set Anonymous Access settings on site with PowerShell script. We have the following requirements for the script:
1. Allow users to input Site URL
2. Check to see if the site has Unique permissions or not
- If not, we will reset broken inheritance first and then set anonymous access on it
- If yes, we only set anonymous access on it
3. When setting anonymous access, we need to identify the following statuses:
- Enabled -lists and libraries
- On – Entire web site
- Disabled – Self-explanatory
How does it work?
Download AnonymousSite.ps1 file to your server
Input the URL site as pictured below and press Enter.
Go back to your site and check out the result.