Pages

Thursday, May 9, 2013

SharePoint 2010 Manage Access Requests



Key points to remember about manage access request in SharePoint:

1) From SharePoint UI, manage access request functionality is only available on site collection level.

2) If sub-site has broken permissions level, then we can set access requests email on sub-site level as well.

3) If we enable manage access requests on SharePoint site, then user can see "Request access" link when they try to access site in which they doesn't have access.

4) Manage access request functionality is very useful when we need to determine site owner.

5) By clicking "Request access" link, system will send an automated email to username who is listed in manage access request "Send all requests for access to the following e-mail address:" textbox.

PowerShell script for setting request email on SharePoint sub-sites:



Enjoy!

PowerShell script for delete users from SharePoint site

Date columns returning incorrect values in SharePoint object model



I have object model code which is displaying modified date in custom aspx page from SharePoint site, but below simple object model code was returning incorrect value (its adding +4 hours into actual date/time)
e.g.
string strModifiedDt = Convert.ToString(objListItem["Modified"]);

I have found many different links which talks about to change 'regional settings' on web application and site level, I have tried all different options on server level but none of them was working and then I have found this MSDN article which talks about exact issue with accessing date values from object model: http://msdn.microsoft.com/en-us/library/ms197282.aspx

Finally I'm able to resolved and display exact same date/time value as SharePoint site in my custom page from below code and method : DateTime.ToLocalTime()

e.g.
DateTime dtValue = Convert.ToDateTime(objListItem["Modified"]);
strColValue = Convert.ToString(dtValue.ToLocalTime());

Sometime simple things make me crazy :)

Disable My Site and My Profile links from SharePoint 2010 site



Some organization doesn't have "My Site" functionality enabled in SharePoint 2010, so if user clicks on My Site and My Profile links, they will get an error page.

To hide or disable both links we have to remove "All authenticated users" permissions from "User profile service application".

here is very good reference link which is talking about step by step about how to remove my site and my profile link: