Retrieving Credentials from the SharePoint’s Secure Store Server

Hey everyone,

This is more of a reminder post for myself. But my team was having troubles remembering the credentials we set up in one of our Secure Store Application entries. Unfortunately there is no way to retrieve it from Central Admin, so I assumed there had to be some PowerShell or C# way of retrieving it.

While googling around I came across this great console application by Mike Hacker that solved our problem completely:

Thought I would post a link to it in case any one else had a similar issue and so I don’t have to google around again ūüôā

My thanks to Mike.

User Information not Changing in Site Collection After Being Updated in Active Directory

Hey Guys,

This is more a follow up most to my previous post on User can’t access SharePoint site after granting appropriate permissions, however I’ve seemed to find a better solution.

Recently a user had their name changed in Active Directory, but the problem was this name change was not reflected in their site collection. The thing that made this weird was that it was only in this one site collection that there was a problem. I’ve checked the User Profile in Central Admin and all looks good. I’ve tried adding the user to another site and all looks good. But for some reason this one site collection was not¬†properly updating the username.

Now when you add a user to a site collection your creating an instance of that user in the hidden user information list: http://Server/sites/YourSiteCollection/_catalogs/users/details.aspx.

This list is what dictates what information a user would have presented about themselves in a Site. As long as a user remains active on a site i.e. updating/modifying files, this hidden user list would get synched with user profiles in Central Admin. Now in my case for some reasone this list was not getting updated by the user synch. Unfortunately I have not yet found a solution to why it was not getting updated but I have found a work around to fix the individual user who had their information changed.

The fix is to have them deleted completely from the site collection. My previous post was a bit of a pain to do but really all you would need to do is view all people of the site using this view:

From there you can select the user and go to Actions >  Delete Users from Site Collection. After you should be able to re-add the user and it will pull their information properly from Active Directory.

Hope this helps

Cannot publish InfoPath forms or cutomized list forms in SharePoint lists (2010)

Christmas Holidays are over, and what could be more fun than coming back from holidays to error messages through SharePoint.

It seemed when a user tried to edit an infopath form of their site collection they were unable to republish the form getting the following error message:

Error Message

“The publish operation could not be completed. It cannot be determined if the form template was successfully published. Try publishing the form template again, or change the list settings to use the default SharePoint form”

It didn’t matter how little was changed in the form¬†or whether it was a form libray or trying to customize the form of a regular SharePoint List:

Customize Form

viewing the details of the error message:

“InfoPath cannot connect to the server. The server may be offline, your computer might not be connected to the network, or InfoPath Forms Services 2010 might not be enabled on the server. To fix this problem, start by checking your network connection, and then trying again.”

From this we can narrow down the issue to be with InfoPath Forms Services since we are able to connect to the Site collection fine.

Since this was not an issue with other site collections we can narrow it down further that it is only with the InfoPath Site Features (IPFSSiteFeatures). This is a hidden feature in all site collections and can only be viewed through PowerShell. I found by simply disabling an re-enabling this feature fixed the problem.

PS C:\> Disable-SPFeature "IPFSSiteFeatures" -url "http://Server/Sites/SiteCollection"
PS C:\> Enable-SPFeature "IPFSSiteFeatures" -url "http://Server/Sites/SiteCollection"

Hope this helps

Saving a Publishing Site Template

This will be a short little post as quick reminder.

Something I didn’t realize about SharePoint teamsites when they have their publishing features enabled is that they no longer give the option to save the site as a template.

This was a problem for me as I was trying to¬†make a series of dashboard sites. Then I found that just because the Save Site as Template link no longer exists doesn’t mean we still can’t get to the page.
If you add “/_layouts/savetmpl.aspx” to the end of your url it will take you to the page for creating site templates.

Hopefully this workaround will help you out.

“Manage files which have no checked in version” list larger than list view threshold

Hey guys,

We ran into an interesting problem the other day after our company acquired another company. Basically the business wanted to consolidate a large amount of the acquired company’s documents into a SharePoint Library with similar documents. This part is fine and can easily be done using explorer view of the library and dragging and dropping the necessary folder structures.

The problem was that the library in question had the setting “Require Check Out” set to yes. This means that all the files that were dropped into the library using explorer view would need to be checked in as there would be no current version.

To make matters worse, the user who dumped all the files left the company, hence there is no checked in version and all the files remain invisible to everyone in the site.

Generally for a scenario like this you could use the option¬†“Manage files which have no checked in version” from the¬†library settings under Permissions and Management

Then from there you could take ownership of all the files, and check them in yourself.

