Monday, January 28, 2013

Finding the Id (Guid) for a SharePoint List




There are times when you need to find the Id (a Guid) of a list. Here is a simple way of doing this :-

·         Navigate to the SharePoint list using the browser.

·         Select the Settings + List Settings menu command.

·         Copy the Url from the browser address bar into Notepad. It will look something like:


http://SP2010/Project/_layouts/listedit.aspx?List=%7B46534EF9%2DCD3A%2D46E0%2DAE56%2DABC168BE562F%7D


·         Delete everything before and including “List=”.

·         Change “%7B” to “{”

·         Change all “%2D” to “-“

·         Change “%7D” to “}”

You are now left with the Id:

{46534EF9-CD3A-46E0-AE56-ABC168BE562F}

Sunday, January 27, 2013

Managed Account using Powershell/Central Adminstration in SharePoint 2010

Managed Account using Power shell/Central Administration in SharePoint 2010

Managed Accounts:

Managed Accounts is a new feature in SharePoint 2010. Managed accounts are Active Directory user accounts whose credentials are managed by and contained within SharePoint. When administrators configure a new web application or service application they don't have to remember the username and passwords every time if the service account is registered. They can just simply select the managed account and they can configure the web application and service application. For example when administrator create a new web application (Go to Central Administration => Application management => Manage Web Applications => Click New in the ribbon interface).


Administrator can just choose the service account (whose account is already is registered) for the application pool from the drop down as shown in the following 



Automatic password change:

SharePoint 2010 also introduces automatic password change.

Automatic password change enables SharePoint to automatically generate new strong passwords on a schedule you set. You can select the Enable automatic password change checkbox to allow SharePoint to manage the password for the selected account.

If an account policy based expiry date is detected for the account, and the expiry will occur before the scheduled date and time, the password will be changed on a configured number of days before the expiry date at the regularly scheduled time.

We can choose to enable e-mail notifications in order to have the system generate warning notifications about upcoming password change events.

We can also specify a time and schedule for the system to automatically change the password.



Register Managed Account:


Go to Central Administration => Security => General Security => Configure managed accounts.



You could be able to see all the managed accounts.

In this we will be seeing how to register a new managed account using power shell.



ou can register a new managed account for the specified Username and Password.

The same thing can be achieved using the following powershell cmdlet.


New-SPManagedAccount:

New-SPManagedAccount Registers a new managed account for the specified Username and Password.

Go to Start => All Programs => Microsoft SharePoint 2010 Products =>SharePoint 2010 Management Shell => Run as administrator.

Type the following command

New-SPManagedAccount

A message box will pop up to enter the credentials.




Enter the credentials and click on Ok.A new Managed account is registered successfully.
Note: For more information on New-SPManagedAccount cmdlet refer
http://technet.microsoft.com/en-us/library/ff607831.aspx 


Using Central Administration

To configure managed service accounts in SharePoint 2010:
  •     Open SharePoint Central Administration
  •     Click on Application Management | Manage Web Applications
  •     Click on New button on the ribbon
  •     Fill in the text fields in IIS Website, Security Configuration, and Public URL sections, until you reach Application Pool section. This is where the fun begins...
  •     You can use one of already pre-configured managed accounts or create new one. To use an existing managed account simply pick one from the drop-down list. To create new managed account, click on Register New Managed Account
  •     Fill in the username and password fields (Note: for some reason there is no "confirm password" field, so make sure you type the password correctly the first time.) This screen also allows you to configure Automatic Password Change schedule. Pretty neat.
  •     Click OK to save newly configured managed account. Now you're back at Create New Web Application window, where you can see your managed account in the drop-down list.
  •     If administrators want to pre-configure managed accounts, they can do so in the SharePoint Central Administration. Click on Security | Configure managed accounts (under General Security section). Click on Register Managed Account to configure new managed account, or click on Edit to make changes to an existing managed account.

Monday, September 17, 2012

Move/Migrate SharePoint Library/List items/documents


Move/Migrate SharePoint list items/documents and preserve metadata properties
In moving the mass documents to other folder or libraries there is a pretty common way by using Windows Explorer view. But there's a drawback to that method as the metadata properties like document properties get updated in the process - manily the modified Date/Time as well as the user would take on the role of the person that 'Last modfied '. This also applies to copying list data in the data sheet view from one list/library to another.

I have figured out a new way to doing this where you can save the current list properties after moving the documents as a template with content included and redeploying that to other location.

So if you want to move the contents of a SharePoint Document Library or List and be able to preserve the item’s metadata/property values at the same time you should use this method:

The process to move the content of a SharePoint Document library or List and be able to preserve the item's metadata/property values at the same time you should use this method:

1. Create a Blank Document library where you want to move, don't worry about the custom field it will automatically created once document moved.

2. Go to to "Content and Structure" page. You can access this item within the site with Site Actions  >Site Settings then under Site Administration tab there is a option called Content and Structure.


3. Navigate to you Source Library and select the view that you would like to have moved. Then click on  View > Select the view . Then Click on Action > Move...

   Note: You can create you own custom view. Example You want to move 30 days old file. So  create your view which show files for only 30 Days.


 4. You'll then be prompted witha pop-up that will let you navigate to your destination library or Document library .After you find that, just press the OK button and you’ll be good to go!

Monday, September 3, 2012

Leave Application Workflow Using Sharepoint Designer


Leave Application Workflow using SharePoint Designer


