Showing posts with label SharePoint 2013. Show all posts
Showing posts with label SharePoint 2013. Show all posts

Monday, December 26, 2016

SharePoint 2013 People Picker: Sorry, we’re having trouble reaching the server.

Sorry, we’re having trouble reaching the server.

 
 
 
Above mentioned error starts emerging on a SharePoint portal when your domain is not registered as Active Directory domain in people picker control for that specified portal.
 
To add domain to work with people picker run the following PowerShell command as Administrator.
 
 
$webApp = Get-SPWebApplication https://<web adderss>
$newdomain = new-object Microsoft.SharePoint.Administration.SPPeoplePickerSearchActiveDirectoryDomain
$newdomain.DomainName ='<Domain Name like domain.com>'; 
$newdomain.ShortDomainName ='<net bios name (optional)>';
$newdomain.LoginName ='domain\Farm Account'
$newdomain.IsForest='false'
$webapp.PeoplePickerSettings.SearchActiveDirectoryDomains.Add($newdomain)
$webapp.update()
 
To verify if domain has been added, run the command below
 
$webapp.PeoplePickerSettings.SearchActiveDirectoryDomains
 
Wait for couple of minutes and users will start to show in people picker which were initially not showing up.
 

Wednesday, November 4, 2015

Get SharePoint Farm server status by Email using PowerShell

Admins are required to get information about SharePoint farm server in order to have a check if machines in farm are running properly. If a server is down or drive hosting the SharePoint sites or on database server is full, this could end up with down time on a specific SharePoint application or an entire farm could go offline.

using PowerShell script, you can get an email about the physical state of SharePoint farm.

This script can also be automated using Windows task scheduler, so that an email can be send daily at a specific time.

Add-PSSnapin Microsoft.SharePoint.PowerShell

Function GetServerDetail(){
# Get All the servers in a SharePoint Farm
$AllServers = GET-SPServer

# Create HTML Table and first row as header
$html = "<table  cellpadding='0'  cellspacing='0' style='width:800px;border:1px solid black;font-family:verdana;font-size:11px;'><tr>"
$html += "<td style='border:1px solid white;color:white;background-color:black; font-family:verdana;font-weight:bold;'>Server Name/IP</td>"
$html += "<td style='border:1px solid white;color:white;background-color:black; font-family:verdana;font-weight:bold;'>Server Role/IP</td>"
$html += "<td style='border:1px solid white;color:white;background-color:black; font-family:verdana;font-weight:bold;'>Online</td>"
$html += "<td style='border:1px solid white;color:white;background-color:black; font-family:verdana;font-weight:bold;'>C Drive total Space (GB)</td>"
$html += "<td style='border:1px solid white;color:white;background-color:black; font-family:verdana;font-weight:bold;'>C Drive free Space (GB)</td>"
$html += "<td style='border:1px solid white;color:white;background-color:black; font-family:verdana;font-weight:bold;'>D Drive total Space (GB)</td>"
$html += "<td style='border:1px solid white;color:white;background-color:black; font-family:verdana;font-weight:bold;'>D Drive free Space (GB)</td></tr>"

# Loop through all the servers in current SharePoint farm
foreach($server in $AllServers)
{
# Server list inclused smtp server, if mail settings are configured in the central admin. we will skip it here
if($server.Name -match "smtp")
{
continue
}
# Get the C Drive and D Drice information for current server.
$cdisk = Get-WmiObject Win32_LogicalDisk -ComputerName $Server.Name -Filter "DeviceID='C:'" | Foreach-Object {$_.Size,$_.FreeSpace} -ErrorAction SilentlyContinue
$ddisk = Get-WmiObject Win32_LogicalDisk -ComputerName $Server.Name -Filter "DeviceID='D:'" | Foreach-Object {$_.Size,$_.FreeSpace} -ErrorAction SilentlyContinue
# Check if server is online
$Status = Test-Connection -BufferSize 32 -Count 1 -ComputerName $server.Name -Quiet

# Create a row for every server information.

$html += "<tr><td style='border:1px solid black;'>" + $Server.Name +"</td>"
$html += "<td style='border:1px solid black;'>" + $Server.Role +"</td>"
$html += "<td style='border:1px solid black;'>" +  $Status +"</td>"
$html += "<td style='border:1px solid black;'>" +   [math]::round((($cdisk[0]/1024)/1024)/1024,1) +"</td>"
$html += "<td style='border:1px solid black;'>" +   [math]::round((($cdisk[1]/1024)/1024)/1024,1) +"</td>"
$html += "<td style='border:1px solid black;'>" +   [math]::round((($ddisk[0]/1024)/1024)/1024,1) +"</td>"
$html += "<td style='border:1px solid black;'>" +   [math]::round((($ddisk[1]/1024)/1024)/1024,1) +"</td></tr>"


}

# Close the HTML table
$html += "</table>";
$html

}

# Get all the information for E-Mail Body
$MailBody = GetServerDetail

# Send Email body
send-mailmessage -from "SharePoint 2013 <sharepoint2013@test.com>" -to "User01 <user01@test.com>" -subject "SharePoint Server Monitoring" -body $MailBody -BodyAsHtml -priority High -dno onSuccess, onFailure -smtpServer smtp.test.com

