Enable NetBIOS in SharePoint

Enable NetBIOS in SharePoint
We need to enable NetBIOS for User Profile Service Application when Fully Qualified Domain Name is different than NetBIOS name.

To Enable NetBIOS follow the steps.

1) Delete the existing AD connections.
2) Enable the NetBIOS to true for your current user profile service application.
3) Create a new AD connection.

Using power shell we can enable the NetBIOS to import the NetBIOS domain users in to our SharePoint user profile.

By default this NetBIOS is set to disable false (0), using the PowerShell we are enabling to true (1).

Run the below PowerShell command to enable the NetBIOS.

Using the “Get-SPServiceApplication” we can bale to get all the SharePoint application services running in our farm.
Get-SPServiceApplication
Using “Get-SPServiceApplication –Identity GUID” is used to identify the user profile and get in the variable.
$up= Get-SPServiceApplication –Identity GUID
Enabling the NetBIOS using NetBiosDomainNamesEnabled property is setting to true (1)
$up.NetBiosDomainNamesEnabled = “1”
Update the changes.
$up.update()

We can also verify again NetBIOS is enabled or not

Using $up.NetBiosDomainNamesEnabled if it display True NetBIOS is in enabled mode only.


how to get list of site collection and sites last modified date in sharepoint using powershell

how to get list of site collection and sites last modified date in sharepoint using powershell
We having a requirement to know the last modified date for a web application, for the web application having so many site collection and sub sites under the web application doing it manually it will take lot of time, so we prepared a script to know the last modified date under the web application having the list of site collection and its sub sites with URL, Title and site last modified date.

Get-SPWebApplication – Is used to identify the web application URL.
Get-SPSite  – Is used to get the  site collections.
Get-SPWeb – Is used to get the sub sites.

Run the below Power Shell to get all sites last modified information form a particular web application command.

List of sites under Web Application last modified date.

Get-SPWebApplication http://dotnetsharepoint/ | Get-SPSite -limit all | Get-SPWeb -limit all | select url,Lastitemmodifieddate | sort-Object -Property LastItemModifiedDate  > lastmodifiedinformation.txt

Once the script completed, we can verify the list on sites information  in the text file.

In the same way if we want to get the last modified date only for a particular site collection and its sub sites run the below script.

List of sites under Site Collection last modified date.

Get-SPSite http://dotnetsharepoint/sites/SP/ | Get-SPWeb -limit all | select url,title,Lastitemmodifieddate | sort-Object -Property LastItemModifiedDate  > lastmodifiedsitecollectioninfo.txt



Change the site logo hyperlink URL in SharePoint

Change the site logo hyperlink URL in SharePoint
In SharePoint having the site logo I will indicates the link of the current siteURL, when we want to change the different URL we have to do modify in the master page level.

Locate and identify the currently using master page take a backup before modifying the master page.
Best use of modifying the master page using VS or SharePoint Designer.
Open the master page and search for SPSimpleSiteLink.

This is the exact code we can able to find.
     <SharePoint:SPSimpleSiteLink CssClass="ms-siteicon-a" runat="server" id="onetidProjectPropertyTitleGraphic" >
     <SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=23" runat="server"/>
      </SharePoint:SPSimpleSiteLink>

Replace the code with following changes with your URL.

  <SharePoint:SPLinkButton runat="server" CssClass="ms-siteicon-a"  NavigateUrl="http://dotnetsharepoint.com" id="onetidProjectPropertyTitleGraphic">     <SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=23" runat="server"/>
  </SharePoint:SPLinkButton>

SPLinkButton is the property to navigate the URL.

Save the master page and check the logo hyper link url has changed.


There was an error processing the request my site in SharePoint

We are having a My Site in our SharePoint environment,for every one having their own personal site,in that site when they  tried to edit SharePoint profile information we are getting issue

“There was an error processing the request my site in SharePoint”
                        

We are having multiple web applications and one Managed Meta data service application.

Web application 1: http://dotnetsharepoint.com -> connected to Managed Meta data service and all service applications connected with default proxy group.
Web application 2: http://mysite.dotnetsharepoint.com -> not connected to Managed Meta data service and all remaining service application connected with custom proxy group.

Navigate to Central admin->Application management ->Configure service application associations
There we can able to see all the web application connections connected to Application Proxy Default/Custom.

In my case “my site web application” is connected to “Custom proxy group”, click on the custom and check the check box of “Managed Meta data service application” and click ok.

Now navigate to my site and we can able to edit and update the profile information without issues.



Sorry, you're not set up to follow Unfortunately, it looks like your account hasn't been set up to follow documents or sites.


When we are trying to "follow" a document we are getting the error "Unfortunately, it looks like your account hasn't been set up to follow documents or sites."
Using the "Follow" link we can Follow the Sites,Documents,People and #Tags.
Once we are following these features we can keep track of all these changes.

