Showing posts with label SharePoint 2013. Show all posts
Showing posts with label SharePoint 2013. Show all posts

Wednesday, December 17, 2014

Item Update vs SystemUpdate

Recently there was a need to update documents/ list items without creating new version and updating 'Modified' and 'Modified by' values.  Lists and Libraries were having event receivers or workflows. There are couple of options to update SPListItem and need to understand the differences between them. 
Update()
·        Updates the item in the database.
·        Updates the 'Modified' and 'Modified by' values.
·        Creates a new version
Systemupdate()
·        Updates the item in the database.
·        No changes in the 'Modified' and 'Modified by' values.
·        No new version.
·        Triggers the item events.
Systemupdate(true)
·        Same as Systemupdate() and it increments item version.
·        Using SystemUpdate(false) is same as SystemUpdate().
UpdateOverwriteVersion()
·        Updates the item but does not create a new version.
·        Updates the  'Modified' and 'Modified by' values.
you could set EventFiringEnabled = false to disable the triggering of events (workflows). Set EventFiringEnabled = true after item update to enable the events again. 

Friday, October 31, 2014

Delete a Timer Job in SharePoint

I was looking for a custom timer job that was having two instances. Second instance got created after another deployment. Feature deactivation did not delete the existing job. I wanted to delete old timer job but there is not option to delete that in central Admin. PowerShell help me out on that. PowerShell’s Get-SPTimerJob command provides listing of all the timer jobs.

When I run this command it was truncating the name and ids. To see all jobs with full name we need to change the buffer Size property of PowerShell window to 250+

Get-SPTimerJob |Format-Table id,name

To narrow down the results I used where clause with name with these properties to distinguish old job.

Get-SPTimerJob | where { $_.name -like "<JobName>" }| Format-Table  -autosize -Property LastRunTime,id,name,DisplayName,Status,ErrorMessage

After finding the id of correct Job, run these commands to delete the job.


$job = Get-SPTimerJob -id <Job's GUID>
$job.Delete()

Job will be deleted. you can confirm running above Get-SPTimerJob PowerShell command or in CA. 

Monday, October 6, 2014

SharePoint Designer - Run as different user

Recently I need to run SharePoint designer as different user. 'Run as different user' option is not available on SharePoint Designer shortcut.

Follow these steps to start SharePoint Designer 2010/ SharePoint Designer 2013 as another SharePoint user

1.      Search for SPDESIGN.exe in windows explorer. you will find this under these locations based on version of SharePoint Desginer you have. 
               SharePoint Designer 2013(64bit) - C:\Program Files\Microsoft Office\Office15
               SharePoint Designer 2013(32bit) - C:\Program Files (x86)\Microsoft Office\Office15
               SharePoint Designer 2010(32bit) - C:\Program Files (x86)\Microsoft Office\Office14
2.      Press and hold the Shift key, right-click SPDESIGN.exe, and then click Run as different user.
3.      Type the credential of the user and then click OK.

Or

You could Log on to Windows by using another user account, and then run SharePoint Designer.

Tuesday, September 30, 2014

Add FileType Icons in SharePoint

Sometime when you upload a file in document libraries and icon doesn’t appear in 'Type' column. That is because SharePoint does not provide icons for all kinds of FileTypes. However SharePoint is flexible enough that you could add a new icon for missing FileType.

Note: You need to perfrom these steps on each Web Server you have. for SharePoint 2013 these changes made in 14hive not 15hive.

