First, you must install the PowerShell module, PnP.Powershell using the following command from an administrative PowerShell prompt:
Install-Module PnP.PowerShell -RequiredVersion 1.12.0
- Open PowerShell ISE and load/run the MissingMetadata.ps1 file.
- From the ISE command prompt, execute Get-MissingMetadata, supplying the site URL and the number of days of lookback:
Get-MissingMetadata -Site yourtenant.sharepoint.com/sites/sitename -Days 180
- The example above will iterate through all libraries found in sitename for items created in the past 180 days. An output sitename.csv file will be created with your results.
- The output file includes the following information about items missing mandatory metadata: "FileName","CreatedBy","MissingMetadata","FileLocation"
- FileName is the title of the item
- CreatedBy is the uploader or creator's name
- MissingMetadata is the name of the column(s) missing mandatory metadata
- FileLocation is the library where the item is stored
- When the script launches, you will be prompted to sign in to your SharePoint Online environment. These credentials are used to access the specified site.