Tuesday, October 29, 2013

Get Rid of Visual Studio Just-In-Time Debugger Popup

Getting Visual Studio Just-In-Time Debugger popup window often? here is how to disable it:
  • From the Just-In-Time Debugger popup window, Select "New instance of Microsoft Visual Studio 2010" and Click on "Yes" button for Do you want to debug using the selected debugger?
Get Rid of Visual Studio Just-In-Time Debugger Popup
  • This opens Visual Studio. Close the error message window. Go to Tools >> Options >> Debugging >> Just-In-Time
  • From the Just-In-Time dialog box, Un-check All options, (Managed, Native and Script) and click on "OK" to save changes.
How to disable visual studio Just-In-Time Debugger
That's all!

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, October 28, 2013

Set-SPPassPhrase: Error deploying administration application pool credentials. Another deployment may be active.

Problem: Got this error message when trying to change pass-phrase in a SharePoint 2013 farm:
Set-SPPassPhrase: Error deploying administration application pool credentials. Another deployment may be active.
Set-SPPassPhrase: Error deploying administration application pool credentials. Another deployment may be active. an object of the type Microsoft.SharePoint.Administration.SPMasterPassphraseDeploymentJobDefinition named "Job-admin-passphrase-change" already exists under the parent Microsoft.SharePoint.Administration.SPTimerJobService named "SPTimerV4". Rename your object or delete the existing object.

Solution: Clear SharePoint Configuration cache on all SharePoint Servers! Make sure SharePoint timer job is successfully started after clearing SharePoint configuration cache.
KB: https://support.microsoft.com/en-us/kb/939308 .

If you still experience the trouble, Delete the timer job and try again with your pass phrase change:
#Get the passphrase change timer job
$job = Get-sptimerjob job-admin-passphrase-change
#Output to screen
$job 
#Delete the timer job
$job.Delete()


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


How to Remove SharePoint WFE/APP Servers from the Farm?

How to remove SharePoint server from farm?
As per the Technet article, Remove a server from a farm in SharePoint 2013, Use Add/Remove Programs from "Control Panel" to remove SharePoint 2007/2010/2013 servers from the Farm.
  • Control Panel >> Add/Remove programs >> Microsoft SharePoint Server 2013 >> Remove
Make sure that the user account performing this procedure is a member of the Local Administrators group.

However, If you try to rebuild SharePoint on the server, I would prefer to use "Disconnect this server from farm" option on PSCONFIG wizard. To remove SharePoint server from farm, Run "SharePoint Products Configuration Wizard" (psconfigui) and choose "Disconnect from this server farm option" and then run through the wizard.
how to remove sharepoint server 2010
Once the wizard completed successfully on the server that you want to remove from the farm, that server won't be part of your SharePoint farm anymore! You can run the wizard again to join the server at anytime if needed.
Simply choosing "Remove Server" option without above steps in "Servers in farm" page will cause undesirable results such as timer-job failures.

Remove SharePoint server from farm with PowerShell:
Here is the PowerShell way to remove SharePoint server from farm. Run this PowerShell command from the target server:
Disconnect-SPConfigurationDatabase -Confirm:$false 
PSCONFIG command line to remove a SharePoint server from an existing farm:
psconfig –cmd configdb -disconnect

Basically, these command line and PowerShell cmdlets does the same things as SharePoint Products Configuration wizards disconnecting server from farm. But wait! Are we completely done? No! There could be several artifacts left in the server such as Server Roles, IIS directories, Logs, Registry keys, etc. So, I would recommend doing a fresh install of OS and SharePoint for a clean server rebuild.
To remove a database server from a farm, move any databases stored on that server to a different database server and then click Remove Server from Manage Servers in the farm page.


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Friday, October 25, 2013

Change "SharePoint" Branding Text in SharePoint 2013 Suite Bar

Ever wanted to change the "SharePoint" branding text in Suite bar (in top-left position) of SharePoint 2013 site?
sharepoint 2013 add link to suite bar powershell

Well, You can set the web application's SuiteBarBrandingElementHtml property with PowerShell/Object model code, to change the text "SharePoint" shown in top left banner of  SharePoint 2013 sites.

Customizing the SharePoint 2013 suite bar branding using PowerShell:
Here is the PowerShell script to add link to suite bar in SharePoint 2013.