First check weather My Site is Configured or not.

Also make sure that we are having required permissions to follow the content.

Navigate to ->Central Admin->Application Management->Manage service applications->Click on user on your "user profile service application"->Click on Manage User Permissions.
here we have to check the option as shown in the below screen shot.


Once we verified the permissions,now we can able to follow with out any issues.




Sorry something went wrong with adding the app.click to retry

Sorry something went wrong with adding the app.click to retry
We tried to  install an access app and that installation has failed,we are unable to remove the apps in SharePoint through GUI  we got this error "Sorry something went wrong with adding the app.click to retry",The app cannot be removed or uninstalled from GUI,Remove option is also not available.
Navigating to the Site Contents,while seeing the "Access App" corrupted list its not looking good to see.

Finally we tried there is an option using the power shell we can uninstall the corrupted app as shown in the below.


$geturl = Get-SPAppInstance -Web <Your URL Name>

$getapp = $geturl  | where {$_.Title -eq '<app title Name>'}

Uninstall-SPAppInstance -Identity $getapp 


Once the Power Shell ran's completed successfully,go and verify the list is deleted successfully.



How to open the closed web parts in SharePoint?


when we edit the webpart we can able to dropdown options like Close,Delete.
Some times user scared what would happen if they click on delete the webpart,so they will click on close.once click on close the webpart is gone!.
It is very surpriesed how to get back the closed webpart,we can able to see the web part maintenance page by appending with ?contents =1,but it wont usefull to get back the webpart again.

Solution:
Edit the page
Click on the add web part
In the top ribbon "Categories" last option "Closed Parts" click on it,we can able to see the closed web parts.Select the particular webpart and clik on Add as shown in the image below.

Now the closed  web part is appearing, our problem is resolved.


Set the masterpage using PowerShell in SharePoint

Set the masterpage using PowerShell in SharePoint
 Using Power Shell We can easily change our custom master page in our SharePoint site,once we prepare the script we can use for every time to change the master page.
 "Get-SPWeb" i used to get the site URL of the SharePoint in a variable.

We have two Properties to control the master Page settings, CustomMasterUrl and MasterUrl

Site Master Page         ---   CustomMasterUrl
System Master Page    ---   MasterUrl

Example:
$web = Get-SPWeb http://Dotnetsharepoint.com
$web.CustomMasterUrl = "/_catalogs/masterpage/Custom.master"
$web.MasterUrl = "/_catalogs/masterpage/Custom.master"
$web.Update()


If we have a site collection under a managed path like "sites”, we can change using 

“/sites/SITECOLLECTION/_catalogs/masterpage/Custom.master"
$web.CustomMasterUrl = "/sites/DotnetSharePoint/_catalogs/masterpage/Custom.master"
$web.MasterUrl = "/sites/DotnetSharePoint/_catalogs/masterpage/Custom.master


Sign as a different user in SharePoint 2013

As we know that Sign in as a different user option is not available in SharePoint 2013,It is needed for all developers,Testers,Administrators to log in with different account to test the customizations and aslo for checking permissions in a SharePoint sites,but we can also get this option by placing the code in

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES\Welcome.ascx and open it SharePoint Designer,Visual Studio or Text Editor

Add the following sinpet befor having the element with id "ID_RequestAccess" as shown in Screenshot.


<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser"
 Text="<%$Resources:wss,personalactions_loginasdifferentuser%>"
 Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"
 MenuGroupId="100"
 Sequence="100"
 UseShortId="true"
/>

Save and close.
Open the SharePoint Site we can able to see the Sign as a different user Option.

Sometimes we can also able to sign as a different user option in the browser for current sharepoint site,we can also use the following  URL in your browser.

http://<your site URL>/_layouts/closeConnection.aspx?loginasanotheruser=true

It will prompt the Popup with login,once we login it will redirect to the Site.

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Disable alerts in SharePoint

Disable alerts in SharePoint
Power shell will becoming easy to do our tasks,now we are doing how to disable and enable the alerts to the particular web application in SharePoint 2013/2010.

First we have to get the Web Application URL into a variable using the Property "Get-SPWebApplication" and using "AlertsEnabled" property we are trying to enable or disable the alerts using the Power Shell.


To Disable the alerts in the particular Web Application 

$weburl= Get-SPWebApplication "http://DotnetSharePoint/"
 $weburl.AlertsEnabled = $false
$weburl.Update()

 To Enable alerts in the  particular Web Application

$weburl= Get-SPWebApplication "http://DotnetSharePoint/"
$weburl.AlertsEnabled = $true
$weburl.Update()

Disable Alerts for List

In the same way some times we have to disable the alerts to the particular list there is no OOTB feature to disable the alerts to particular list,but we do it by using jquery/java script read the current page URL and list, disable the button in the ribbon.