To add Icon you need to find or create an icon for that FileType (16 x 16 Pixel gif or png) and copy it to
..Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES (for SharePoint 2013 as well not in 15hive)
Next step is to edit Docicon.xml ( don't forget to take the backup of Docicon.xml before edit). This file is present in
..Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML
Search for <ByExtension> section and add an entry for file extension of the application like this 
<Mapping Key="zap" Value="iczap.gif" />
Do IISReset. 
You should see the Icon now. HTH..

Thursday, September 18, 2014

Extract WSPs from Central Admin Solution Management

You can extract wsps from Central Admin Solution Management using PowerShell if you don't have binary or Setup exe.

$wsps = "Solution1.wsp;Solution2.wsp"
$path = "D:\Wsps\"

$farm = Get-SPFarm
$wspNames = $wsps.split(";",[StringSplitOptions]'RemoveEmptyEntries')
foreach($wspName in $wspNames) {
$file = $farm.Solutions.Item($wspName).SolutionFile
$file.SaveAs($path+$wspName)
Write-Host "Solution File extracted to this location " + $path$wspName
 }


Wednesday, April 16, 2014

ReDeploy Custom Timer Job using PowerShell

Following are the steps you need to redeploy a custom timer job.

Disable-SPFeature -Identity "91b81920-cc93-46da-b2c9-7e29c5077a67" -Url "http://sp2013.com/"
UnInstall-SPFeature -Identity "91b81920-cc93-46da-b2c9-7e29c5077a67"

Uninstall-SPSolution -Identity TimerJob.wsp –allwebapplications
Remove-SPSolution TimerJob.wsp –force

Add-spsolution C:\temp\TimerJob.wsp
Install-spsolution TimerJob.wsp -GACDeployment –force

Enable-SPFeature -Identity "91b81920-cc93-46da-b2c9-7e29c5077a67" -Url "http://sp2013.com/" –PassThru

Stop-Service SPTimerV4
Start-Service SPTimerV4

If you use update solution TimerJob may not pickup updated functionality
//Update-SPSolution -Identity timerjob.wsp -LiteralPath C:\temp\TimerJob.wsp -GACDeployment

SharePoint 2013 URLs

We can access SharePoint pages using their shortcuts URLs

Add Web Parts Pane -  ?ToolPaneView=2
Add web parts to any page -  ?PageView=Shared&ToolPaneView=2
Create Alerts on this Site -  _layouts/15/SubChoos.aspx
Create New new list, library etc - _layouts/15/create.aspx
Create New Site -  _layouts/15/NewsbWeb.aspx
Create New Web Part Page -  _layouts/15/spcf.aspx
Edit Alerts - _layouts/15/SubEdit.aspx
List Template Gallery -  _catalogs/lt/Forms/AllItems.aspx
Login as another user - /_layouts/closeConnection.aspx?loginasanotheruser=true
Manage People -  _layouts/15/people.aspx
Manage Permissions - _layouts/15/user.aspx
Manage SiteCollection Administrators -  _layouts/15/mngsiteadmin.aspx
Manage Sites and Workspaces - _layouts/15/mngsubwebs.aspx
Master Page Gallery -  _catalogs/masterpage/Forms/AllItems.aspx
Modify Navigation -  _layouts/15/AreaNavigationSettings.aspx
Navigation Settings -  _layouts/15/SiteNavigationSettings.aspx
Recycle Bin - _layouts/15/AdminRecycleBin.aspx
Save Site as Template -  _layouts/15/savetmpl.aspx
Site Column Gallery - _layouts/15/mngfield.aspx
Site Content and Structure Manager - _layouts/15/sitemanager.aspx
Site Content Types - _layouts/15/mngctype.aspx
Site Directory - _layouts/15/SiteDirectorySettings.aspx
Site Settings page -  _layouts/15/settings.aspx
User Alerts -_layouts/15/sitesubs.aspx
User Information List - _catalogs/users/simple.aspx
View All Site Content - _layouts/15/viewlsts.aspx
Web Part Gallery -  _catalogs/wp/Forms/AllItems.aspx
Web part maintenance mode -  ?contents=1 to Page URL
Web Analytics Reports Summary - _layouts/15/usage.aspx

Saturday, May 11, 2013

Install and uninstall SharePoint Apps using PowerShell


Microsoft introduced apps for Office and apps for SharePoint. You can develop Apps using visual studio office tools and NAPA. You can deploy app from visual studio deploy option or through PowerShell.
Here is how PowerShell can help you deploy Apps to different site collections.
To Install SharePoint App -
Before you can install an app, make sure that App is published to a physical folder using publish option. After publishing you will have a package file with .app extension (like yourApp.app).  
Installation of app is two steps process, first import app to a site collection and then install imported App.
Import-SPAppPackage -Path <Path of .app file> -Site < SiteCollectionURL > -Source < AppSource>
AppSource can be Marketplace, CorporateCatalog, DeveloperSite, ObjectModel, RemoteObjectModel.
Install-SPApp -Web <SPweb ID or URL> -Identity <SPApp>
Example:
$myApp = Import-SPAppPackage -Path "c:\Apps\MySharepointApp.app" -Site http://localhost/apps
 -Source ([microsoft.sharepoint.administration.spappsource]::ObjectModel)

Install-SPApp -Web http://localhost/apps -Identity $myApp
To Uninstall SharePoint App -
To uninstall an app first you need to get the instances of installed Apps then get the app you want to uninstall using app ID or app Title.
To get all installed apps in SharePoint site -
$appInstances = Get-SPAppInstance -Web < SiteCollectionURL >
To get the app details that you want uninstall -
$app = $appInstances | where {$_.Title -eq '< Title or ID of App >'}
To uninstall the app -
Uninstall-SPAppInstance -Identity $app
Example:
$appInstances = Get-SPAppInstance -Web http://localhost/apps
$app = $appInstances | where {$_.Title -eq ' Your SharePoint App'}
Uninstall-SPAppInstance -Identity $app

Tuesday, July 17, 2012

Free SharePoint 2013 Training videos for Developers and IT Pros

Microsoft have added lots of how-to training and walkthrough videos / presentation about Office 2013 and SharePoint 2013 aimed at developers and IT Pros on Technet.

For Developers – The new modules added for developers as follows. (MSDN link)
 
1.       Introduction to Office 2013 and SharePoint 2013 development
2.       SharePoint 2013 app model for developers
3.       SharePoint 2013 Developer Tools
4.       Hosted apps in SharePoint 2013
5.       Create Cloud-Hosted apps for SharePoint 2013
6.       SharePoint 2013 client object model (CSOM) and REST APIs
7.       OAuth and application identity in SharePoint 2013
8.       Develop SharePoint 2013 remote event receivers
9.       Workflow changes and features in SharePoint 2013
10.   Business connectivity services changes in SharePoint 2013
11.   Search features and changes in SharePoint 2013
12.   Enterprise content management changes in SharePoint 2013
13.   Web content management changes and features in SharePoint 2013
14.   Social features in SharePoint 2013
15.   Office services in SharePoint 2013
16.   Create mobile apps for SharePoint 2013
17.   Develop apps for Office 2013
18.   Project Server 2013 training for developers

For IT Pro - The following list provides an overview of the new modules for IT Professionals (MSDN Link)


1.       SharePoint 2013 IT pro introduction and overview
2.       SharePoint 2013 system requirements
3.       SharePoint 2013 architectural changes
4.       SharePoint 2013 server farms and site architecture planning
5.       Office Web Apps 2013 architecture and deployment
6.       SharePoint 2013 service application architecture and individual service applications
7.       SharePoint 2013 enterprise search overview
8.       SharePoint 2013 social features
9.       SharePoint 2013 enterprise content management and web content management considerations
10.   SharePoint 2013 customization options and management
11.   SharePoint 2013 authentication and authorization overview
12.   Overview of SharePoint 2013 business continuity management
13.   Upgrading to SharePoint 2013
14.   What's new in Project 2013 for IT Professionals


Download links -