Add-PSSnapin Microsoft.SharePOint.PowerShell
#Get the Web Application
$webApp = Get-SPWebApplication "http://extranet.crescent.com/"

#Set the "SharePoint" text Property 
$webApp.SuiteBarBrandingElementHtml = "Crescent Extranet"

# You can also replace it with Clickable Hyperlink - Images
# $webApp.SuiteBarBrandingElementHtml = '<div class="ms-core-brandingText"><a href="http://extranet.crescent.com"><img src="http://extranet.crescent.com/SiteAssets/crescent_logo.png"/></a></div>'  

#Update changes
$webApp.Update()

Here is the result in action:
customizing the sharepoint 2013 suite bar branding using powershell
JQuery method with SharePoint 2013 Master page to customizing the SharePoint 2013 suite bar branding:
To change the "SharePoint" branding text in suite bar, you can also use jQuery. Just open your master page in SharePoint designer, locate </head> tag and place this code in it.
<script type="text/javascript" src="http://code.jquery.com/jquery-1.2.6.min.js"></script>

<script type="text/javascript">
 $(document).ready(function() {
 var suiteBar = $("#suiteBar").find(".ms-core-brandingText");
 suiteBar.html("<a style='color:white' href='https://extranet.crescent.com'>Crescent Extranet</a>");   
  });
</script>
Using CSS to replace "SharePoint" Branding Text: Place this CSS in your Master page.
  <style>
     .ms-core-brandingText {
           text-indent: -95px;
       }
    .ms-core-brandingText:after {  
          content: " Crescent Inc.";
    }
 </style> 

BTW, Its actually a delegate control which can be replaced with an user control solution built in Visual Studio, In case you need a solution based approach. More info here: SuiteBarBrandingDelegate Delegate Control

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, October 24, 2013

Column Default Value Settings based on Location in SharePoint 2013

While its possible to set default values for SharePoint columns in library level at field settings, What if you want to set the default column value of a document based on the folders its saved? SharePoint 2010/2013 provides a new feature to set metadata values based on the location!

Say, We've a document library with "Department" column and with few folders namely "Sales", "Marketing", "IT", etc. as in this screen.
and we want to the metadata field "Department" value based on the location.

Set Column Default Value Settings in SharePoint 2013
  • Go to List / Library settings >> Click on Column default value settings in SharePoint
  • Click on the desired metadata column link of the respective folder(s)Set Column default value settings in SharePoint 2010
  • and set the value for it
When users upload a new document to different folders, the "Department" field gets value from this setting automatically.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Friday, October 18, 2013

Windows NLB Vs Hardware Load Balancer for SharePoint

It's a best practice to use Hardware load balancer rather Windows NLB for SharePoint (or any other web applications!) for following reasons:
  1. NLB uses local resources on each server in the cluster - Which means additional load on SharePoint servers!
  2. NLB Cannot detect service outage. It can only detect server outage by IP address. If a particular server service fails, is hung, slow, or depreciated - WNLB cannot detect the failure and will still route requests to that server.
  3. NLB doesn't provide any specific feature or optimization such as : SSL off-loading, compression, Caching, Certificates management, etc.
  4. NLB is DNS Round Robin (RR) which simply forward the client hits to defined interfaces. So it leads to uneven spread of workloads across cluster nodes resulting in slow user response times and high latency for the application.
  5. Performance can degrade as more nodes are added to the cluster
  6. Adding or removing a single node can cause clients to reconnect to the WNLB cluster.
  7. It cannot provide reverse proxy services functionality.
  8. Only supports source IP address affinity / persistence.
  9. All hosts in a cluster must be located in the same subnet.
  10. NLB Cannot provide pre-authentication and Single-Sign-On functionality features which are important for SharePoint.
So, A dedicated hardware load balancer addresses these drawbacks and makes configuring and managing load balanced environment a whole lot easier! Use NLB ONLY if hardware load balancer is not available.



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


How to Rename SharePoint Folder Programmatically

To rename a folder in SharePoint 2010, Navigate to the library where the folder exists. Click on "Edit Properties"
how to rename a sharepoint folder

Provide new name to the folder and click on "Save" button.
sharepoint 2010 rename folder programmatically


How rename SharePoint folder programmatically? 
To rename a folder in SharePoint document library programmatically, using C# object model code:
FolderPath = "http://YOUR-SharePoint-Site/sites/sales/documents/Invoices";