How to hide and readonly columns in SharePoint list view using jquery

How to hide and readonly columns in SharePoint list view using jquery

Hide column in SharePoint List view 

To hide the column in custom list  new or view or edit form, we can use the below script to do the same. we need to edit the view or edit form page and add a content editor web part in that we have to include the below script to hide the column based on the requirement.

<script src="c:Jquery/jquery-1.11.0.min.js" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function() {

//Contains (It will hide all the column which contains the word "Test")

 $("nobr:contains('Test')").closest('tr').hide();

//For single text alone
   $("input[title='Test']").closest('tr').hide();

</script> 

ReadOnly Column in SharePoint Editview

To make the column as read only in custom list  new or view or edit form, we can use the below script. we need to edit the view or edit form page and add a content editor web part in that we have to include the below script to make the column read only based on the requirement.

<script src="c:Jquery/jquery-1.11.0.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {

   $("input[title='Test']").attr('readonly', true);

</script> 


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

sorry we're having trouble refreshing your tasks sharepoint 2013

We enable my site with all the feature having a task list in the quick launch,we created a new tasks in the site,when we tried to refresh the tasks i was not refreshing it was  showing an error as shown  in the screen shot.
                          

Resolution:

Step 1: we have to check the "Work Management Service Application" is there or not,Navigate to Central Admin->Application Management->Service Application.If my case  service application is available as shown below.



Step 2: Now check the service is in started mode or not,Navigate to Central Admin->Application Management ->Manage  services on server.check the status.
In my case it was not started.click on start.






Step 3:
Also verify the Service having permissions with "Application Pool" Service account with Full Control.
In my case i given the application pool Service  account with full control to "Work Management   Service Application"

Finally we verified at tasks,it was refreshing with out any issues.




user profile synchronization service stuck on starting


In SharePoint while trying to start the User Profile Sync it will stuck in a starting stage for a long time and also we are unable to stop this using GUI,because of this we are unable to go forward to do any activity related to User Profile.So now our aim is we have to stop this service immediately. 

In SharePoint PowerShell/Stsadm  will becoming very useful for most of the situations, in our case also we are trying to stop the Sync immediately using the Power Shell/Stsadm  Command..


using Stsadm command we can stop this service immediately

stsadm -o provisionservice -action stop -servicetype “Microsoft.Office.Server.Administration.ProfileSynchronizationService, Microsoft.Office.Server.UserProfiles, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” -servicename FIMSynchronizationService



Now we can able to see the user profile syn service is stopped successfully .



How to configure the Search Center Url in SharePoint Using PowerShell

How to configure the Search Center Url in SharePoint Using PowerShell
In some cases if we want to enable  "Global Search Center URL" as enterprise search center site URL in our entire SharePoint  farm.

Instead of enable this through GUI,we can easily achieve this user power shell.
First we have to get the Search Service Application in to a variable
Using  "Get-SPEnterpriseSearchServiceApplication".
Using the "SearchCenterUrl" set the enterprise URL and update it as per the requirement.

Run the below Power Shell Command.

$sa = Get-SPEnterpriseSearchServiceApplication
$sa.SearchCenterUrl = "http://sitename/SearchCenter/Pages"
$sa.Update()

Once the Power Shell runs completed successfully,check the search is affected in our environment or not,even through its not affected some times we have to do IISRest.




How to Start the User Profile Synchronization Service Using PowerShell

How to Start the User Profile Synchronization Service Using PowerShell
Some times we are unable to start and stop the User Profile Synchronization Service from GUI,still there is way do  using power shell.

Using Get-SPServiceInstance

To get the list of all the services "guid" with  Power Shell command,but it is difficult to identify the exact user profile service if we are using multiple user profile services and for further reference best use to save the services in to a Text file.
 Run the below command as shown.

Get-SPServiceInstance > Services.txt

It will writes the list of all the services with name and "guid" in to the text file,we can able to find the file with our given file name  at C:/Users/Username

Start-SPServiceInstance –Identity "Guid of Particular Service Application"

In the same way if we want to Stop the User Profile Synchronization Service use the following command.

Stop-SPServiceInstance –Identity "Guid of Particular Service Application"



Create custom permission levels in SharePoint 2013


In Most of the cases  we have to create the custom permissions based on our requirement like "No Delete" and also to restrict the users to "create sub sites".
Already we having default groups like "Full Control","Contribute" but we need the same contribute with out delete in this case we have to create custom permissions.

First we have to create a permission level at site collection level as per the below steps.


Navigate to ->Site Settings->Site Permissions->Top Ribbon Click on Permissions Levels

Here we can able to create by clicking on the "Add a Permission Level" as shown below


We can able to check the Permissions based on our requirement example i am selecting "Select All"

Click on Create.

Now we able to see the our newly created custom permissions.



Now we can add the users in to our newly created custom group permissions.






Could not load user profile SharePoint 2013


After creating My Site when the user try to Click on "Newsfeed" or any my site related features.we are getting the error "Could not load user profile",based on the error message we can able to identify that user profile service application is not connected with that web application in most of cases we will the issues in all the site collections and its sites.

In my case Issue resolved follow the steps



Central Admin->Application Management->Under Service Applications->Click on Configure service application associations

Click on the Appliction Proxy Group->default->Uncheck the User Profile Service Application Click ok.

Again Check the User Profile Service Application Click ok.

Now check it will works,if still we are getting the same issue wait for few minutes and try again.
If this issue not yet resolved, go the user profile service application check weather we can able to access the user profile with out any issues.


How to enable anonymous access in SharePoint 2013

When we enable anonymous access to a website, you allow anonymous users (and authenticates users who have not been granted access to the site).
Go to->Central Administration->Application Management->Manage Web Applications

Select the web application for which you need to enable anonymous access

                          

Click on the Authentication Providers
                           

We can see the Membership Provider Name as “Claims Based Authentication”
Click on the Zone Default
                                 
Select Enable anonymous access
 Click on Save
Once you enable at webappliation level then we have to do it at site level
Go to Site Settings->Site Permissions
                                    
Top Ribbon Click on Anonymous Access


 There we can see the three options like
1)Entire Web Site
2)List and Libraries
3)Nothing

