Archive for August, 2011

Discard Check Outs by the System Account

Wednesday, August 3rd, 2011

SharePoint has a wonderful check-in/check-out system for any library with minor versioning enabled. Users with the Override Check Out permission on a particular library have the powerful ability to discard or check in a document, page, etc. that is checked out to another user. This can typically be easily achieved via any of the library’s views using the out-of-the-box user interface.

Any user with the proper permissions can check in or discard the check out using the item's edit menu

If the System Account is the account that has the item checked out, users are no longer available to check in the item or discard the check out from the library’s views, even with the Override Check Out permission!

The options to check in or discard the check out are unavailable in the item's edit menu

However, there is an area where this can be done: Site Content and Structure. One can navigate there by selecting Manage Content and Structure under the Site Actions menu. If you find the same item in that area, you will be able to check in the item or discard the check out.

The missing options are available in the Site Content and Structure views

Moving an Event Source to a Different Windows Event Log

Wednesday, August 3rd, 2011

It is typically best practice when developing .NET applications, including SharePoint customizations, to create an event source for Windows Event Logging while installing the application. Each event source on a Windows computer is tied to a specific log upon registration. I recently provided guidance on how to move an event source to use its own brand new event log. The following lines of PowerShell can do this quickly. Unless your .NET application has the event log hardcoded into itself, which it shouldn’t because the event source should be registered to a log during installation, then the move shouldn’t require any code changes.

I found that I had to reboot the machine after executing the above lines of PowerShell for this change to fully take effect.

Update – I also have had the need to update the event log properties. To do so, use the Limit-EventLog cmdlet. The following code limits the MyNewOrExistingWindowsEventLog event log to a size of 20 MB (20*1024*1024 or 20,971,520 bytes) and tells Windows to overwrite old entries with new entries as needed.