SPFolder TargetFolder = SPContext.Current.Web.GetFolder(FolderPath);

Target.Item["Name"] = "Invoices 2014";

Target.Item.Update();

Rename SharePoint Folder using PowerShell script:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get the Web
$Web = Get-SPWeb "http://sharepoint.crescent.com/sites/branding/"

#New Name for the Folder
$NewFolderName = "Icons";

#Get the Folder to Rename by its path
$folder = $Web.GetFolder("http://sharepoint.crescent.com/sites/branding/DesignDocuments/Symbols");

if ($folder.Exists)
  {
 #Set the New Name and Update
 $folder.Item["Name"] = $NewFolderName;
 $folder.Item.Update();
  }

This code renames folder at given path. Unlike Lists & document libraries, Folder URLs will change when you give a new name to it. 

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, October 17, 2013

Backup and Restore (Export-Import) Lists in SharePoint 2013 using PowerShell

Requirement: Backup and restore a SharePoint 2013 list between sites.

Solution: While saving a list as template, including its content is one solution, it doesn't work for lists larger  than 50 MB! So, follow below steps to export-import lists in SharePoint 2013 using PowerShell.

Export a SharePoint list using PowerShell:
Use Export-SPWeb cmdlet with ItemURL parameter to export a SharePoint list.

Syntax:
Export-SPWeb <Site URL> -Itemurl  <Relative path of List or Library> -path <Backup-path>

E.g.
Export-SPWeb "http://crescent.com/HRv2" -itemurl "/Lists/Invoice" -path "D:\Invoice.bak"

You can also export a SharePoint list from SharePoint 2013 central administration site.
  • Central Administration >> Backup and Restore >> Export a site or list export and import list in sharepoint 2013
Restore (Import) SharePoint lists using PowerShell:
Now, to import lists to SharePoint 2013, use: Import-SPWeb cmdlet
Import-SPWeb "http://intranet.crescent.com/HRv3" -Path "D:\Invoice.bak"

TechNet Articles: Import-SPWeb, Export-SPWeb

Related post: Export and Import All SharePoint Lists using PowerShell

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Wednesday, October 16, 2013

The server was unable to save the form at this time. Please try again

Got this error message when trying to save a new list item. SharePoint didn't allow me save!
The server was unable to save the form at this time. Please try again.
The server was unable to save the form at this time. Please try again

It also repeated in few more situations like when trying to create new custom list, trying to add new folder, When performing a Search, etc.

Cause: Observed, This issue is closely related to lack of server memory!

Solution:
Add more memory (RAM) to resolve this issue permanently!

As for temporary workaround, you can try these solutions:
  • Monitor your Server RAM usage. Try closing some programs running on the server.
  • Restart "Search Host Controller Service" service in Services console (services.msc)
    Restart "Search Host Controller Service" service
  • Perform IISReset on SharePoint WFE(s)
  • Make sure anonymous authentication enabled for SharePoint web application in IIS
  • Run IE with out any Add-ons. You can also try using browsers other than IE (Try with Firefox/Chrome)
  • If Security Token Service is in stopped state, Start it. Try recycling it, if its already started.


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Sunday, October 13, 2013

Sign in as Different User in SharePoint 2013 - Workarounds

SharePoint 2013 doesn't offer the handy "Sign-in as different user" feature as in its previous versions under welcome menu. Not very clear why Microsoft has removed this option, I guess might be due to security/caching problems!
sharepoint sign in as another user sharepoint 2013 sign in as a different user
But some times, you may have to login as different user who has different permission than the current user. Here are some possible workarounds to enable sign in as different user in SharePoint 2013.

Option 1: Navigate to Close Connection Page
Navigate to the URL: http://Your-Site/_layouts/closeConnection.aspx?loginasanotheruser=true

BTW, The above URL is just copied from SharePoint 2010's Sign-in as different user option, and it works for SharePoint 2013 as well! Replace "Your-Site" with the SharePoint 2013 site collection URL of your environment.Once you hit this URL, you will be prompted to enter your user name and password.

You can also bookmark it! just drag and drop this to Favorites bar: Sign in as Different User

Option 2:  Run IE as different user / Open IE in private mode 
  • Go to Start >> Internet Explorer >> Shift+ right click >> Choose "Run as Different User"
  • Or, Go to Internet Explorer >> Tools >> Click on InPrivate Browsing 