By default I will select nothing
Now I am selecting the Entire Website we can able to access the entire site.
Click on OK.


Once we select the Entire Website, will show in the permission like Group Name as Anonymous Users and permission level is for entire web site.




Now Anonymous Users able to browse the Site I will show with Sign In.




SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Hiding Sites,Sky drive and NewsFeed from SharePoint 2013 Sites

In some cases we have to hide the My site features "Sites,Sky drive and Newsfeed" in entire SharePoint farm environment.
with out using the CSS styles there is a way we can do it by deactivating the feature at "Manage farm features" level.




Please follow the steps with navigation's to disable all the my site features.
Navigate->Central Admin->System Settings->Farm Management->Manage farm features
Click on the Manage farm features there we can able to see the "Social Tags and Note Board Ribbon Controls" Feature in Active State as shown in the Image



                 Once we deactivated the Feature Social Tags wont available.

In feature need to enable the my site feature dont forget to activate the SharePoint feature again.



How to delete a list in SharePoint Using PowerShell

How to delete a list in SharePoint Using PowerShell
Having a Corrupted list on our SharePoint site,we tried to delete the list through GUI but i am unable to delete that particular list.
In most of the cases Power Shell is with us to do all these activities.
In my case i am using "Get-SPWeb" to access the particular site in to an variable and using"lists" accessing the particular list with name,"AllowDeletion" is used to allow to delete and updating.

using Power Shell we can delete the List

    $web = Get-SPWeb -Identity "Your SiteName"
    $list = $web.lists["Your list name"]
    $list.AllowDeletion = $true
    $list.Update()
    $list.Delete()

Check once script runs completed successfully,list will be deleted.


A list, survey, discussion board, or document library with the specified title already exists in this Web site. Please choose another title.

We tried to create a new  a list,we are getting an error like"sorry something went wrong A list, survey, discussion board, or document library with the specified title already exists in this Web site.  Please choose another title. "

To resolve this problem

Go to Site Content and see if the library or list exists with same,if it is,delete it.
If you are unable to see it there open the site in SharePoint designer see if the list or library having the same name delete it.

Please make sure while deleting exact name..
Hit F5
Now it will works to Create a list or library


How to get the template name in sharepoint using powershell

How to get the template name in sharepoint using powershell
Sometimes in Production we want to know the template name for the current site we are using.
Using below Power Shell we can find the Template name easily.

$currentweb = Get-SPWeb  http://DotNetSharePoint:1234/sites/Sharepoint
write-host "Web Template:" $currentweb.WebTemplate " | Web Template ID:" $currentweb.WebTemplateId
$currentweb.Dispose()

OutPut:Web Template: STS | Web Template ID: 1 // For Team Site

