How to get the modified by name and modified date of all the sites present in the tenant

Ravitheja Maddilli 0 Reputation points
2023-05-18T06:47:50.5266667+00:00

How to get the modified by name and modified date of all the sites present in the tenant by using power shell or on gui

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. DorisLee-9118 0 Reputation points
    2023-05-18T07:20:51.1533333+00:00

    To get the modified by name and modified date of all the sites present in the tenant, you can use PowerShell.

    Here are the steps for each method:

    Using PowerShell:

      1. Open PowerShell with administrative privileges.
    1. Connect to your SharePoint Online environment using the following command

    Connect-SPOService -Url https://yourdomain-admin.sharepoint.com

    Replace "yourdomain" with your SharePoint domain.
    
    1. Run the following command to retrieve all site collections:

    Get-SPOSite -Limit All

    This command will retrieve information about all site collections in the SharePoint Online tenant.

    1. To display the modified by name and modified date for each site collection, you can loop through the results and extract the desired properties. Here's an example:
    $sites = Get-SPOSite -Limit All
    foreach ($site in $sites) {
        Write-Host "Site URL: $($site.Url)"
        Write-Host "Modified By: $($site.LastContentModifiedDateBy.Name)"
        Write-Host "Modified Date: $($site.LastContentModifiedDate)"
        Write-Host "-----------------------------"
    }
    
    
    0 comments No comments

  2. Ling Zhou_MSFT 23,675 Reputation points Microsoft External Staff
    2023-05-19T10:45:04.17+00:00

    Hi@Ravitheja Maddilli,

    For your question, you may want to know when the site was modified and who modified it. In SharePoint Online, you can check audit logs reports to see who has done what to the site, such as creating lists, modifying lists, adding site permissions, etc.

    Open Microsoft 365 admin center->Security->Audit.

    Here In my test, I searched for sites that deleted or modified list items between May 1 and May 19.

    In the table below will appear the time when the item was deleted or uploaded, the user, the type of interaction (delete item or upload item) and the link to the item.

    User's image

    Change

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.