Tuesday, November 8, 2016

Script for Detach and Attach Web Application Content DBs

Get Web App Db’s:

Get-SPContentDatabase -WebApplication http://demo.Test.com | select -expand name |out-file "d:\sp\sp patching\dbinfo\demo.txt"

Remove Web App Db’s:

Get-SPContentDatabase -WebApplication http://demo.Test.com | Dismount-SPContentDatabase

Add Db’s to Web App:

$dbs = @(Get-Content -path "d:\sp\sp patching\dbinfo\tpm.txt" )
For ($ii=0; $ii -le $dbs.Length - 1;$ii++)
{
               Mount-SPContentDatabase -Name $dbs[$ii] -WebApplication http://demo.Test.com
}

Wednesday, July 27, 2016

Sample Codes

Creating Sharepoint site columns, Content type, and List in App model(Sharepoint Hosted).

Steps :
1. Open visual studio and Create Sharepoint hosted App.
2. Creating List Columns.
3.Creating Content type.
4, Creating List using existing content type.5.Deploying

Source code: Click here to down

Thursday, July 14, 2016

Java Script Tools


JavaScript Tool for Visual Studio 

web Essentials : 

https://visualstudiogallery.msdn.microsoft.com/56633663-6799-41d7-9df7-0f2a504ca361

JavaScript Parser For Visual Studio 

https://visualstudiogallery.msdn.microsoft.com/288a2b0f-1357-47b4-8215-1134c36bdf30

LSLint for Visal Studio

https://visualstudiogallery.msdn.microsoft.com/ede12aa8-0f80-4e6f-b15c-7a8b3499370e


Json Tool

http://jsonviewer.codeplex.com/

Browser Tool : 

Firebug,IE,&Chrome 

http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2014/02/26/useful-javascript-for-working-with-sharepoint-display-templates-spc3000-spc14.aspx



JavaScript resouce : 



https://msdn.microsoft.com/en-us/library/fp179912.aspx


Sharepoint Javascript files : 

Out of box java script file 

Core.js
Menu.js
Callout.js
Sharing.js
SuitLinks.js
Init.js
Sp.js


Variables :

_spPageContextInfo 

Culture/Locale information
Server-relative URL for site
Absolute URL for Site
Current page relative URL
Pages ListID
Web Title
Web UI Version


REST API

SharePoint 2010 

/_vti_bin/listData.svc

SharePoint 2013 

Listdata.svc is deprecated.

still available for backwards compatibility

RESTful  operations added to /_vti_bin/Client.svc
/_api added as an alias for /_vti_bin/Client.svc










Saturday, June 4, 2016

SharePoint 2013 Service Application creation

SharePoint 2013: Service Applications Guide


Table of Contents

SharePoint 2013: Service Accounts

Table of Contents


Ref : http://social.technet.microsoft.com/wiki/contents/articles/14500.sharepoint-2013-service-accounts.aspx#SPProf


  • SQL Server Accounts
    • SQL Admin
    • SQL Service
  • SharePoint Server Accounts
    • SP Admin
    • SP Farm
    • SP Web Application
    • SP Services
    • SP C2WTS
    • SP Cache Super User
    • SP Cache Super Reader
    • SP Excel User
    • SP Visio User
    • SP PerformancePoint User
    • SP Profile
    • SP Profile Sync
    • SP Search Crawl
  • Project Server Accounts and Groups
    • PS Project
    • PS Workflow Proxy
    • PS Project Report
    • PS Project Report Authors
    • PS Project Report Viewers
    • PS Project External Report Viewers

Friday, March 4, 2016

Replicating Directory changes

This guide is a step by step guide with Screenshots to give the “Replicating Directory changes” rights to the SharePoint user profile account that will be used to synchronize the user profiles.The screenshots were taken in Windows Server 2012, however the steps are identical or  very similar in Windows Server 2008 and 2008 R2. 

The Guide

In Active Directory Users and Computers, right-click the domain, and then click Delegate Control.
On the first page of the Delegation of Control Wizard, click next.
On the Users or Groups page, click Add.
Type the name of the synchronization account, and then click OK.
Click Next.
On the Tasks to Delegate page, select create a custom task to delegate, and then click Next.
On the Active Directory Object Type page, select this folder, existing objects in this folder, and creation of new objects in this folder, and then click next.
On the Permissions page, in the Permissions box, select Replicating Directory and then click Next.
Click Finish.
 
 
 
Source :https://absolute-sharepoint.com/2012/12/step-by-step-guide-to-configure-the-replicating-directory-changes-for-sharepoint-2010-and-2013.html
 