Basic Way to create the leave application application in SharePoint is to use the SharePoint Designer, for that you don't have to go into the custom development.

The Steps are as follows :

  1. Create an SPD workflow on the List that is set to start automatically when a new item is created.

  2. Step 1 - Create an action called Assign To-Do Item that is set to the reporting person field of that current item.  This will pause the workflow until the task is completed.

  3. Step 2 - Create a condition that if the item is rejected, then send an email notification and stop the workflow.  Else, if approved, Assign To-Do Item to Final decision officer.

Below is the Screen shot of the Action Items to be used in SharePoint Designer 2010.



Thanks
Any Question/Suggestion ? 
Please feel free to Contact...!!

Monday, August 13, 2012

Remove “+ Add document" from a SharePoint 2007/2010 Document Library

In this post , i will show you how to hide the "+ Add document " option from the SharePoint Library in SharePoint 2010.

I will explain you with the help of a scenario :

There are some times which we don't need the "Upload Option" in library just due to restrict the user not to upload any file/document.

 In my previous post i have show you the ways to hide the "Upload Button" in ribbon.

Now i will show you ,how to hide the "+Add document" option from library :

Suppose the below is the document library where we want to hide the "+Add document" option :


We can achieve this by the following methods
1.   Editing the WebPart
2.   Using SharePoint Designer(CSS)
3.   Using J Query
4.   By Permission level(Default)

1. Editing the WebPart
Go to Edit WebPart -> Tool bar Type -> Select NoToolBar option which will hide the Add Document option
2. Using SharePoint Designer(CSS)
Go to the designer and edit the page/webpart where you want to hide. Search for class=”ms-addnew” and change the style to Style=”display:none”
3. Using J Query
Add a CEWP and link the following J-Query in it and hide the CEWP webpart

$(document).ready(function()

{

$(‘#WebPartWPQ2 .ms-addnew’).hide();

});

4. By Permission Level (Default)
We can set the permission level for the document library to read only and hence the user with read only option in the SharePoint site will not see this option.

I have done by using the 1st Option. Try it.

Thanks
Any Question/Suggestion ?

Tuesday, August 7, 2012

Disable the Upload Button of a Document library in SharePoint 2010

Disable the "Upload" button of a Document library in SharePoint 2010

There are two ways to disable the upload button :

1st way :

Open your site using SharePoint Designer.  Once opened, navigate to your Library and edit your default view.  (All Files -> Your Library -> Forms -> Your View.aspx, right click and select Edit File in Advanced Mode)

At the bottom of the screen you will see three options Design, Split, and Code.  Select the Split option.

In your code window, locate the <asp:Content ContentPlaceHolderId=”PlaceHolderMain” runat=”server”>  tag.
Now, scroll down and find the closing </asp:Content> tag.  Insert a line above the closing tag.  Place the following code into that newly created blank line.

<style type="text/css">
 #Ribbon\.Documents\.New\.AddDocument-Large
{
display:none;
#Ribbon\.Library\.Actions\.OpenWithExplorer-Medium
{
display:none;
}
</style>

Click save, then refresh your page.  The Documents tab should now be missing the Upload Document button and the Library tab should be missing the Open with Explorer button.

Using IE, you can find the ID’s of the other buttons in the ribbon.  With your View open in IE, click F12.  Once Developer Tools finishes loading, select Find from the top menu, then click on Select Element by Click.  Back in IE, click on the button you want the ID of.

2nd Way :


I would like to show this by giving an example :-

Suppose i have a document library that uses Infopath form it is termed as Form Library.

When a new form is submitted , a series of workflows are triggered and corresponding task is assigned , etc. I had an issue where workflows were getting started multiple times and the task are also assigned  , and generally causing chaos.

I traced the issue, that users were not using the "New Document" button to create a form,but were also saving old forms and re-uploading them using the "Upload" button which results in duplicate files and duplicate workflows etc.

I resolved the issue by simply removing the upload button from the edit.aspx page in each library using the SharePoint Designer.

Steps to do so :

1. Click on the SharePoint Designer to open the edit.aspx page.

2. In Design view right click the List View Web part and select the XSLT data View from the context menu.

3. Switch to split view and locate the "New" button, and you will see the XSLT code.

4. Set the "td " visibility as "hidden" as shown below :








In order, to prevent an unsightly 'blank space' in the menu, I moved the location of the hidden button to the last button on the right of the menu. 

Now users have to use the "New" button to create a new document and cannot use the upload button.
Keep in mind that you'll have to do this for each view that the users have access to, as each view has it's own page that will need editing. 
Thanks

Any Question/Suggestion ??

Tuesday, July 10, 2012

Hiding Empty Columns in Display and Edit form using JavaScript/Jquery

                       Hiding Empty Columns in Display and Edit form  using JavaScript/JQuery

To Hide columns in Display and Edit form both from SharePoint that are empty, for that you don't have get into custom code. A simple client side script is used in form of Jquery.

Code is as follows:

<script type=”text/javascript” src=”/Kishan/Scripts/jquery-v1.7.2.min.js”></script>
< script type=”text/javascript”>
$(“td.ms-formbody”).each(function()
{
// Remove all the white spaces

var val = $(this).text().replace(/\s|\xA0/g,”);


// We will check the string length if it's "0" , hide the field

if(val.length==0){
$(this).parents(‘tr:first’).hide();
}
});

< /script>

To download the Jquery Script file. Click Here.