Thursday, December 7, 2017

SharePoint Site Retention Solution

SharePoint sites can quickly grow , keeping outdated/inactive sites around takes up storage space, makes it difficult for people to find current information, and may also be undesirable for compliance reasons. 
Retention policies are particularly helpful for organizations that allow large groups of users to create their own sites. This policy is extremely important for organization, because transferring the content to another location significantly reduces the cost of its storage.

Default retention options has limited features and less user involvement in process. My custom solution,  provide all site user and record management team involvement in retention process.

 


Thursday, March 12, 2015

ListView Day Filter in SharePoint

There was a query at technet forum , "Requirement to show "Daily" stats on a custom list.  Criteria are to show items modified between 3pm yesterday to 3pm today. "

Solution -  

1- Create a Calculated column in list. The formula should be  -
  • Name - ModifiedHrs
  • Type - Calculated
  • Formula:     =HOUR(Modified)
  • Format -Number (1, 1.0, 100)
    Number of decimal places:  0
2- Create a Tabular View ( e.g. DayState.aspx) for List. (not Calendar View), through browser with filter ( Modified equal to [Today]).
3. Now Open the view page (DayState.aspx) in SharePoint Designer code view [Edit in Advance Mode]
4. Locate the CAML query associated with the filter (Modified = [Today]), you can find something like

<WebPartPages:WebPartZone ---
<WebPartPages:XsltListViewWebPart ----
-----
<XmlDefinition>
<View --->
<Query>
<OrderBy>--</OrderBy>
<Where>
<Eq>
<FieldRef Name="Modified"/>
<Value Type="DateTime"><Today/></Value>
</Eq>
</Where>
</Query>
<ViewFields---->
----
</View></XmlDefinition>
</XmlDefinition>




5. Replace the <Where>----</Where> Section with this one

<Where>
<Or><And><Eq><FieldRef Name="Modified"/>
<Value Type="DateTime"><Today OffsetDays="-1"/>
</Value></Eq><Gt><FieldRef Name="ModifiedHrs"/>
<Value Type="Number">14</Value></Gt></And>
<And><Eq><FieldRef Name="Modified"/>
<Value Type="DateTime"><Today/></Value></Eq><Lt>
<FieldRef Name="ModifiedHrs"/>
<Value Type="Number">16</Value></Lt></And></Or>
</Where>
 
6. Save the page , and test in browser

Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown


Problem :
In a sharepoint 2013 Installation or SP1/CU installation ,  after installation when start psconfig wizard, it throws error - " An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown.  Additional exception information: Failed to upgrade SharePoint Products."

Solution:

  •  Restart your Timer service before you run config wizard."Run As Administrator" on the Products Configuration Wizard.
  • Make sure no other user, other than SharePoint managed accounts, have dbowner permissions for the SharePoint databases.
  • Reboot after CU installed and disable the User Account Control for you service accounts.
  •  Try using powershell -PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

Ref - https://social.technet.microsoft.com/Forums/en-US/bd6f406a-a75b-4958-88be-06d364a60451/microsoftsharepointpostsetupconfigurationpostsetupconfigurationtaskexception-was-thrown-while?forum=sharepointadmin