Check In All Items In Library Using Powershell

During an implementation of some web parts we faced an issue where a slider web part would not show images. After some digging we found that we had to check in all new images that were loaded or the images would not show on the actual web part, this happen across all web parts that used images and is part of the SharePoint publishing feature.

To check in images one by one would be quite cumbersome, luckily however, we have PowerShell to help us out.

The PowerShell code below, courtesy of SharePoint Diary really assisted us in our situation. Use the below in PowerShell in order to check all items in.. You can add your site and library to match your environment..

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables for Site URL and Library Name

#Get Site and Library
$Web = Get-SPWeb $WebURL
$DocLib = $Web.Lists.TryGetList($LibraryName)

#Get all Checked out files
$CheckedOutFiles = $DocLib.Items | Where-Object { $_.File.CheckOutStatus -ne "None"}

#Check in All Checked out Files in the library
ForEach($item in $CheckedOutFiles)
#If you want to update fields
#$item["Field"] = "value"

#check in file programmatically
$DocLib.GetItemById($item.Id).file.CheckIn("Checked in by Admin")
write-host "File:'$($item.Name)' has been checked in!"



Hope this helps someone out there!


Delete All Items In A SharePoint List

OOTB SharePoint allows you to delete a maximum of 99 items at once from a list. This isn’t usually an issue when you have smaller lists, however, once your lists start going into 1000’s, this really does become an issue.

I don’t usually don’t count these blog posts as code solutions because they’re not really code, just scripts that can be run to make it easier dealing with SharePoint here and there!

Also with the amount of amazing posts out there related to SharePoint I am sure you will find many posts showing similar ways of doing this. I found this script a while back and can’t be too sure as to the source, however, kudos to the script writer/poster.

You can run the below code as an admin in a SharePoint PowerShell elevated command window.

$web = get-spweb http://TYPE SITE HERE
$list = $web.lists | where {$_.title -eq "TYPE LIST NAME HERE"}
Write-host "List $($list.title) has $($list.items.count) entries"
$items = $list.items
foreach ($item in $items)
Write-host " Say Goodbye to $($" -foregroundcolor red


Sign In As Another User SharePoint 2013 – The Same But Easier Approach

I was browsing a site the other day looking for an answer to something hoping someone had come across as well and what do you know? I came across something as well.

Very similar to my previous post, but now you don’t have to type in the address bar all the time. You can save the below link as a bookmark/favorite and the JavaScript will basically add your URL to a string and will ask you to sign in again. Easier when you’re in a hurry and also to avoid typos!

Save below as a bookmark:

javascript:(function(){var ctx=new SP.ClientContext.get_current();var web=ctx.get_web();ctx.load(web,'Url');ctx.executeQueryAsync(Function.createDelegate(this,success),Function.createDelegate(this,failed));function success(sender,args){var url=web.get_url();window.location=url+'/_layouts/closeConnection.aspx?loginasanotheruser=true';};function failed(sender,args){alert('Error\n'+args.get_stackTrace());};})();



SharePoint 2013: Cascade Dropdowns using SPServices

Excellent post without the need to edit Master Pages nor create custom New/Edit forms on the list.


Using Jquery.SPServices, you can achieve cascade dropdown in SharePoint. In Cascade dropdown, upon selection of value from first drop down, other drop down’s value gets filtered.

For example, if you have a requirement to display items based on category selection or you want to display states based on country selection. This type of feature, you can use cascade drop downs.

 Create following custom lists in SharePoint.

ItemCategory List


Items List – This has Category lookup column from ItemCategory.


CascadeDemo List – This has ItemCategory and Item lookup columns from ItemCategory and Items list.



In new item of CascadeDemo list, when selecting ‘Stationary” value from item category drop down, it should display only “Pencil” and “Notebook” in item drop down not all the items from list.

Here, you need to download jquery-1.11.0.min.js from site and jquery.SPServices.min.js from site or you can use direct reference from online.

  •  Navigate to your…

View original post 207 more words

Application Pool Stopping When Running 32-Bit Non-SharePoint Sites In IIS

Whilst moving a site over from one server to another, I ran into slight issues isn’t too hectic to sort out.

The source server where the site was hosted was not a SharePoint Server, rather just a basic server to host some websites, plain and simple.

The destination server was however a SharePoint server. The website being hosted needed its AppPool to be run in 32-bit mode, but when hosting 32-bit websites on a SharePoint server it gives the error in the event viewer:

“The Module DLL ‘C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\isapi\spnativerequestmodule.dll’ could not be loaded due to a configuration problem. The current configuration only supports loading images built for a x86 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see”

With this error, your web application’s AppPool will stop by itself once you browse to your application.

To fix this you can run the following command that allows 32-bit applications to run by redirecting the spnativerequestmodule.dll to run only when 64-but application need it.

You can run the code in an elevated Command Prompt session:

<pre id="pre485695" class="prettyprint notranslate"><span class="code-string">"</span><span class="code-string">%systemroot%\system32\inetsrv\AppCmd.exe"</span> set config -section:system.webServer/globalModules /<span class="code-keyword">[</span><span class="code-keyword">name='SPNativeRequestModule']</span>.preCondition:integratedMode,bitness64</pre>


Code Project

Manas Bhardwaj’s Stream



SQL Does Not Have the Required MaxDegree of Parallelism Setting of 1

SharePoint Adam

So you were quick to jump on SharePoint 2013 Preview, eh? If you are a good SharePoint person and are attempting to run SharePoint Products Configuration Wizard with least privilege, then you are probably at this post because you hit this:

Configuration Failed

Failed to create the configuration database.

This SQL Service instance does not have the required “maxdegree of parallelism” setting of 1. Database provisioning operations will continue to fail if “maxdgree of parallelism” is not set 1 or the current account does not have permissions to change the setting…


The default setting for this in SQL is 0 and this was not a requirement, but a recommendation, in SharePoint 2010. Our new buddy SharePoint 2013 requires that MAXDOP be set to exactly 1. Furthermore, as foreshadowed above, if you ran the wizard with a highly privilege account on SQL, then the account would automatically make the settings…

View original post 145 more words

Unable To login To Fully Qualified Domain Name SharePoint Site On Host Server

My password is correct, I know it is, its what I used to log in to this server, BUT WHY DOES IT KEEP ASKING ME FOR A USERNAME AND PASSWORD.

How could I not know that when you try to access a SharePoint Site which has Fully Qualified Domain Name on the its host server it does a LoopBackCheck that keeps asking for a username and password.

Basically, you have a server called SharePoint and on it you have multiple Web Applications with different Host Headers. The Host Header allows the DNS to properly point you to the right SharePoint Site when multiple sites are on point 80.

So when we try to access http://company on the SharePoint server it will keep asking for a username and password because it does a LoopBack check. Apparently its a security feature as part of windows.

Follow the cool blog below that will show you how to disable it.

How To Disable Loop Back Check On Windows Server

Thanks To Robyn Cerda & Teddy Gonzalez for the cool blog posts.