Forum Discussion
Find user who assigned a label
Hi,
I've got a file which is labelled with our "Internal" classification. We've had some issues with this file, and we need to know which user assigned the label to the file.
I use a script to search the audit logs for that information (this is the script: Office365itpros/AnalyzeSensitivityLabelUsage.PS1 at master · 12Knocksinna/Office365itpros · GitHub).
But I don't have any results from the last 365 days. So is there any way looking at the file or in any log to find out who assigned the label?
Thanks
Hi dmarquesgn,
As mentioned in the previous reply post, there is no way to find out who assigned the label to the file by looking at the file itself or in any log. The only way to find out is to search the audit logs. However, you can try the following:
- Check the file's version history to see if there is a previous version of the file that doesn't have the label. If there is, you can see who modified the file to add the label. To do this, follow the steps below:
- Open the file in SharePoint or OneDrive.
- Click the File tab.
- Click Info.
- Under Version history, click Version history.
- Click the version of the file that you want to review.
- Click Compare.
- Select the current version of the file from the left drop-down menu.
- Select the version of the file that you want to compare it to from the right drop-down menu.
- Click OK.
- Review the changes between the two versions of the file. If the label was added in one of the versions, you can see who made the change.
- Check the file's metadata to see if there is any information about the label, such as the date and time it was applied and the user who applied it. To do this, follow the steps below:
- Open the file in SharePoint or OneDrive.
- Click the File tab.
- Click Info.
- Under Properties, click Properties.
- Review the metadata for the file. If there is any information about the label, it will be listed here.
- If you are able to identify the date and time that the label was applied, you can search the audit logs for that specific time frame.
- If you know the department or team that the file belongs to, you can search the audit logs for that department or team.
Here is a PowerShell script that you can use to search the audit logs for information about sensitivity labels:
# Import the SharePoint Online Management Shell module. Import-Module -Name Microsoft.Online.SharePoint.PowerShell # Connect to SharePoint Online. Connect-SPOService -Url https://[your-tenant-name].sharepoint.com # Get a list of all sensitivity labels in the tenant. $sensitivityLabels = Get-SPOSensitivityLabel # Search the audit logs for all events related to sensitivity labels. $auditLogs = Search-SPOServiceAuditLog -StartTime [start-date] -EndTime [end-date] -EventType SensitivityLabel # Filter the audit logs to only include events that are related to the specific sensitivity label that you are interested in. $filteredAuditLogs = $auditLogs | Where-Object {$_.SensitivityLabel -eq "[sensitivity-label-name]"} # Write the audit logs to a file. $filteredAuditLogs | Out-GridView
You can modify the script to change the start and end dates of the search, as well as the name of the sensitivity label that you are interested in.
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic (LinkedIn)
- LeonPavesicSilver Contributor
Hi dmarquesgn,
As mentioned in the previous reply post, there is no way to find out who assigned the label to the file by looking at the file itself or in any log. The only way to find out is to search the audit logs. However, you can try the following:
- Check the file's version history to see if there is a previous version of the file that doesn't have the label. If there is, you can see who modified the file to add the label. To do this, follow the steps below:
- Open the file in SharePoint or OneDrive.
- Click the File tab.
- Click Info.
- Under Version history, click Version history.
- Click the version of the file that you want to review.
- Click Compare.
- Select the current version of the file from the left drop-down menu.
- Select the version of the file that you want to compare it to from the right drop-down menu.
- Click OK.
- Review the changes between the two versions of the file. If the label was added in one of the versions, you can see who made the change.
- Check the file's metadata to see if there is any information about the label, such as the date and time it was applied and the user who applied it. To do this, follow the steps below:
- Open the file in SharePoint or OneDrive.
- Click the File tab.
- Click Info.
- Under Properties, click Properties.
- Review the metadata for the file. If there is any information about the label, it will be listed here.
- If you are able to identify the date and time that the label was applied, you can search the audit logs for that specific time frame.
- If you know the department or team that the file belongs to, you can search the audit logs for that department or team.
Here is a PowerShell script that you can use to search the audit logs for information about sensitivity labels:
# Import the SharePoint Online Management Shell module. Import-Module -Name Microsoft.Online.SharePoint.PowerShell # Connect to SharePoint Online. Connect-SPOService -Url https://[your-tenant-name].sharepoint.com # Get a list of all sensitivity labels in the tenant. $sensitivityLabels = Get-SPOSensitivityLabel # Search the audit logs for all events related to sensitivity labels. $auditLogs = Search-SPOServiceAuditLog -StartTime [start-date] -EndTime [end-date] -EventType SensitivityLabel # Filter the audit logs to only include events that are related to the specific sensitivity label that you are interested in. $filteredAuditLogs = $auditLogs | Where-Object {$_.SensitivityLabel -eq "[sensitivity-label-name]"} # Write the audit logs to a file. $filteredAuditLogs | Out-GridView
You can modify the script to change the start and end dates of the search, as well as the name of the sensitivity label that you are interested in.
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic (LinkedIn)
- dmarquesgnIron ContributorThanks for the tips. Some of those I already used, but will the first one, looking the version history of the file.