Identify/expire Pages that have not been accessed for certain time

Hi,
I would like to create a publishing portal. Many users are able to create pages. I have the requirement that if a page does not get accessed for a certain time-period - it should be flagged for deletion and the creator should be notified by email.
Expiration policies depend on creation/modification date. Does this work for the last-accessed time (whereever I get this information from) aswell?
Sven 

Use below powershell
$outputPath = Read-Host “Outputpath (e.g. C:\output\UnusedSites.txt)”
$lastDate=Read-Host “Last Accessed Date (in format mm/dd/yyyy)”
$gc = Start-SPAssignment
$site=$gc | get-spsite -Identity https://sitecollectionUrl
foreach($web in $site.AllWebs)
if ($web.LastItemModifiedDate -lt $lastDate)
Write-Host -f Red “Site is old…” + $Web.Title
Add-Content -Path $outputPath -Value “$($web.Title),$($web.ServerRelativeUrl),
$($web.LastItemModifiedDate),$($web.Author)”
else
Write-Host -f Green “Site: [" + $web.Title + "] Last Modified Date: ” + $web.LastItemModifiedDate
Stop-SPAssignment $gc
Or
plan to use this tool
http://www.harepoint.com/Products/HarePointAnalyticsForSharepoint/FindOutdatedContentInSharePoint.aspx