Site Template ID with Name:
0 - GLOBAL (SetupPath=global) - "Global template"
1 - STS - "windows SharePoint Services Site", "Team Site", "Blank Site", "Document Workspace"
2 - MPS - "Basic Meeting Workspace", "Blank Meeting Workspace", "Decision Meeting Workspace", "Social Meeting Workspace", "Multipage Meeting Workspace"
3 - CENTRALADMIN - "Central Admin Site"
4 - WIKI - "Wiki Site"
7 - BDR - "Document Center"
9 - BLOG - "Blog"
20 - SPS (OBSOLETE) - "SharePoint Portal Server Site"
21 - SPSPERS - "SharePoint Portal Server Personal Space"
22 - SPSMSITE - "Personalization Site"
30 - SPSTOC (OBSOLETE) - "Contents area Template"
31 - SPSTOPIC (OBSOLETE) - "Topic area template"
32 - SPSNEWS (OBSOLETE) - "News area template"
33 - SPSNHOME (SubWebOnly) - "News Home template"
34 - SPSSITES - "Site Directory area template"
36 - SPSCOMMU (OBSOLETE) - "Community area template"
38 - SPSREPORTCENTER - "Report Center Site"
39 - CMSPUBLISHING (SetupPath=SiteTemplates\PUBLISHING) - "Publishing and Team Collaboration Site"
40 - OSRV (SetupPath=SiteTemplates\OSRV) - "Shared Services Administration Site"
47 - SPSPORTAL - "Corporate Intranet Site"
50 - SRCHCEN - "Search Center"
51 - PROFILES - "Profiles"
52 - BLANKINTERNETCONTAINER - "Internet Presence Web Site"
53 - BLANKINTERNET - "Publishing Site", "Press Releases Site", "Publishing Site"
54 - SPSMSITEHOST - "My Site Host"
90 - SRCHCENTERLITE (SetupPath=SiteTemplates\SRCHCENTERLITE) - "Search Center Lite"
6221 - PWA (SetupPath=SiteTemplates\PWA) - "Project Web Access Site"
6215 - PWS (SetupPath=SiteTemplates\PWS) - "Project Workspace"
14483 - OFFILE - "Records Repository", "Records Repository"

Reference Template ID's from  http://social.technet.microsoft.com/


Backup and Restore List in SharePoint Using PowerShell

Backup and Restore List in SharePoint Using PowerShell
Some times we have to take the Backup for List with data form one site collection to another site collection  using power shell, we can do our task simply
I am having a list with name "DotNetSharePoint" we have to refer the List with /Lists/YourListName.

Taking Back Up List from One Site Collection
Export-SPWeb "Site Url" -itemurl "/Lists/YourListName" -Path "YourPath"
Example:
Export-SPWeb -Identity "http://SharePoint:6789/sites/DotNet" -Itemurl "/Lists/DotNetSharePoint" -Path "c://DotNetSharePoint.cmp"

Restoring the Backup List to Another Site Collection.

Import-SPWeb -Identity "Site Url" -Path "YourPath" -force
Example:
Import-SPWeb -Identity "http://DotNetSharePoint:1234/sites/SharePoint" -Path "c://DotNetSharePoint.cmp" -force

"-force"  is used to overtire the existing list having the same name.


How to create a new content database in sharepoint using powershell

How to create a new content database in sharepoint using powershell
In this article we will know,how to create a new content database using power shell

Using New-SPContentDatabase  Create a new content database and attach it to the web application

New-SPContentDatabase "yourdatabasename" -DatabaseServer "yourdbservername" -WebApplication http://yoursitename

Example
New-SPContentDatabase "DotNetSharePointDB" -DatabaseServer "DotNetSharePoint" -WebApplication http://dotnetsharepoint:1234

Also we can keep the Maximum Number of Site Collections and Site Collection Level Warning using -MaxSiteCount and -WarningSiteCount

New-SPContentDatabase "DotNetSharePointDB" -DatabaseServer "DotNetSharePoint" -WebApplication http://dotnetsharepoint:1234 -MaxSiteCount 2 -WarningSiteCount  1


Export and Import subsite in sharepoint using PowerShell

Export and Import subsite in sharepoint  using  PowerShell

Using PowerShell we can do Export and Import subsite's in sharepoint  using  PowerShell

Export-SPWeb yoursiteurl –Path "YourPathwith CMPName" -includeusersecurity 
Example
 Export-SPWeb http://dotnetsharepoint.com/sites/dotnet/dotnetsharepoint/ –Path "C:\BackUp\DotNetSharePoint.cmp" -includeusersecurity  

Import-SPWeb yoursiteurl -Path "YourPathwith CMPName"  -IncludeUserSecurity -Force
Example                        
Import-SPWeb http://dotnetsharepoint.com/sites/dotnet/sharepoint/ -Path "C:\SiteBackUp\DotNetSharePoint.cmp"  -IncludeUserSecurity -Force

-IncludeUserSecurity
To get the Users with Groups and Permissions

-Force
Is used to over write the existing site


How to deploy WSP Globally in SharePoint Using PowerShell

 How to deploy WSP Globally in SharePoint Using PowerShell
In this article we will know how to deploy WSP Globally in SharePoint Environment.
First place the WSP in a particular location in our example we placed WSP in C drive.
Open Management Shell and run the script one by one.

