If you have a requirement to cleanup permissions of Ex-Employees or Deleted Users, then you can use this PowerShell Script.
*Please understand that this script was developed for a specific requirement and it may not work exactly same for your environment. So, use script at your own risk.
http://sharepoint-powershell.blogspot.com/p/start-variables-uri-httpwebapp.html
This PowerShell script uses an input file and the path/file name are hard-coded in the code. You may have to change certain other hard-coded values of File Paths, Input Filename, Account Name of the user who will be replacing the permission role of the deleted user.
The script, for each user, enumerates through each Site Collection, and if permission is found at different permissions level, (Owner/SiteCollectionAdmin/SecondaryUser/SiteUser) and if permission is found, then it first adds SubstituteUser we are supplying through the input parameters and then will delete user's permissions.
Every activity is logged into different log files of my interest. You can customize as per your requirement.
The input file for this PowerShell script file is ExEmployees.csv
Basically it contains, list of NT names under the column header NTName.
NTName
Domain\Vaddiv
Domain\NTName1
Domain\NTName2
*Please understand that this script was developed for a specific requirement and it may not work exactly same for your environment. So, use script at your own risk.
http://sharepoint-powershell.blogspot.com/p/start-variables-uri-httpwebapp.html
This PowerShell script uses an input file and the path/file name are hard-coded in the code. You may have to change certain other hard-coded values of File Paths, Input Filename, Account Name of the user who will be replacing the permission role of the deleted user.
The script, for each user, enumerates through each Site Collection, and if permission is found at different permissions level, (Owner/SiteCollectionAdmin/SecondaryUser/SiteUser) and if permission is found, then it first adds SubstituteUser we are supplying through the input parameters and then will delete user's permissions.
Every activity is logged into different log files of my interest. You can customize as per your requirement.
The input file for this PowerShell script file is ExEmployees.csv
Basically it contains, list of NT names under the column header NTName.
NTName
Domain\Vaddiv
Domain\NTName1
Domain\NTName2
No comments:
Post a Comment