Following out put will be received in an email.

Server Name/IP
Server Role
Online
C Drive total Space (GB)
C Drive free Space (GB)
D Drive total Space (GB)
D Drive free Space (GB)
Server01
Application
True
99.7
35.1
50
8.4
Server02
Application
True
99.7
13.4
50
9.1
Server03
Invalid
True
99.7
63.4
452
136.9
 

 

Tuesday, October 27, 2015

The URL 'Filepath\Filename.xlxs' does not exists. It may refers to a nonexistent file or folder, or refer to a valid file or folder that is not in current web

All of sudden, while you are using SharePoint in routine a certain error start appearing while creating or uploading a file to a SharePoint list or library.

Error: The URL 'Filepath\Filename.xlxs' does not exists. It may refers to a nonexistent file or folder, or refer to a valid file or folder that is not in current web

While browsing through the application and you know that the library/list path is valid, just copy the correlation ID and see what happen in log.



Log will show some SQL Server error just like below.

SqlError: 'The transaction log for database 'WSS_Content_01' is full due to 'ACTIVE_TRANSACTION'. '    Source: '.Net SqlClient Data Provider' Number: 9002 State: 4 Class: 17 Procedure: 'proc_WriteStreamToSQL' LineNumber: 21 Server: 'Server909'

Unknown SQL Exception 9002 occurred. Additional error information from SQL Server is included below.  The transaction log for database 'WSS_Content_01' is full due to 'ACTIVE_TRANSACTION'.

Unknown SQL Exception 3903 occurred. Additional error information from SQL Server is included below.  The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.

Solution:

There are two possibilities either the drive where your database file resides is full or the Log/Data file for database do not have enough space for further transaction. The SQL Exception 9002 occurs for the same reason.

If you know much about SQL Server, you can try giving more space to database files otherwise contact your DB Admin.

Tuesday, October 13, 2015

PowerPivot Error: could not find the schedule for this work item

Error: could not find the schedule for this work book


There is a fix from Microsoft for this error. visit the link below.

FIX: PowerPivot workbook cannot do data refresh in SharePoint 2013 after you apply SQL Server 2012 CU7 or in SQL Server 2014

Steps to fix the error:

  • Open the workbook in Microsoft Excel 2013.
  • On the File menu and click Info.
  • Click Properties, and then click Advanced Properties.
  • In the Advanced Properties dialog box, click the Custom tab. Then, click each property in the Properties list that has a name that resembles pppDRSplitSchedulePrefix and is followed by a number.
  • click Delete to remove all properties that matches above mentioned criteria before you go to the next property.
  • Click OK.
  • Save the file to SharePoint or Save it locally and upload to Power Pivot gallery in SharePoint.

Wednesday, August 12, 2015

Managed Metadata: How to create Term Sets and Terms



In my previous post I have given an introduction to Term Store Management Tool.  In this post I will describe creating Term Sets and Terms.

The foremost thing admins or SharePoint Users doing in Terms Store Management Tool is creating Term Sets and Terms.

In order to create a term set navigate to Term Store Management Tool either by going to Central admin’s managed metadata service application or through Site Settings page in a site collection, you will see the following screen.



To create a Terms Set we need a Group. Right click on Term store such as “Managed Metadata Service” and click “New Group” in the context menu that appears.



New group will appear in the Tree. I have create a Group call Vehicle.



Admin can add multiple users or user groups to manage a group in term store called Group managers. Group managers can add contributors to a group and perform all activities like creating Term Sets and Terms. Contributor are set of users or user groups who can add\edit Term Sets and Terms.

A group can contain multiple Term Sets. Right click on Group name and Click “New Term Set”. User can also import existing Terms Sets. This feature is more useful while migrating terms sets.



In the vehicle Group I have created a Term Set called “Cars”.



A number of properties are available to be set for Term Set. On the General Tab, Owner of the Term Set is the one who manages the Term Set and can restrict users to perform task in Term Set. The current user creating the Term Set automatically comes here. Stakeholders can be given if some needs to be informed of changed made to term set. Submission Policy is important if Admin wants all users to add new Terms in term set then open should be selected.

On the Intended Use tab, an option for Terms to be available for tagging and the other for availability of Terms to be used as Site navigation are available. Many SharePoint sites use Terms set for Site Navigation so this can used as required.



Next one is Custom Sort tab, where sorting option can be set for terms under the specific Term Set. Terms can be sorted according to selected languages or irrespective of a language.



Custom Properties tab offers to add custom properties for terms. These properties are key value pair and are available for all term in a term set.

Now we can Create a new Term in the newly create Term set called Cars. Right click on Cars Term Set and select Create Term from the context menu.



A single term set can be restricted from tagging by uncheck the first option “Available for Tagging” on the General tab. Language can be selected from the dropdown. Only the installed languages appear here. Synonyms for the Term label or description of abbreviations can be given in Other Labels field.



Custom Properties tab offer to add multiple custom properties other than the given. Custom properties defined in Term Set along with the one uniquely declared for this specific Term.

Once all the properties are set Term is ready for use.