Add Solution Package to the Server

Add-SPSolution  C:\DotNetSharePoint.WSP

Deploying WSP Globally

Install-SPSolution  DotNetSharePoint.WSP  -GACDeployment

Uninstall the WSP from the Server

Uninstall-SPSolution –identity DotNetSharePoint.WSP

Remove the WSP from the Server

Remove-SPSolution –identity DotNetSharePoint.WSP


How to update existing WSP in sharepoint Farm using PowerShell

How to update existing WSP in sharepoint Farm using PowerShell
In this article we all learn about updating the new WSP with out retracting the existing WSP.

Using Power Shell we are  updating the new WSP with new custom changes in our  SharePoint Farm.

Take the backup of existing WSP,it may useful in future.
here we can able to find the article How to download WSP file Central Admin

Syntax:

Update-SPSolution –Identity yourwspname.wsp –LiteralPath "WSP Path" –GacDeployment

Example:

Update-SPSolution –Identity DotNetSharePoint.wsp –LiteralPath "C:\DotNetSharePoint.wsp" –GacDeployment



Enabling or Disabling the Claims Based Authencation using PowerShell

Web application is already provisioned with classic,there is no GUI option to change the classic mode to claims but using power shell we can do it.

In Central Admin->Application Management->Manage Web application

Select the particular web application in top ribbon click on the Authentication Providers,there we can see the membership provider name Claims or Classic.

     

Now i am changing the classic to claims using the below power shell

$claims = Get-SPWebApplication "http://DotNetSharePoint:23456/"
$claims.UseClaimsAuthentication = 1;
$claims.Update()

Again i am changing the claims to classic using the below power shell

                               
$claims = Get-SPWebApplication "http://DotNetSharePoint:23456/"
$claims.UseClaimsAuthentication = 0;
$claims.Update()

Finally go verify it once for conformation.

How to create webapplication in sharepoint using powershell

How to create webapplication in sharepoint using powershell
Using Power Shell we can create the web application easily.
Open the SharePoint Management Shell and run this command

$siteName = "DotnetSharePointSite"

$port = 23456

$url = "http://dotnetsharepoint"

$appPoolName = "DotnetSharePoint- 23456"

$managedAccount = "dotnetsharepoint\lakshmi"

$dbServer = "dotnetsharepoint"

$dbName = "DotNetSharePoint"



New-SPWebApplication -Name $siteName -Port $port  -URL $url -ApplicationPool 

$appPoolName -ApplicationPoolAccount (Get-SPManagedAccount "$managedAccount") 

-DatabaseName $dbName -DatabaseServer $dbServer 

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Add SharePoint Calendar ListView in Page programmatically

Add SharePoint Calendar ListView in Page programmatically
 In my previous article i explain about  how to add  SharePoint list view in page
Add SharePoint ListView in Page
Add SharePoint ListView in Page

   We are going to add default calendar view in ASPX page.  I tried to use html normal view, but it's not showing calendar. after googling i found the solution. For calendar we have to change the Type and add Scope, RecurrenceRowset.

In Elements we have to add default calendar view , add the following code in Elements.

  <File Path="Module1\Calendar.aspx" Url="Calendar.aspx" Type="GhostableInLibrary">
      <View List="Lists/Calendar" BaseViewID="2"  WebPartZoneID="WPListcalendarView" WebPartOrder="1"  DefaultView="TRUE" DisplayName="Calendar" Name="Calendar" Type="CALENDAR" Scope="Recursive" RecurrenceRowset="TRUE">
      </View>
   </File>

ASPX page have to call the calendar webpart, add the following code in ASPX page.

<asp:Content ID="Content" ContentPlaceHolderID="PlaceHolderMain" runat="server">
 <WebPartPages:WebPartZone ID="WPZMOC" runat="server">
                <ZoneTemplate></ZoneTemplate>
            </WebPartPages:WebPartZone>
</asp:Content>

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to create managed path in SharePoint using PowerShell

How to create managed path in SharePoint using PowerShell
Using Power Shell we can create it easily
Open the SharePoint2013 Management Shell
Use the below commands to create and remove the managed path for Explicit and Wild

Creating the Managed Path Explicit
New-SPManagedPath -RelativeURL "my" -WebApplication "http://SharePoint:1234/" – Explicit


Creating the Managed Path Wild
New-SPManagedPath "personal" -WebApplication http://SharePoint:1234/

Remove Managed

Remove-SPManagedPath -Identity " personal "  -WebApplication "http://SharePoint2013:1234/" -confirm:$false 

If we want to get the all managed paths for that particular web application

Get-SPManagedPath  -WebApplication http://SharePoint2013:1234/

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

SharePoint people picker display as read only