But for our scenario the number of files dropped exceeded our list view threshold by a lot and we couldn’t even open the view “Manage files which have no checked in version“.¬†However even if we could view all the files i.e. extending the threshold temporarily, ¬†it would have been a real pain taking ownership of them all and checking them all in.

PowerShell Solution.

I developed a short little set of PowerShell Functions that can take ownership of the files, then recursively check in all files that are being checked out by the system account.

#Add SharePoint Snapin if not using SharePoint's PowerShell Console
if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
Add-PsSnapin Microsoft.SharePoint.PowerShell
#First function takes ownerhip of all unmanaged files with no version
function Take-Ownership{
$site = Get-SPWeb -Identity $spSite
$list = $site.Lists[$spList]

$list.CheckedOutFiles | ForEach-Object{
$_.LeafName+ " had it's ownership taken from: "+$_.CheckedOutBy.DisplayName+"`n"
#This Function takes a folder object and recursively checks in
#all files which are checked out by the System Account
function checkin-AllFiles{
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]

$currFolder.Files | ForEach-Object {
if ($_.CheckedOutByUser.UserLogin -eq "SHAREPOINT\system"){
$_.CheckIn("File checked in by administrator")
$_.Name+" has been checked in`n"
$currFolder.SubFolders| ForEach-Object{
checkin-AllFiles -currFolder $_
#This function basically combines the previous 2 for primary use
function Checkin-AllUnmanagedFiles{
$spSite = Get-SPWeb -identity $site
$spFolder = $spSite.Folders[$library]

"Taking ownership of the following Files`n"
Take-Ownership -spSite $site -spList $library

"Checking in the following files`n"
checkin-AllFiles -currFolder $spFolder

We can then run the script and use the Checkin-AllUnmanagedFiles function.

PS> Checkin-AllUnmanagedFiles -site "http://yoursite/" -library "Library Name"

For example I have a “Shared Documents” library which requires files be checked out for editing. I then dropped a few files into it’s explorer view

We can now see that these files show up in the library but are all checked out to myself hence no other user can see the file as there is no previous version yet.

Now if we run my script from the command shell:
(Note: I saved my script in a ps1 file called CheckinFiles.PS1)

PS> . .\CheckinFiles.PS1
PS> Checkin-AllUnmanagedFiles -site "http://torapd149:3434/subsite/" -library "Shared Documents" > .\checkin.txt

We can see all the files have now been checked in and modified by the System Account. Also I sent the output to a logfile called checkin.txt which tells which files were taking ownership of and which files were checked in.

Hopefully you will find this as useful as I have.

Changing the “Double Arrow” image used by SharePoints WebPart Connections

Hey Guys,

I’m sure many of you have similar gripes as I do with the little double arrow icon used with WebPart Connections.

In particular most end users complain stating its not apparent that they can use that icon to select items. Luckily I’ve come across a couple neat ways to get around this.

1. The first way which I’m sure many of you know but don’t like is changing the images on the server. If you open your Internet Explorer¬†developer tools (F12)¬†on a page that features the double sided arrows, you’ll notice they have the following image sources:
/_layouts/images/rbunsel.gif” for the unselected arrow
/_layouts/images/rbsel.gif” for the selected arrow
Hence if you go to your SharePoint server “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES” then locate the rbunsel.gif and rbsel.gif you should be able to replace them with an image of your own.

The problem with this is that it makes the change accross the farm for all sites. Maybe some people still like the double arrow?

2. The second option involves a neat little CSS trick and a content editor web part. A little disclaimer, I am by no means a CSS guru or anything and there may be a cleaner method of doing this so feel free to post alternatives in the comments.

The concept is to set a background image in the place of the current images, and then pad the double arrow out of view. Just add the following to the html source of a content editor webpart on the page that contains your double arrows.

<style type="text/css">
BACKGROUND-IMAGE: url(<YOUR IMAGE URL>); /* This is the url for the image to replace the selected arrow*/
WIDTH: 20px; /*this must equal the width of your new image*/
HEIGHT: 0px; 
PADDING-TOP: 20px /*This must equal the height of your new image it will pad the double arrow out of view*/
IMG[src*='/_layouts/images/rbunsel.gif'] {
BACKGROUND-IMAGE: url(<YOUR IMAGE URL>); /* This is the url for the image to replace the unselected arrow*/ 
WIDTH: 20px; /*this must equal the width of your new image*/
HEIGHT: 0px;
PADDING-TOP: 20px /*This must equal the height of your new image it will pad the double arrow out of view*/

Please note that you will need to store the new images for the selected and unselected double arrows somewhere on the site and put their url in place where it says <your image url>.

In my example below I made a simple connection between a document library and an excel web access web part to display selected excel sheets. I saved my replacement images in the site assets library where they can be referenced by the css in the content editor web part.

Obviously you would want to get some nice replacement images or have someone from your digital teams help you out. But if you want to use my images feel free to get them from below ūüôā

 selected and  unselected


Error when trying to access SharePoint Managed Accounts “Object reference not set to an instance of an object”

When trying to access the Managed Accounts section in Cental Admin you may recieve the following vague error message:
Object reference not set to an instance of an object

After doing some digging I found that you can get this error message when one of your Managed Accounts is not in sync with Active Directory, as in the passwords no longer match and most likely the account is locked. You’ll need to work with your access control team in order to get the password reset of the necessary account and have the account unlocked, however you still won’t be able to view the Managed Accounts screen.

In order to get back to the Managed accounts screen you’ll need to disable the automatic password change of the problem account. If you’re not sure what the problem account is then its best to check with each one.

First find out which accounts are set to automatic password change by running the following PowerShell command:

PS C:\> Get-SPManagedAccount | Select-Object UserName, AutomaticChange
Username                                             AutomaticChange
--------                                             ---------------
domain\svc_account                                             False
domain\svc_search                                               True

Next you will need change the Automatic Change status of the problem account(s) by running the following PowerShell command.

PS C:\> $account = Get-SPManagedAccount -identity domain\svc_search
PS C:\> $account.AutomaticChange = $False
PS C:\> $account.Update()
PS C:\> Get-SPManagedAccount | Select-Object UserName, AutomaticChange
Username                                             AutomaticChange
--------                                             ---------------
domain\svc_account                                             False
domain\svc_search                                              False

Once you’ve done this you should be good to go access the Managed Accounts from Central Admin, and re-configure to your needs.


PowerShell to check which SharePoint sites have a specific Feature enabled

Hey Guys,

The other day our Records Management team was adamant in determining who in the company is utilizing SharePoint’s Records Management feature.

With over 350 site collections it would be a real pain to go to each site and check if its enabled. Luckily PowerShell offers a nice easy way of checking this. Here is a really simple PowerShell function that checks which sites accross a specified web application has a specific feature enabled.

#add sharepoint cmdlets
if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
Add-PsSnapin Microsoft.SharePoint.PowerShell
function Feature-Exists
Get-SPSite -WebApplication $webApp | Select-Object Url, @{
    Label="Exists"; Expression=
Get-SPFeature -Site $_.Url | ForEach-Object{
if($_.displayName -eq $featureName){

We can run the function to just get a quick listing or pipe it out to a csv file by doing:

Feature-Exists -webApp "http://site" -featureName "InPlaceRecords" | Export-Csv -NoTypeInformation -Path "D:\report.csv" 

The catch is you do need to know the exact display name of the feature before using the function. The best way of doing this is to¬†use the command Get-SPFeature -site “http://yourSite&#8221; and find the display name of the feature in question. You could also modify the function to use the feature’s GUID instead.

PowerShell to list size of content databases in SharePoint Web Application

Hey Guys,

Here’s another quick little PowerShell command for listing all content DBs and their respective sizes. It is quite handy for doing some auditing and determining if you are performing best practices.

PS C:\> $DBs = Get-SPContentDatabase -WebApplication "http://WebAppUrl" 
PS C:\> $DBs | Format-Table Name, @{Label="Size"; Expression={$_.DiskSizeRequired / 1073741824}}
Name                                                                    Size
----                                                                    ----
ContentDB1                                                     183.9931640625
ContentDB2                                                           58.03125


Clearing SharePoint’s Cache

Just a reminder for everyone here are the steps for clearing SharePoint’s Cache:

  1. Stop Windows SharePoint Services Timer service on every server in the farm (found in Windows Services)
  2. Navigate the Cache folder C:\ProgramData\Microsoft\SharePoint\Config
  3. You will see a couple of folders with GUIDs for names, locate the one that contains the “Cache.ini” file
    Note: If you cannot see the ProgramData folder you may need to make the appropriate folder option changes to see system/hidden folders.
  4. Backup all the xml files and cache.ini file contained in the GUID folder¬†because you never know ūüôā
  5. Delete all the xml files (Do Not delete the Cache.ini file!)
  6. Edit the Cache.ini file and delete its entire contents and enter the number 1 then save and exit.
  7. Start the Windows SharePoint Services Timer Service.

Remember this needs to be done on all the servers. It is a good way to refresh any of your timer jobs if you are recieving errors in the event logs or if some of the services are not acting as expected.