Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, June 25, 2014 6:43 AM
Hi Guys,
Is there way to recover/restore deleted user in SharePoint site ?
Scenario: Have deleted users (say 100 user) form custom permission group and now i want to roll back my action.
Any Suggestions...
All replies (6)
Wednesday, June 25, 2014 10:10 AM ✅Answered
You might be able to guess them from users that are present in the user information table but that's tricky and error prone.
If you've got a backup of the site collection before the deletion then that's much easier as you can simply restore that into your test environment and compare/contrast.
Thursday, June 26, 2014 9:15 AM ✅Answered
You can restore your contentdatabase in your test/dev env.
Then start a powershell windows and run the following script:
function Get-SPPermissionsReport($web, $recursive)
{
$web | Get-SPUser | % { New-Object PSObject -Property @{
UserLogin = $_.UserLogin
'Roles given explicitly' = $_.Roles
'Roles given via groups' = $_.Groups | %{$_.Roles}
Groups = $_.Groups
Url = $web.Url
}
}
if($recursive) { $web.Webs | % { Get-SPPermissionsReport $_ $recursive } }
}
$web = Get-SPWeb https://sharepoint.com/web
Get-SPPermissionsReport $web $true | Sort-Object UserLogin | Out-GridView
Make sure you'd change the $web variable to your site.
You will get an output with all permissions for that site.
Source: http://vlasenko.org/2014/05/07/sharepoint-2013-powershell-how-to-get-user-permissions-report/
Wednesday, June 25, 2014 6:45 AM
Short of a restore I can't think of a way you could really roll that back. I'd suggest restoring the DB to a test environment then resetting the perms with something to compare to. If you don't have a test environment you could restore the db with a new name and attach it to a new web app in your production environment.
You should be able to find the information in the content database (the UserInfo table), I'm not sure wether you can get it from the object model though.
Remember Microsoft does not recommend directly querying the database though...
If this helped you resolve your issue, please mark it Answered
Wednesday, June 25, 2014 9:48 AM
Thanks Inderjeet for quick reply..
My concern is, If i restore Content DB to a test environment than it will reflects the current conditions. In that case how can we compare permissions with production environment.
Thursday, June 26, 2014 4:41 AM
You will have to manually compare it.
If this helped you resolve your issue, please mark it Answered
Thursday, June 26, 2014 5:38 AM
You will find the answer in below link.
If this helped you resolve your issue, please mark it Answered