SharePoint people picker display as read only
  
 We have to make people picker readonly by Programmatically

       <SharePoint:PeopleEditor
                AllowEmpty="false"
                ID="ppk"
                runat="server"
                SelectionSet="User"
                class="peopleedit" MultiSelect="false"   />


     We can easily enable people picker using "Id"

 Example:   ppk.Enabled = false;


If we have to hide only show button and allow typein here is the 
Example:    ppk.ShowButtons = false;    
                 ppk.AllowTypeIn = false;


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Copy Files between SharePoint Document Libraries Using Power Shell

Copy Files between SharePoint Document Libraries Using Power Shell
      I am having a Site Collection, in that am having two document library’s, once library having files i want to copy the same files to move the another library.
Using the below power shell I implemented this.

Add-PsSnapin Microsoft.SharePoint.PowerShell
#Refereing the SiteCollection URL
$web = "http://dotnetsharepoint:1234/sites/sharepoint/"
#Refereing the Source DocumentLibray Having Files
$sourLibrary = (Get-SPWeb $web).Folders["SourceLibraryName"]
#Refereing the Destination of DocumentLibray to place Files
$destLibrary = (Get-SPWeb $web).Folders["DestinationLibraryName"]

$destFiles = $destLibrary.Files
foreach ($file in $sourLibrary.Files)
{
    $currentFile = $file.OpenBinary()
    $destURL = $destFiles.Folder.Url + "/" + $file.Name
    $destFiles.Add($destURL, $currentFile, $true)




There was a problem retrieving data for this field. Updating values in the field is disabled temporarily.You can still update values in other fields

"There was a problem retrieving data for this field. Updating values in the field is disabled temporarily.You can still update values in other fields"

I am getting this Issue while editing the Profile in “My Site”
                  
Fields are related to Managed Meta Data Service Application, it required the Managed Meta Data Service Application to be started (or) The Managed Meta Data Service Connection is missing from the associated Proxy Group.

1) Make sure that Managed Meta data web service is started in Application management ->Service Application ->Manage Services on Server

                      

2) Make sure that Service Applications “Managed Meta data service” created and started in
 Application management ->Service Application ->Manage Service Application

                        
3) Make Sure that Managed Meta Data” Service Connection” is associated Proxy Group or not.
In my Case it is not associated.
Application management->Manage Web Applications->Select the Particular web application you are using for my site->Click on the “Service Connection” in the top ribbon.
Make it associated as shown



 Now reload the Page it will work fine.


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

The default term store for this site cannot be identified

I am having a  SharePoint Site

For a document library i am creating a meta data column,I selected the customize your term set at that time i am getting this error


                             

Solution:
 Navigate to ->Central Administration ->Application Management->Manage Service Applications

Select Managed Metadata Service Connection and click properties in the ribbon interface


Select "This service application is the default storage location for column specfix term sets" option in the
Managed metadata Service Connection page.


Click ok.

Now we can able to Create local term sets which are site collection specific.

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

The URL is not available, does not reference a SharePoint site, or you do not have permission to connect

I am trying to connect SharePoint URL in dashboard designer,it prompt's a message

"The URL is not available, does not reference a SharePoint site, or you do not have permission to connect"

To know the more information about this
Checked the Event logs ->Event Viewer ->Windows Logs->Application logs

I am getting Error message

SQL database login for 'SharePoint_Config' on instance 'DBServerName' failed. Additional error information from SQL Server is included below.
Login failed for user 'domain\userName'.

This account dont have permissions on the SQL database.
Run this below script in SharePoint 2013 Management Shell

$w = Get-SPWebApplication ("Web Application Name")
$w.GrantAccessToProcessIdentity("domain\userName")

This command will do the following

Creates a domain\userName as a new user for the DB associated with the web application Name.
Assigns db_owner role to domain\userName
It will creates a new schema for domain\user Name


The Datasource cannot be used because PerformancePoint Services is not configured correctly

The Datasource cannot be used because PerformancePoint Services is not configured correctly
When we trying to create a datasource for PerformancePoint Services(PPS),Getting the error.

The Datasource cannot be used because PerformancePoint Services is not configured correctly

This Cause of this error, we did not configured PPS correctly.

Navigate to Central Admin->Application Management->Manage Service Application

Click on the "Performance Point Service" and select the "Performance Point Service Application Settings"

Give  the Unattended Service account Username and Password,Click ok.

Now go and try the selecting the database in Dashboard Designer.


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to download all wsp files from Central Admin

How to download all wsp files from Central Admin

If you want to take the backup of all the wsp files from your central admin.

Use this Power shell Script.


$pathName = "c:\WSPFiles\"
foreach ($solution in Get-SPSolution)
   {
 
    $solid = $Solution.SolutionID
    $title = $Solution.Name
    $filename = $Solution.SolutionFile.Name
    $solution.SolutionFile.SaveAs("$pathName\$filename")
}


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to download WSP file Central Admin