These options brings the prompt to Enter your credentials.
sharepoint 2013 login as a different user

Option 3: Edit "Welcome.ascx" file
Edit "Welcome.ascx" file, which is at "C:\Program Files\Common Files\Microsoft Shared\Web Server Extension\15\TEMPLATE\CONTROLTEMPLATES" folder. (modifying files in the SharePoint file system is not a best practice, BTW!)

Open it in notepad, Add this new entry under the node: <SharePoint:FeatureMenuTemplate>

<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser"
                              Text="<%$Resources:wss,personalactions_loginasdifferentuser%>"
                              Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"
                              MenuGroupId="100"
                              Sequence="100"
                              UseShortId="true"
 /> 
So the file should look like this:
Sign in as Different User in SharePoint 2013 - Workarounds
Save the file (No need for IIS Reset!) That's it! Refresh the page, you can see the "Sign in as different user" menu item now!
Option 4:  SharePoint 2013 Sign in as Different User Missing - Feature Based Solution

Microsoft KB addressing this issue: http://support.microsoft.com/kb/2752600



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, October 10, 2013

How to Create a Subsite in SharePoint 2013

Subsite creation process is pretty straight forward in SharePoint. To create a SubSite in SharePoint 2013, follow these steps:

How to create a subsite in SharePoint from Web Interface:
  •  Navigate to your SharePoint site >> Click on Site settings gear icon >> choose Site Contents menu item.
  • Scroll-down and click on "New Subsite" link in the bottom of the site contents page, Which would point to the URL: http://Your-SharePoint-Site/_layouts/15/newsbweb.aspx
    How to create a subsite in SharePoint
  • Fill out the new SharePoint site creation page according to your requirement. Provide values for parameters such as:
    • Site Title, Description, Site URL
    • Select the appropriate template for your subsite
    • Select the permission inheritance options. Specify whether this subsite has to inherit permissions or should use unique permissions of its own.
    • Specify navigation options.
    • Finally, click on "Create" button to create new subsite in SharePoint 2013! 
sharepoint create subsite unique permission
This adds a new subsite in SharePoint!


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Tuesday, October 1, 2013

Set SharePoint Library Columns from Document File Name

Requirement:
In a SharePoint 2007 site, We've a document library with 1000+ documents loaded. We got a requirement to add two new fields "Year" and "Quarter " and update those meta data field values from the document name.

Here is the screenshot of the list:
Set SharePoint List Metadata Columns from its File Name

Solution:
PowerShell script! We analyzed that the Year & Quarter values are separated by "__". So, Lets write a PowerShell script to extract the required data from document name and set the columns programmatically.
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

#Using Get-SPSite in MOSS 2007
function global:Get-SPSite($url)
 {
    return new-Object Microsoft.SharePoint.SPSite($url)
 }

Function global:Get-SPWeb($url)
{
  $site= New-Object Microsoft.SharePoint.SPSite($url)
        if($site -ne $null)
            {
               $web=$site.OpenWeb();
       
            }
    return $web
}

$url = "http://sharepoint.crescent.com/finance/ARL/"
$ListName ="ARL Archive"

#Get the Web
$web = Get-SPWeb $URL
#Get the List
$list = $web.Lists[$ListName]

#Get All List Items
$ListItems = $list.Items

#Iterate through each item
 foreach($item in $listItems)
  {
     $FileName = $item["Name"]
   
     #Get the Year from File name  # Year is located after __ from the start
     $YearIndex = $FileName.IndexOf("__") + 2 
     $YearValue  = $FileName.Substring($YearIndex,4)
     write-host $YearValue
   
     #Get Month from File name # Month is located before __ from the end
     $MonthIndex = $FileName.LastIndexOf("__")
     $MonthValue= $Month = $FileName.Substring($YearIndex+5,$MonthIndex-$YearIndex-5) 
     write-host $MonthValue
    
     #Set the Quarter based on Month
        Switch($MonthValue)
        {
            "March" { $QuarterValue = "Q1" }
            "June" { $QuarterValue = "Q2" }
            "September" { $QuarterValue = "Q3" }
            "December" { $QuarterValue = "Q4" }
        }
   
     #Set the Field values
     $Item["Year"]  = $YearValue
     $Item["Quarter"]  = $QuarterValue
     $Item.Update()  
  } 

I Love PowerShell again!

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


You might also like:

Related Posts Plugin for WordPress, Blogger...