We having a requirement to know the last modified date for a
web application, for the web application having so many site collection and sub
sites under the web application doing it manually it will take lot of time, so we prepared a script to know the last modified date under the
web application having the list of site collection and its sub sites with URL,
Title and site last modified date.
Get-SPWebApplication – Is used to identify the web
application URL.
Get-SPSite – Is used
to get the site collections.
Get-SPWeb – Is used to get the sub sites.
Run the below Power Shell to get all sites last modified information
form a particular web application command.
List of sites under Web Application last modified date.
Get-SPWebApplication http://dotnetsharepoint/ | Get-SPSite
-limit all | Get-SPWeb -limit all | select url,Lastitemmodifieddate |
sort-Object -Property LastItemModifiedDate > lastmodifiedinformation.txt
Once the script completed, we can verify the list on sites information in the text file.
In the same way if we want to get the last modified date
only for a particular site collection and its sub sites run the below script.
List of sites under Site Collection last modified date.
Get-SPSite http://dotnetsharepoint/sites/SP/ | Get-SPWeb
-limit all | select url,title,Lastitemmodifieddate | sort-Object -Property
LastItemModifiedDate >
lastmodifiedsitecollectioninfo.txt