How to download WSP file Central Admin
Some times we need to take the backup of WSP file,if you don't have back of the old WSP file
we can get it easily from central admin,before deploying the new WSP.

 using power shell run this below script.

$SPFarm = Get-SPFarm
$getWSP = $SPFarm.Solutions.Item(“dotnetsharepoint.wsp”).SolutionFile
$getWSP.SaveAs(“C:\dotnetsharepoint.wsp”)

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to configure SharePoint Outgoing Email Settings using powershell

I prepared a script,easy way to configure the outgoing email using powershell.

Here we check the image before executing the script


$SMTPServer = 'mail.dotnetsharepoint.com'
$FromAddress = 'jlakshmitulasi@dotnetsharepoint.com'
$ReplytoAddress = 'jlakshmitulasi@dotnetsharepoint.com'
$Charset = 65001

$CAWebApplication = Get-SPWebApplication -IncludeCentralAdministration | Where { $_.IsAdministrationWebApplication }
$CAWebApplication.UpdateMailSettings($SMTPServer, $FromAddress, $ReplytoAddress, $Charset)


Here we can check the output after executed the script
                            

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Activating and Deactivating Features in a SharePoint Site Collection Using Power Shell

If we want to know the list of features activated in your Site Collection
Run the following command in SharePoint 2013 Management shell



It will gives list of features with DisplayName,ID

For activating or deactivating  the feature use we can do based on Feature Name or Feature ID

Activating the Feature:

Enable-SPFeature –Identity FeatureIDhere –url  http://DotNetSharePoint:1234/sites/SharePoint
Or
Enable-SPFeature –Identity FeatureNamehere –url  http://DotNetSharePoint:1234/sites/SharePoint


Deactivating the Feature:

Disable-SPFeature –Identity FeatureIDhere –url  http://DotNetSharePoint:1234/sites/SharePoint
Or
Disable-SPFeature –Identity FeatureNamehere –url  http://DotNetSharePoint:1234/sites/SharePoint


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to rename WSP file in SharePoint

The SharePoint Project name will come as a WSP name, some time when we need to rename the WSP file.

In Visual Studio->Navigate to Package->Click on the Package.package


Previous I am getting the WSP with name SharePointSolution1.WSP.



Now I want change the Name to DotNetSharePoint 


Save it.

Now I can get WSP name as DotNetSharePoint.WSP

Once it’s done, restart the visual studio get the WSP file with modified name.

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

This control is currently disabled

 When i am  trying to deploy sandbox solution in SharePoint site, it was showing an error as "This control is currently disabled".I am unable to activate the solution as shown below.



 I tried to figure out the solution that "Microsoft SharePoint Foundation Sandboxed Code Service" was not started in central admin .To resolve this issue we have to start the "Microsoft SharePoint Foundation Sandboxed Code Service".

Navigate to CA->Manage Services on Server->









SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to change the site logo in SharePoint

Sometimes we have to change the site logo based on the requirement, It is very easy to change using the Out of box feature.

Navigate to Site Settings

  Under Look and Feel
   Click on Title, description, logo

Now I am adding the logo from my computer.


Added the image click ok.

If we want to add the logo from SHAREPOINT we can add the image in “15 hive” on the file system then the URL will come as “/_layouts/Images/YourLogname.jpg”.

Logo is changed as shown below.




SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Check the Duplicates Values in SharePoint List

How to Check the Duplicates Values in SharePoint List


<div>
    <label>EmployeeName</label>
    <asp:TextBox ID ="txtempname" runat ="server"></asp:TextBox>
    <asp:Label ID ="lblerror" runat ="server" Text ="Employee Name Already Available" Visible ="false" ForeColor ="Red"></asp:Label>
</div>
<div>
    <asp:Button ID="btnInsert" runat ="server"  Text ="Submit" OnClick="btnInsert_Click" />
</div>


  protected void btnInsert_Click(object sender, EventArgs e)
        {
            using(SPSite site = new SPSite(SPContext.Current.Web.Url))
            {
               using( SPWeb web = site.OpenWeb())
                {
                   SPList list = web.Lists["EmployeeInfo"];
                   SPQuery checkduplicates = new SPQuery();

                   checkduplicates.Query = "<Where><Eq><FieldRef Name='Name' /><Value Type='Text'>" + txtempname.Text.ToString().ToLower() + "</Value></Eq></Where>";
                   SPListItemCollection myListColl = list.GetItems(checkduplicates);
                   if (myListColl.Count > 0)
                   {
                       lblerror.Visible = true;
                     
                   }
                   else
                   {

                       SPListItem item = list.Items.Add();
                       item["Name"] = txtempname.Text;
                       item.Update();
                   }

                }

            }

        }

OutPut:

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM