Posts

Showing posts from March, 2017

How to get wsp/dlls/code from SharePoint deployed solution?

How to get wsp/dll/code from SharePoint deployed solution? Please do not forget to comment if this helps. Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $farm = Get-SpFarm $file = $farm.Solutions.Item("wsp_name.wsp ").SolutionFile $file.SaveAs("D:\Temp\wsp_name.wsp") reanme .wsp to .cab and extract DLL now you can use http://ilspy.net/ to see whats inside DLL. Enjoy

The file is locked for exclusive use by user... SharePoint

The file is locked for exclusive use by SharePoint Please do not forget to comment if this helps. Use below PS script to unlock document. (Will need farm admin access) $web = Get-SpWeb <SP Web URL> $item = $web.GetListItem("<Document URL including web>") #e.g : https://my.sp.com/sites/test1/2017/myPlan.xlsx $item.file.LockType $item.file.LockedByUser $item.file.LockExpires ## Unlock $userId = $item.File.LockedByUser.ID $user = $web.AllUsers.GetById($userId) $impSite = New-Object Microsoft.SharePoint.SPSite($web.Url, $user.UserToken); $impWeb = $impSite.OpenWeb(); $impItem = $impWeb.GetListItem("http:\\domain.FULLURL.com\FilaName.xlsx") $impItem.File.ReleaseLock($impItem.File.LockId) $web.dispose() $impWeb.dispose()

Sharepoint : create calculated column to get weekdays

=IF(ISERROR(DATEDIF([Start Date],[End Date],"d")),"",(DATEDIF([Start Date],[End Date],"d"))+1 -INT(DATEDIF([Start Date],[End Date],"d")/7)*2  -IF((WEEKDAY([End Date])-WEEKDAY([Start Date]))<0,2,0)  -IF(OR(AND(WEEKDAY([End Date])=7,WEEKDAY([Start Date])=7),AND(WEEKDAY([End Date])=1,WEEKDAY([Start Date])=1)),1,0)  -IF(AND(WEEKDAY([Start Date])=1,(WEEKDAY([End Date])-WEEKDAY([Start Date]))>0),1,0)  -IF(AND(NOT(WEEKDAY([Start Date])=7),WEEKDAY([End Date])=7),1,0))

Updating Date Time column in SharePoint 2010/2013 from C#

Updating Date Time column in SharePoint 2010/2013 from C#. DateTime.Now.ToString(“yyyy-MM-ddTHH:mm:ssZ”); spItem["MyDateTimeColumn"] = Microsoft.SharePoint.Utilities.SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Now); //How to handle server time vs website time. spweb.RegionalSettings.TimeZone.UTCToLocalTime(DateTime.UtcNow);

Mega menu and dashboard

Image
Example of mega menu/dashboard Example of dynamic dials Managers dashboard