SharePoint/MOSS - Deleting other people's un-checked-in items from a list
Asked Answered
B

5

5

A simple scenario:

I want to delete a pagelayout that is out-dated from our MOSS publishing site. An ex-colleague has created a new page using this page layout and he has not checked it in. I can't delete the pagelayout because his file is referencing it. I can't 'see' the file because it hasn't been checked in, to remove it.

I've tried SPFolder.Items, SPList.GetItemById(), couple of other object model methods. But SharePoint simply won't show that item to me. I've even poked around SPList.GetItem(new SPQuery() { IncludeAllUserPermissions = true; })

Anyone know how to get rid of this item? :-)

Bartels answered 29/1, 2009 at 9:29 Comment(0)
B
5

If you are a site collection administrator, you can also force a check in of the other person's checked out file. The trick is that you have to know what library it's in. If you know that, you can navigate to that library, then do the following things:

  1. Click on Settings -> Document Library Settings (or List Settings, I suppose)
  2. Click on Manage checked out files in the Permissions and Management column
  3. You should now see a list of checked out files, which you can select, then click on Take Ownership of Selection in the toolbar.
  4. Once you've done that, you can check the file in yourself.
Beverle answered 29/1, 2009 at 14:42 Comment(1)
This is a great tip that lead us to solve the problem in the object model. See my comment below. Thanks Abs.Bartels
B
9

Abs's answer lead us gave us the hint - hey how does the ManageCheckedOutFiles page see the files not yet checked-in by other users?

  1. go to ~layouts/ManageCheckedOutFiles.aspx
  2. inherits from Microsoft.SharePoint.ApplicationPages.ManageCheckedOutFilesPage
  3. reflector 12\CONFIG\BIN\Microsoft.SharePoint.ApplicationPages.dll
  4. in protected void PrepareContent() we read the key lines:
  5. IList checkedOutFiles = this.CurrentList.CheckedOutFiles;

so back in our code

SPDocumentLibrary doclib = PublishingWeb.PagesList as SPDocumentLibrary;
foreach(var checkedoutfile in doclib.CheckedOutFiles)
{
    checkedoutfile.TakeOverCheckOut();
    var file = doclib.GetItemById(checkedoutfile.ListItemId);
    file.CheckIn();
}

Thanks everyone :-)

Bartels answered 29/1, 2009 at 22:59 Comment(1)
In SharePoint 14 PowerShell the code looks a bit different: $checkedoutfile.TakeOverCheckOut(); $item = $doclib.GetItemById($checkedoutfile.ListItemId); $item.File.CheckIn();Objective
B
5

If you are a site collection administrator, you can also force a check in of the other person's checked out file. The trick is that you have to know what library it's in. If you know that, you can navigate to that library, then do the following things:

  1. Click on Settings -> Document Library Settings (or List Settings, I suppose)
  2. Click on Manage checked out files in the Permissions and Management column
  3. You should now see a list of checked out files, which you can select, then click on Take Ownership of Selection in the toolbar.
  4. Once you've done that, you can check the file in yourself.
Beverle answered 29/1, 2009 at 14:42 Comment(1)
This is a great tip that lead us to solve the problem in the object model. See my comment below. Thanks Abs.Bartels
P
0

try SharePoint Sushi from codeplex.

Good luck.

Processional answered 29/1, 2009 at 9:35 Comment(1)
which SharePoint Sushi function are you referring to?Bartels
M
0

First you should have administrator permissions over the site collection. Then:

  1. Click on Site Actions, Manage Content and Structure.
  2. Browse to the page layout you want to delete in the Master Page Gallery.
  3. Place a tick next to the page layout you want to delete.
  4. Click Show Related Resources.

This should let you see every page connected to that page layout.

Millenarian answered 29/1, 2009 at 10:7 Comment(1)
yes it shows me what's related, but doesn't let me delete them if the guy hasn't check-in at least once. I get a 404 when I try to go to that resource.Bartels
H
0

Quick & easy non-SharePoint solution: If it's an ex-coworker is there any possibility of asking for temporary use of his account with a new password so that you can login to the portal and check it back in or discard the check-in?

Herwig answered 29/1, 2009 at 19:48 Comment(1)
my scenario is a bit simplified - the MOSS site is a site restore from a different MOSS site, and the users are actually on a different Active Directory system. So there's no way to login as them in my network :-(Bartels

© 2022 - 2024 — McMap. All rights reserved.