Sunday, 25 January 2015

Hide search box in SharePoint


Sometimes we can get requirement to hide the search box in all the pages or only in a particular page.

Using css we can do it easily.

First identify the search box having the id or class in the browser.
In our case having the search box having id

#SearchBox

Option 1:

To hide the search box with in a page using the content editor.
Place the content editor in that particular page you want to hide the search box.
Edit the web part and click on the source editor button
Place the code 
<style type=”text/css”>
#SearchBox
{
display:none !important;
}
</style>

Click ok.
Now verify it we can’t able to see the we search box in that particular page.

Option 2:

In the same way upload particular css file in a library.
Add the content editor in that particular page, edit the content editor refer the css URL.

Click ok.

Now verify it we can’t able to see the web search box in that particular page.


In the same way if you want hide in the entire site collection level for all the pages.

Upload the particular css in a library.
Refer the css in the Site Settings->Look and Feel->Click on the Master Page.
In the Alternate css URL
Select the Specify a css file to be used by this site and all sites that inherit from it:
Browse and select the css URL.
Click ok.
Now verify we cannot able to see the search box in all the pages.


Sunday, 4 January 2015

How to create Content Type for a document library in SharePoint 2013

 To create a content type for a document library user must have permissions with Full Control.
Now we will create the content type as Excel step by step.


Step: 1
Navigate to the Site Settings->Web Designer galleries->click on Site Content Types->Click on Create
Enter the Name as per our requirement
In our case I am entering the name as DotnetSharePointExcel
Select parent content type from:
Document Content Types
Parent Content Type
Document
Put this site content type into:
Custom Content Types for Existing Group
Click ok.  


Step 2:

Navigate to library ->Top Ribbon click on Library Settings->Advanced Settings->Allow management of content types to Yes ->Click ok.
Step: 3

 Navigate to library ->Top Ribbon click on Library Settings->In the Content Types-> Click on Add from existing content types->In Available content types we can able to see the newly created content type Select click on add, Once content type added  Click on ok.
Step: 4

Navigate to Library ->Top Ribbon Click on “Open with Explorer” ->Forms there we have to place the template like EXCEL


Step: 5

Navigate to the library settings->now we can able to see that content type.
Step: 6

Click on Content Type->in Advanced Settings->Enter the URL of an existing document template
Example: http://dotnetsharepoint.com /sites/sharepoint /Document Library/Forms/template.xltx
Click ok. 


Step: 7

 Finally Click on library ->in the top ribbon click on Files->Click on New Document ->there we can able to see the newly created document content type.



Thursday, 1 January 2015

How to change the Site logo in SharePoint using Power Shell

For every web application having list of  site collection’s  and its sub sites having a site logo, some cases we need to change site logo only for a particular site collection and its sub sites only.

Doing it manually it will take time and effort, using the Power Shell we can change the site logo easily.

First I am uploading the site logo in a particular site collection library, my case I am uploading a logo in publishing images library (http://dotnetsharepoint.com/sites/changesitelogo/publishingimages)

Using this script we can change the logo in a site collection and its sub sites.

Run the below Power Shell script.

Add-PSSnapin Microsoft.sharepoint.powershell
#to get the site collection url
#to get the site logo
$sitecolllogo= " http://dotnetsharepoint.com/sites/changesitelogo/publishingimages/dotnetsharepointlogo.png"
$getsitecoll=new-object Microsoft.SharePoint.SPSite($sitecollname)
foreach($webs in $getsitecoll.Allwebs)
{
$webs.SiteLogoUrl=$sitecolllogo
$webs.Update()
}
$getsitecoll.Dispose()

Once the script completed successfully, go and verify the logo has been changed.

The World Wide Web Publishing Service (W3SVC) is stopped

When we try to access the site in SharePoint, I am getting the error message “the page can’t displayed”.
 We went to IIS and verified there all the IIS sites are in stopped stage, we tried to start the site, we go an error message “The World Wide Web Publishing Service (W3SVC) is stopped.
Websites cannot be started unless the World Wide Web Publishing Service (W3SVC) is running.



To fix this issue:

Open the services.msc

There we can able to find the World Wide Web Publishing Service



Right click on that service click on start. 

Now we can able to access the site without any issues.

In any case if we are unable to start the service and its dependency services with warning message “Windows could not start the World Wide Web Publishing Service service on Local Computer. Error 1068: The dependency service or group failed to start.” as shown in the screen shot.

                         

Double click on the “World Wide Web Publishing Service” in the top we can able to see the “dependency” option check whether any dependency services we need to start.
In my case I verified all the dependency services are in running stage.

Finally  to resolve the issue restart server it will solve the problem.

  

Missing webpart in SharePoint.


In some cases we tried to edit the page and tried to add web part click on Add a Web Part link but in the top ribbon we can able to see only Apps inside the categories, we verified the permissions for that particular user having the Full Control to the site.




Resolution:

If we are currently using sub site in this case, we don’t have permissions to access the top level site (site collection), at least the users having read access to the top level site (site collection) or at least read permissions to the web part gallery available at top level site (site collection).

Once we granted the read permissions to the users to the root site (site collection) or web part gallery then only users can able to add the web part to their site with all available web parts, because the web part gallery is available only at top level site collection only and they can able to see all the web part categories without any problems.




Exclude disable users from AD to SharePoint

There is a way to exclude the disabled users from AD to SharePoint, we are having advantages for excluding the disabled users.
1) SharePoint User Profile Sync will complete very faster no need to maintain disabled users information.
2) Crawling the People Search will complete very fastly.
When we are   configuring User Profile don’t forget to filter the disabled users before starting the full crawl.

Navigate to Central Admin ->Application Management ->Manage Service applications->User profile Service Application
Click on the user profile service application there we can able to see the “Configure Synchronization Connections” option click on it.


Create new connection, once connection created, click on "Edit Connection Filters" from the menu.
  


Select the condition to exclude disable users as shown in the below screen shot.


Click on add.
Now we can able to see the condition as shown below


Click on ok.
Start the Full sync, once sync completed, disabled users won’t be available in our SharePoint user profile.




Saturday, 27 December 2014

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.