Similar Messages

  • List AD accounts that have not been used for months?

    Hello,
    I use oldcmp.exe to show me what computers have not been used for months and I can disable them, but I wish to do the same for users Active Directory accounts, is this possible?
    We use AD 2003
    Thanks

    sorry for slightly belated reply. I've used another version of this script that doesn't have the GUI interface on it, this will make it easier for you to run from a scheduled task.
    copy the code and make the relevant changes to the top section of the script as the comments explain. This will send and email with a link to the report generated.
    #Script designed to search AD for inactive user accounts, mark them as inactive and move them to a specific OU then disable them
    #Script can be run in the following formats
    # 1. Report only
    # 2. Report and move account
    # 3. Report, move and disable
    #Uses quest powershell tools which can be downloaded from http://www.quest.com/powershell/activeroles-server.aspx
    #Version 2.0
    #Added email functionality
    #Denis Cooper
    #Setup script Variables
    #Change the setting from True to false to alter the way the script runs (only one option can be true)
    $ReportOnly = "True" #Generates a CSV file showing all inactive user accounts
    $ReportandMove = "False" #Generates a CSV report, moves the users to a specific OU
    $ReportMoveDisable = "False" #Generates a CSV report, moves the users to specific OU, and sets the description
    #Set the period of inactivity in days
    $InactiveFor = "90"
    #Specify the OU to search for inactive users - us AD CN if searching enire AD
    $SourceOU = "OU=Users,DC=MyDomain,DC=Int"
    #Specify the destination OU to move inactive users to is using report and move or report move disable script options
    $DestinationOU = "OU=Inactive Users,DC=MyDomain,DC=Int"
    #Don't mark anyone with the the specified prefix in the description field to inactive - DND stands for Do Not Disable and is specified
    #in the users account description field for accounts which may not be used to login so will show as inactive but that you don't want to disable
    #must leave the * after the word for wildcard matching
    $DescriptionPrefix = "DND*"
    #Specify the description to set in the computer account on ReportMoveDisable option
    $Description = "Account disabled due to inactivity on $Today"
    #Specify the path to create the csv file (make sure the folder exists)
    $ReportFile = "\\server\share\InactiveUsersReport.csv"
    #Get todays date and store it in the $today variable
    $Today = Get-Date
    #Email Settings
    $SMTPServer = "smtp-server-name" #replace this with your internal smtp server
    $FromAddress = "[email protected]" #replace this with your from address
    $ToAddress = "[email protected]" #replace this with your TO address
    $CCAddress = "[email protected]" #replace this with your TO address
    $Subject = "This is your subject line" #replace this with the subject line for the email
    $MessageContent = "
    Hello,
    Please find a link to the latest report containing users that have been inactive for $inactivefor days
    $ReportFile
    Please take the appropriate action.
    Thanks you,
    IT
    #NO CHANGES BELOW THIS LINE
    Function SendEmail {
    $messageParameters = @{
    Subject = $subject
    Body = $messagecontent
    From = $fromaddress
    TO = $ToAddress
    CC = $CCAddress
    SmtpServer = $SMTPServer
    Send-MailMessage @messageParameters
    #Generates a report showing inactive users
    Function ReportOnly {
    $inactiveUsers | Export-Csv $ReportFile
    $count = $inactiveUsers.Count
    Write-Host -ForegroundColor White "$count inactive users were found and are being processed"
    SendEmail
    Invoke-Item $ReportFile
    #Generates report and moves accounts to desitnation OU
    Function ReportandMove {
    $inactiveUsers | Export-Csv $ReportFile
    $count = $inactiveUsers.Count
    Write-Host -ForegroundColor White "$count inactive users were found and are being processed"
    Invoke-Item $ReportFile
    $inactiveUsers | foreach {
    Move-QADObject $_ -NewParentContainer $DestinationOU
    #Generates report, moves accounts to destination OU, disables the account and sets the description
    Function ReportMoveDisable {
    $inactiveUsers | Export-Csv $ReportFile
    $count = $inactiveUsers.Count
    Write-Host -ForegroundColor White "$count inactive users were found and are being processed"
    Invoke-Item $ReportFile
    $inactiveUsers | foreach {
    Disable-QADUser $_
    Set-QADUser $_ -Description $Description
    Move-QADObject $_ -NewParentContainer $DestinationOU
    #Runs the script
    #Finds all inactive user accounts which are in an enabled state and store them in the variable $inactiveusers
    $inactiveUsers = Get-QADUser -SizeLimit 0 -SearchRoot $sourceOu -NotLoggedOnFor $InactiveFor -Enabled | Where-Object {$_.description -notlike $DescriptionPrefix}
    #Checks which script to run
    If (($ReportONly -eq "True") -and ($ReportandMove -eq "True" -or $ReportMoveDisable -eq "True")) {
    Write-Host -ForegroundColor RED "Only one run condition is allowed, please set only one run value to True and the others to false"
    Break
    If ($ReportONly -ne "True" -and $ReportandMove -ne "True" -and $ReportMoveDisable -ne "True") {
    Write-Host -ForegroundColor RED "No valid run condition was specified, please set only one run value to True and the others to false"
    Break
    If ($ReportONly -eq "True") {
    Write-Host -Foregroundcolor Green "Script running in report only mode."
    Write-Host -Foregroundcolor Green "Checking for accounts inactive for $inactivefor days in the OU $SourceOU"
    Write-Host -Foregroundcolor Green "The report will open automatically once complete, or you can find it here $ReportFile"
    ReportOnly
    If ($ReportandMove -eq "True") {
    Write-Host -Foregroundcolor Green "Script running in report and move mode."
    Write-Host -Foregroundcolor Green "Checking for accounts inactive for $inactivefor days in the OU $SourceOU"
    Write-Host -Foregroundcolor Green "The report will open automatically once complete, or you can find it here $ReportFile"
    Write-Host -ForegroundColor Green "Any inactive accounts will be moved to this OU $destinationOU"
    ReportAndMove
    If ($ReportMoveDisable -eq "True") {
    Write-Host -Foregroundcolor Green "Script running in report, move and disable mode."
    Write-Host -Foregroundcolor Green "Checking for accounts inactive for $inactivefor days in the OU $SourceOU"
    Write-Host -Foregroundcolor Green "The report will open automatically once complete, or you can find it here $ReportFile"
    Write-Host -ForegroundColor Green "Any inactive accounts will be moved to this OU $destinationOU and disabled and their description updated"
    ReportMoveDisable
    This link should help you create a scheduled task to run the script
    http://dmitrysotnikov.wordpress.com/2011/02/03/how-to-schedule-a-powershell-script/
    Regards,
    Denis Cooper
    MCITP EA - MCT
    Help keep the forums tidy, if this has helped please mark it as an answer
    My Blog
    LinkedIn:

  • I have a D7160 that have not been using for awhile. Get Error message: Oxc18a0206

    I have replaced the ink cartridges and tried all of the online troubleshooting ideas that I have found such as power off/power on. How do I get to the PC board to check the cmos battery? Any other ideas?

    TLDR
    But I did skim over some of it, and I see a big mistake repeated several times:
    "&" is the bitwise AND operator.
    "&&" is the logical AND operator.
    You've confused them, but you're using them in such a context that it's not a syntax error, so you're probably getting unexpected results. When used with booleans, it will probably work okay, although the operators will not be evaluated conditionally. But when used near ints, you've got a problem:
    Int examples:
    if (targetList.size() != 0 & inRangeList.size() != 0){
    if (actor.getX() == actorList.get(inRangeList.get(currentClosest)).getX() & actor.getY() == actorList.get(inRangeList.get(currentClosest)).getY() ){
    for (int i = 0;
                    i < inRangeList.size() &inRangeList.size() != 0;
                i++){
    if (actor.getX() == d.getWidth() & actor.getY() == d.getHeight()){
    Boolean examples:
    if (brainState.getFoodLocationFound() & actorFound){
    else if (brainState.getNestLocationFound() & actorFound){           
    else if(brainState.getFoodLocationFound() & !actorFound){Also, avoid declaring variables named "l".
    Some of those while() loops would be better rewritten as for() loops so that the loop variable will be limited in scope to the loop.

  • View all files that have not been opened for a while?

    I'm trying to clean up my computer and make some space
    Problem is I just have too many files folders and subfolders so going in and out of each folder will take way too long
    So my question is
    Is there a search method that will show me all the files that I haven't used or opened in a while so that I could just browse through those?

    omsaj wrote:
    Is there a search method that will show me all the files that I haven't used or opened in a while so that I could just browse through those?
    Yep, sure is.
    Download the free Easy Find (direct download)
    https://s3.amazonaws.com/DTWebsiteSupport/download/freeware/easyfind/4.9/EasyFin d.app.zip
    Now what your going to do is select your Home folder or a folder inside say Documents
    Then your going to adjust your search settings on the left and use the letter "a" as the search term and click the search and let it rip, it will take some time.
    Next click sort by the "Modified" date and you can then go about it
    Repeat for the letter "e" "i" "o" "u"
    Be careful, Easy Find also finds invisible and hidden files, and you dont' want to delete the iPhoto Libray or anything in the hidden Users/Library folder.
    Perhaps you should create a backup first, then later on if you made a mistake you can recover
    Most commonly used backup methods

  • How can I see in my address book all contaacts that have not been placed into groups?

    How can I see in my address book the contacts that have not been put into groups?

    The best way to do that is create a new "smart group" with the following:
    This way you can identify those without a group and drag them to one.
    Regards,
    Captfred

  • [svn] 2841: Fix bug loading untrusted applications that have not been sized .

    Revision: 2841
    Author: [email protected]
    Date: 2008-08-14 04:45:09 -0700 (Thu, 14 Aug 2008)
    Log Message:
    Fix bug loading untrusted applications that have not been sized.
    QE:YES
    Doc:
    Checkintests: YES
    Reviewer: Alex
    Bugs: SDK-16470
    SWFLoader:
    Fixed a security violation trying to access untrusted content. The problem happened in doScaleContent() when the loaded content had not been sized yet. The fall back is to check the class type of the content, but the SWFLoader did not have access to the content. The security violation was caught and the FlexLoader size is set when it shouldn't be. The problem is solved by checking access rights before accessing the content and not generating an exception.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-16470
    Modified Paths:
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/SWFLoader.as

    Ignoring what is causing the errors for a moment, what would help is a way to get the application loader to restart from the point of error rather than going back to the beginning of the "Loading applications" step each time.
    I imagine this to be something of a big ask. Any other suggestions in a similar vein?
    Nick.

  • HT1296 I already have an itunes account on my laptop but have been setup on a mac and have songs that have not been purchased from the itunes store, I cannot get the songs from my iPhone onto my itunes account on the mac. how can I do this?

    I already have an itunes account on my laptop but have been setup on a mac and have songs that have not been purchased from the itunes store, I cannot get the songs from my iPhone onto my itunes account on the mac. how can I do this?

    You copy them from your old computer or your backup copy of your old computer.
    The iphone is not a backup/storage device.

  • How do I find all the purchased items on my iPhone? When I try to update the iPhone iOS while connected to my MacBook it says there are purchased items on the phone that have not been transferred to my iTunes library and that I should transfer them.

    How do I find all the purchased items on my iPhone? When I try to update the iPhone iOS while connected to my MacBook it says there are purchased items on the phone that have not been transferred to my iTunes library and that I should transfer them before updating.

    Thanks. This seems to have worked easily.

  • When trying to update phone, a message says i have purchased items that have not been transferred to iTunes, what is this?

    When trying to update phone, a message says i have purchased items that have not been transferred to iTunes, what is this?

    We need a bit more information to help.
    Are you trying to update your iPhone using iTunes on your computer?  If so, did you make purchases through the iTunes Store or App Store on your iPhone, and fail to sync them with your computer?  That is the likely meaning of what you are seeing.  If this is true, the purchases would be added to iTunes in your computer before the upgrade proceeds.

  • HT1338 I am trying to upgrade my iPhone via my macbook but the messageThere are purchased items on the iPhone "Mark Price's iPhone" that have not been transferred to your iTunes library. You should transfer these items to your iTunes library before updati

    Good morning
    I am trying to upgrade my iPhone via my macbook but the following message keeps coming up and the download does not work
    "There are purchased items on the iPhone “Mark Price’s iPhone” that have not been transferred to your iTunes library. You should transfer these items to your iTunes library before updating this"
    Please advise how I can transfer these files, I am not sure what files are in question.
    I've only had the MacBook a couple of days, I am PC savvy but this is all new to me so please keep it as simple as possible. I am a brit based in Bahrain.
    Regards
    Mark Price

    okay I've done everything regarding the transfer process (via file>transfer purchases) and syncing, so everything on my iPhone device seems to have been transferred to my iMac... however, I still get that message ("There are purchased items on the iPhone..."), trying to upgrade the iOS Have tried several times the same process of hitting transfer purchases via file, but nothing seems to make that message go away! Would have been nice to know which files I actually do need to transfer, which I don't get any info on of course...
    Starting to get really annoying this thing.. Any smart suggestions what's going on?

  • HT201210 I'm trying to update my iOS to 6.0, using iTunes (with my 4s connected via USB and WiFi is on also). I get a message that 'there are purchased items on my iPhone that have not been transferred to my iTunes library. Yet, I can't find those items!

    I'm trying to update my iOS to 6.0, using iTunes (with my 4s connected via USB and WiFi is on also). I get a message that 'there are purchased items on my iPhone that have not been transferred to my iTunes library. Yet, I can't find those items! Help!  There is not error message number just the text message. I've searched for an answer but have found nothing on "transfering items purchased to your iTunes library".

    Right click on your device icon on the left pane of iTunes and click on transfer pur....

  • HT1848 Hi! I am new to i-phone and have a 3gs. I need to update software as itunes will not let me purchase without one. When I go to update it says that there are purchases that have not been downloaded into my library! Am totally confused! Help!!

    Hi!
    Am totally new to iphone and have a 3gs. Am trying to upodate software as in the itunes store it says that I need to to purchase. When I try to update a message says that there are purchases that hav not been down loaded to my library? As far as I know I haven't purchased anything from itunes as it would not let me until i upgraded! Totally confused would it be anything to do with purchases made on my computer through e-bay? Please help me someone as am terrified to upgrade until I know what this message means.
    Would really appreciate any help please.
    Many thanks
    p.s How do you know what operating system you are on?

    http://support.apple.com/kb/HT4972

  • Whenever I try to open iPhoto, a message comes up saying that 148 photos have been found in the iPhoto Library that have not been imported. It asks me if I want to import them and I say NO but then it places them in a recovered photo folder. I keep deleti

    Whenever I try to open iPhoto, a message comes up saying that 148 photos have been found in the iPhoto Library that have not been imported. It asks me if I want to import them and I say NO but then it places them in a recovered photo folder. I keep deleting the empty recovered photo files but it just keeps asking me every time I go to open iPhoto! I'd love to just get rid of the "found" photos (I can't open them anyway!)
    How do I get rid of them so that I can just open iPhoto straight up without this?
    Linda

    Open your iPhoto Library package with the Finder.
    Click to view full size
    look for a folder titled Import or Importing and move it to the Desktop. Launch iPhoto to see if the message goes away.  If there is no message  check the contents of the Import folder to see if you want to keep any of those image files (usually they have not been imported into iPhoto). If you want to keep them then drag the folder into the open iPhoto window to import.
    OT

  • I have 3 PC's.  Two of them I use at 2 different locations and only use them 6 months a year.  So, if I have Icloud for my calendar, and turn on a computer that has not been used for 6 months, does all the old information on that computer to go Icloud?

    I have 3 PC's.  Two of them I use at 2 different locations and only use them 6 months each year.  When I turn on a computer that has not been used for 6 months, does all of the old information from that computer end up in Icloud?  Does Icloud push all the new calendar and contact items over the old items?

    A reset may help. Tap and hold the Home button and the On/Off buttons for approximately 10-15 seconds, until the Apple logo reappears. When the logo appears, release both buttons.
    No content is affected by this procedure.

  • How do I delete photos in Iphoto library that have not been imported?

    How do I delete photos in Iphoto library that have not been imported?

    How did they get there and how do you know that they are there?
    If they were not imported and iPhoto is not aware of them then you can be sure your current backup is up to date and tested, quit iPhoto and drag them to the finder trash - But be very careful because if you trash any items that iPhoto knows about you will corrupt your library
    Before you empty the trash, launch iPhoto again and be sure everything is working correctly
    It is recommended that you never modify the iPhoto library using anything except iPhoto or iPhoto aware programs like iPhoto Library Manager including adding, modifying or deleting items, files or folders within the iPhoto library
    Your current case may be one of the very unusual exceptions to this - if they were put there without iPhoto's knowledge
    LN
    Message was edited by: LarryHN

Maybe you are looking for

  • Scheduling Agreement with Kanban

    I was looking in to the forum and as per my understanding FRC and JIT schedule, On the days on which the next FRC date (1st. Monday in the month) or the next JIT date (Monday each week) is reached, scheduling agreements with the above profile setting

  • Need to change a string.

    In my class we were required to write a program that will calculate the weekly pay of an employee. Then it also must allow the user to enter another employee until the user enters the word stop. The program must display the name, hours worked, payrat

  • How to get the parsed HTML from a JSF Page

    Hi, I have an application that the user must fill in some data. Later on, it's shown a confirmation page with the user's information. I want to email that confirmation page to the company. The question is: How can I get the result html page as a stri

  • How to record first-published date in metadata for use with US Copyright Office?

    Hello, I'd like to record the date when an image is first published in the image's metadata. This is useful for when I need to send group submissions of published works to the US Copyright Office. Can anyone advise as to the best place to record this

  • How can I see the border of a label

    I'm wondering how can I see the border of a label. I'm trying using the following command but is giving me an error that cannot resolve symbol setBorder. There is another way to do this? label_01.setBorder(BorderFactory.createLineBorder(Color.black))