Wednesday, January 27, 2016

Renaming the SharePoint Admin Content Database to Follow SQL Server Naming Conventions

Solution
In a previous tip, Introduction to SharePoint 2010 for SQL Server DBAs, you were introduced to the different types of databases that SharePoint uses. The SharePoint Central Admin database is a configuration database that stores site content and permissions for the Central Administration web application. As a DBA, we are concerned with backing up and restoring all of the SharePoint databases. While the Central Admin Content database is backed up when a SharePoint farm administrator performs a farm configuration backup, it doesn't get restored when a farm is restored. We can backup and restore the SharePoint Admin Content database separately using native SQL Server backup tools. The challenge here is dealing with a database name that has a GUID value.
Here is an example of the SharePoint database name.
 
the SharePoint Admin Content database
If you have a corporate policy to standardize database naming conventions or use custom database maintenance scripts, it is imperative to rename the SharePoint databases to eliminate those GUID values, starting with the SharePoint Admin Content. While most recommendations will tell you to rename your SharePoint databases accordingly during creation, in most cases, we DBAs are not included as part of the initial planning and deployment process. Thus, we end up with SharePoint databases with such naming conventions. To accomplish this task, we will be using Windows PowerShell via the SharePoint 2010 Management Shell console. Remember to backup the database prior to performing the tasks below.
  1. On the SharePoint web or application server, click Start, point to All Programs, and then click Microsoft SharePoint 2010 Products. In the list of available options, click SharePoint 2010 Management Shell.

    the SharePoint 2010 Management Shell
  2. In the SharePoint 2010 Management Shell, type the following command to create a new content database named SharePoint_AdminContent. This will replace the existing Central Admin content database that has a GUID value in its name. In my environment, the web application name for the SharePoint Central Administration web application is http://sp2010-web1:20376. The New-SPContentDatabase PowerShell cmdlet is described further in this tip on Managing SharePoint Content Databases with PowerShell.

    PS C:\> New-SPContentDatabase -Name SharePoint_AdminContent -WebApplication http://sp2010-web1:20376

    SharePoint_AdminContent.
  3. We need to retrieve the Id values assigned to the SharePoint Admin Content databases. Run the following command, using the Get-SPWebApplication and the Get-SPContentDatabase PowerShell cmdlets.

    PS C:\> Get-SPWebApplication -Identity http://sp2010-web1:20376 | Get-SPContentDatabase | Select Id, Name, WebApplication | Format-List

    the SharePoint Admin Content databases
  4. To move the contents of the SharePoint Admin Content database from the one with the GUID value to the newly created one, run the following command, using the Get-SPSite and the Move-SPSite PowerShell cmdlets. Note that the you should pass the Id property values of the databases names instead of the Name property for the -ContentDatabase parameter of the Get-SPSite cmdlet. Type Y to confirm the prompts.

    PS C:\> Get-SPSite -ContentDatabase 46410944-32c4-4e01-8390-22b693f4fcc2 | Move-SPSite -DestinationDatabase 86d8e579-fbd8-473e-867d-58b974ee0267

    run the following command,
  5. Run IISRESET to restart IIS on the web front end server.
  6. Verify that the SharePoint Central Administration web application renders properly without issues. Try navigating thru the different links to make sure that everything is working fine.
  7. To completely remove the GUID-valued SharePoint Admin Content database, run the following command, using the Remove-SPContentDatabase cmdlet. This will detach the content database from the SharePoint Central Administration web application and eventually deleting it from the SQL Server instance. Type Y to confirm the prompts.

    PS C:\> Remove-SPContentDatabase 46410944-32c4-4e01-8390-22b693f4fcc2

    Run IISRESET to restart IIS on the web front end server
  8. Verify that you no longer have the GUID-valued GUID-valued SharePoint Admin Content database and that it is now using the newly created database

    PS C:\> Get-SPWebApplication -Identity http://sp2010-web1:20376 | Get-SPContentDatabase | Select Id, Name, WebApplication | Format-List

    Verify that you no longer have the GUID-valued GUID-valued SharePoint Admin Content database
    You can also confirm this by checking the list of databases from within SQL Server Management Studio.
    You can also confirm this by checking the list of databases from within SQL Server Management Studio.
In this tip, we've renamed an existing GUID-valued SharePoint content database to remove the GUID value. In future tips, we will look at performing the same task but with the service application databases running on your SharePoint 2010 farm.




Source article : https://www.mssqltips.com/sqlservertip/2706/renaming-the-sharepoint-admin-content-database-to-follow-sql-server-naming-conventions/