Hi,
I’m looking for some way to recover a deleted user, operator site, actions and analysis.
This is what I have at the moment, but I would like to know if I’m missing something…
– 1. Find the UserID, SiteID and SiteTag
<
SELECT
u.Username, u.UserID, u.UserCreationTime, u.LastLoginTime, u.IsDeleted, u.MastheadUsername as OperatorSiteName, u.ApproverRoleID,
s.Name as SiteName, s.ID as SiteID, s.Tag as SiteTag, s.URL
FROM [BFEnterprise].[dbo].[USERINFO] U
JOIN [BFEnterprise].[dbo].[SITES] S
ON u.UserID=s.OpsiteUserID
WHERE u.username like '%[addusername]%'
AND u.IsDeleted = 0
order by u.LastLoginTime desc
/>
–2. Restore user and site
Update [BFEnterprise].[dbo].[USERINFO]
SET IsDeleted = 0
WHERE userID = [adduserID] ;
Update [BFEnterprise].[dbo].[SITES]
SET IsDeleted = 0
WHERE ID = [addSiteID]
–3. Restore Actions
UPDATE [BFEnterprise].[dbo].[ACTIONS]
SET isdeleted = 0
WHERE siteid= [addSiteID]
AND CreatorID = [adduserID]
UPDATE [BFEnterprise].[dbo].[ACTION_FLAGS]
SET IsDeleted = 0
WHERE IssuerID = [adduserID]
–4. Restore Analyses
UPDATE [BFEnterprise].[dbo].[CUSTOM_ANALYSES]
SET IsDeleted = 0
Where CreatorID = [adduserID]
– 5. Execute the following command via cmd to update the users/operator site
BESAdmin.exe /resignsecuritydata
–6. Verify if the operator site now exits:
D:\Program Files (x86)\BigFix Enterprise\BES Server\wwwrootbes\bfsites\ [addSite TagID]