kwizcom banner advertisement

How to Delete a Timer Job in SharePoint using PowerShell?

May 29, 2013    , , , ,
But wait! why do we delete a Timer Job in SharePoint? Well, because: Your custom timer job may be in stuck state You may have orphaned Timer jobs (Timer job without "Server" from Timer job status page in Central Admin) Your custom timer job may have created more than one instances (duplicate timer job) In my case, a custom timer job deployed in our SharePoint 2013 environment had a bug and left two instances of the same timer job. so we wanted to delete that. Delete a Custom Timer Job in SharePoint There is no Central Admin UI to delete timer jobs in SharePoint. So, lets seek help from PowerShell to delete a timer job in SharePoint. How to Delete a Timer Job in SharePoint using PowerShell? Step 1: Obtain the GUID of your target timer job to delete Get-SPTimerJob | where { $_.name -like "YOUR-Timer-Job-Name" } | Format-Table -autosize -Property LastRunTime,id,name,DisplayName,Status Step 2: Get the timer job and delete Once you obtained the GUID
How to Delete a Timer Job in SharePoint using PowerShell? How to Delete a Timer Job in SharePoint using PowerShell? Reviewed by Salaudeen Rajack on May 29, 2013 Rating: 5

Get Form Field Values from DispForm.aspx, EditForm.aspx Pages in SharePoint

May 29, 2013    ,
If you have a requirement to extract field values from Display Form or Edit Form pages in SharePoint lists, Use these jQuery scripts: Get Form field value in Display Form (DispForm.aspx): <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script language="javascript" type="text/javascript"> $(document).ready(function() { var fldValue = $('h3:contains("Last Name")').closest('td').next('td').text(); alert(fldValue.trim()); }); </script> Get Form field value in Edit Form (EditForm.aspx): <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script language="javascript" type="text/javascript"> $(document).ready(function() { var fldValue = $("input[title*='Last Name']").v
Get Form Field Values from DispForm.aspx, EditForm.aspx Pages in SharePoint Get Form Field Values from DispForm.aspx, EditForm.aspx Pages in SharePoint Reviewed by Salaudeen Rajack on May 29, 2013 Rating: 5

Set Outgoing E-Mail Settings for SharePoint Central Admin using PowerShell

May 25, 2013    , , , , , , ,
Its a common task that every SharePoint administrator will have to perform is enabling SharePoint to send E-mails. Outgoing email settings can be configured within the Central Administration site by navigating to: Central Administration >> System Settings  Click on "Configure outgoing e-mail settings" Provide Outbound SMTP Server, From and To Addresses, and the character set. Click "OK" to save your changes. Set Outgoing E-Mail Settings for SharePoint 2013 using PowerShell: Here is the PowerShell script in SharePoint 2013 to configure outgoing email Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Define Outgoing E-mail settings $outboundServer = 'g1exchangehub.crescent.org' $FromAddress = 'Teamsites@crescent.org' $ReplyAddress = 'SharePointSupport@crescent.org' $Charset = 65001 #Get Central Administrtion Web site $WebApp = Get-SPWebApplication -IncludeCentralAdministration | Where { $_.IsAdmin
Set Outgoing E-Mail Settings for SharePoint Central Admin using PowerShell Set Outgoing E-Mail Settings for SharePoint Central Admin using PowerShell Reviewed by Salaudeen Rajack on May 25, 2013 Rating: 5

Delete Folders, Sub-Folders from SharePoint Library Programmatically

May 25, 2013    , , , , ,
I need to delete a Folder from SharePoint 2010 document library using object model programmatically. Here is the code to delete the sub-folder from SharePoint document library: To Delete a Sub-folder from SharePoint Document Library Programmatically: String siteURL = "http://sharepoint.crescent.com/sites/sales"; String listName = "Documents"; String folderToDelete = "v2"; using (SPSite site = new SPSite(siteURL)) { using (SPWeb web = site.OpenWeb()) { SPFolderCollection folders = web.Folders[listName].SubFolders; foreach (SPFolder folder in folders) { if (folder.Name == folderToDelete) { web.Folders[listName].SubFolders.Delete(folder.Url); } } }
Delete Folders, Sub-Folders from SharePoint Library Programmatically Delete Folders, Sub-Folders from SharePoint Library Programmatically Reviewed by Salaudeen Rajack on May 25, 2013 Rating: 5

PowerGUI Error: Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime

May 24, 2013    , ,
PowerGUI is my favorite IDE for creating PowerShell scripts. When I upgraded PowerGUI to a newer version 3.5, all my scripts stopped working and I started receiving below error: "Get-SPWeb : Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime." Root Cause: SharePoint cmdlets do not work with .NET framework 4! In PowerGUI's configuration, We got to Remove that! Solution: Open the "ScriptEditor.exe.config" file from the location where PowerShell GUI is installed. Typically, "C:\Program Files (x86)\PowerGUI\". Find the Line: " <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> " under "startup" node Comment that line, Save & Close. Now, Restart the Script Editor. All should be working now.
PowerGUI Error: Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime PowerGUI Error: Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime Reviewed by Salaudeen Rajack on May 24, 2013 Rating: 5

"The default termstore for this site cannot be identified" - Error on Creating Local Term Set Managed Metadata Column

May 23, 2013    , , , , ,
When trying to create a Local term set by Selecting the option "Customize your term set:", Got the error message : "The default termstore for this site cannot be identified"   Cause:  This is because: Managed Metadata Service Application Service Application to set default storage location for Term Sets is not specified! Solution: Go to Central Administration >> Manage Service Applications >> Highlight your Managed Metadata Service Application >> Click on the Service Connection >> Properties icon in the ribbon >> Enable "This service application is the default storage location for column specific term sets."  This will fix the problem!
"The default termstore for this site cannot be identified" - Error on Creating Local Term Set Managed Metadata Column "The default termstore for this site cannot be identified" - Error on Creating Local Term Set Managed Metadata Column Reviewed by Salaudeen Rajack on May 23, 2013 Rating: 5

The web server process that was being debugged has been terminated by Internet Information Services (IIS)

May 20, 2013    , , , ,
While debugging a SharePoint object model code in Visual studio, Got this error message: "The web server process that was being debugged has been terminated by Internet Information Services (IIS). This can be avoided by configuring Application Pool ping settings in IIS.  See help for further details." Cause:  IIS performs health monitoring by pinging worker processes to ensure they are up and running. IIS will terminate any worker process that does not respond to a ping request within the specified response time. So when the code execution is at a break-point in debugging mode and do not resume within the default response time of 90 seconds, IIS forcefully terminates the process and detach the debugger. Fix: To fix this error,  increase the Ping Maximum Response Time of the application pool in IIS. Following steps: Go to Internet Information Services (IIS) Manager. (RUN >> InetMgr) Expand the server tree , choose Application Pools. Choose the Application Pool
The web server process that was being debugged has been terminated by Internet Information Services (IIS) The web server process that was being debugged has been terminated by Internet Information Services (IIS) Reviewed by Salaudeen Rajack on May 20, 2013 Rating: 5

Find the Number of Users Currently Connected to SharePoint Site

May 19, 2013    , , , ,
Had to perform an unplanned IIS Reset to fix an issue in production SharePoint Farm. But executing IISReset breaks ongoing user sessions and give "Service Unavailable" error message, isn't it? Wouldn't it be a good idea to find the No. of users currently connected with the SharePoint site and do the IISReset for a minimal impact? Sure! How to find how many users connected with SharePoint sites? use Performance Monitor! Go to Start >> Run >> Type "Perfmon", to fire up Performance Monitor. Click on "Performance Monitor" , Right click "Add Counters" in Graph window Under the available Counters, Pick "Web Service" expand the node and select "Current Connections" Under "Instances of Selected object" You can either select "Total" or pick a particular web application Click on Add button to add the selected counter, and click "OK" button Now the graph will show the how many u
Find the Number of Users Currently Connected to SharePoint Site Find the Number of Users Currently Connected to SharePoint Site Reviewed by Salaudeen Rajack on May 19, 2013 Rating: 5

Print SharePoint Listview Web Part using JavaScript

May 19, 2013    , ,
Requirement is to Print a SharePoint List view web part with JavaScript. Solution: Found this code somewhere on the Technet Forums: Place this code in a CEWP, This will add a "Print" button, on clicking the button, Script fetches the list view web part, place it in a new window and sends to Print. <INPUT type="button" onclick="javascript:void(printwebpart('WebPartWPQ2'))" value="Print"/> <script type="text/javascript"> function printwebpart(webpartid) { var WebPartElementID = webpartid; var bolWebPartFound = false; if (document.getElementById != null) { //Create html to print in new window var PrintingHTML = '<html>\n<head>\n'; //Take data from Head Tag if (document.getElementsByTagName != null) { var HeadData= document.getElementsByTagName("HEAD"); if (HeadData.length > 0) PrintingHTML += HeadData[0].innerHTML; } PrintingHTML += '\n</HEAD>\n
Print SharePoint Listview Web Part using JavaScript Print SharePoint Listview Web Part using JavaScript Reviewed by Salaudeen Rajack on May 19, 2013 Rating: 5

Audience Targeting Missing in SharePoint 2010?

May 18, 2013    , , ,
Audience Targeting feature in SharePoint 2010 targets content (pages, Web Parts, documents, list items and content) to audiences. Audiences may consists of SharePoint Groups, Security groups, distribution-lists or Global Audience groups which are compiled in Central Administration. Audience targeting missing in SharePoint 2010? Audience Targeting will not be enabled on lists & libraries by default! You must turn it ON by going to List Settings >> Audience Targeting Settings >> Enable audience targeting to turn audience targeting ON in SharePoint 2010. SharePoint 2010 audience targeting links not available?   Audience targeting option missing in web part advance properties? Couldn't find Audience targeting in Top Navigation and Quick Launch Menus? Here are the reasons & solutions for SharePoint 2010 audience targeting missing: 1. Enable audience targeting in SharePoint 2010 Site Collection Go to Site Actions >> Site Setting >> Click on &q
Audience Targeting Missing in SharePoint 2010? Audience Targeting Missing in SharePoint 2010? Reviewed by Salaudeen Rajack on May 18, 2013 Rating: 5

Set SharePoint Web Application Recycle Bin Configuration with PowerShell

May 13, 2013    , , , , ,
In continuation to my article SharePoint Recycle bins - Lets get it crystal clear , There are situations to set SharePoint recycle bin options programmatically with either object model code (C#) or with PowerShell. SharePoint 2010 powershell Script to Configure Recycle Bin: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Get the Web Application $WebApp = Get-SpWebApplication "http://SharePoint.crescent.com" #*** Set Recycle bin Options *** #Enable Recycle bin $WebApp.RecycleBinEnabled = $true #Set Retention Period to 90 days $WebApp.RecycleBinRetentionPeriod = 90 #To Turnoff Recycle bin Retention, use: $WebApp.RecycleBinCleanUpEnabled=$false #Set Second Stage Recycle bin Quota % $WebApp.SecondStageRecycleBinQuota = 100 #To turn OFF Second Stage recycle bin, use: $WebApp.SecondStageRecycleBinQuota = 0 #Apply the changes $WebApp.Update() Write-Host "Recycle bin Settings Updated!" SharePoint Recycle bin configuration with STSAD
Set SharePoint Web Application Recycle Bin Configuration with PowerShell Set SharePoint Web Application Recycle Bin Configuration with PowerShell Reviewed by Salaudeen Rajack on May 13, 2013 Rating: 5

Disable Delete List Option in SharePoint

May 11, 2013    , , , , ,
What? We've a SharePoint list provisioned to store & retrieve custom application settings in a SharePoint site. Its critical to prevent this list from any accidental deletion, so we want to disable delete list option from list settings in SharePoint. How? We can disable "Delete this list" link in SharePoint by setting the List or Library's AllowDeletion Property to "False". Once set, delete option will go hidden. Disable "Delete This List" in SharePoint list Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Get the web where the particular list lives $web = Get-SPWeb "http://sharepoint.crescent.com/sites/operations" #Get the list $list = $web.Lists["AppConfig"] #Make the list $list.AllowDeletion = $false $list.Update() Result: SharePoint delete list missing! By this way, we stop users from deleting SharePoint lists. If you notice, in some of the SharePoint lists & libraries (E.g. &qu
Disable Delete List Option in SharePoint Disable Delete List Option in SharePoint Reviewed by Salaudeen Rajack on May 11, 2013 Rating: 5

SharePoint 2010 Create Permission Level Programmatically

May 09, 2013    , , , , ,
While its relatively easy to Create permission levels in SharePoint 2010 UI, We had 2000+ site collections in a web applications and scripting/programmatic way to create permission level would be the best choice. We wanted to do a SharePoint permission level customization by eliminating delete capability from contributor permission level. Lets copy the contributor permission and remove the "Delete" capability from it. Copy Existing Permission level and change permission level Permissions: using (SPSite site = new SPSite("http://sharepoint.crescent.com")) { using (SPWeb web = site.OpenWeb()) { //Get the Contributor permission level SPRoleDefinition roleDefContributor = web.RoleDefinitions.GetByType(SPRoleType.Contributor); //copy Contributor permission level SPRoleDefi
SharePoint 2010 Create Permission Level Programmatically SharePoint 2010 Create Permission Level Programmatically Reviewed by Salaudeen Rajack on May 09, 2013 Rating: 5

How to Create New Permission Level in SharePoint 2010?

May 08, 2013    , , , ,
There are scenarios where requirements couldn't be fulfilled by OOTB permission levels. Here is one among them: User who has contribute permissions can add, edit, open, view and delete an item. What we want is to permit a user to add, edit, view but not delete an item. So, I needed to create a custom level permission to restrict a group of users from deleting items. Create Permission Level by Copying existing Permission Level in SharePoint 2010 Lets take an existing permission level "Contribute",  Copy and remove the ability to "Delete Items" from it. Open your SharePoint site collection (Root Web) in browser as a site owner. Click on Site Actions >> Site Permissions  Click on Permission Levels from the Ribbon to open the Permissions page. Because we planned to copy Contribute permission level, click on it to open its detailed permissions. Scroll to the end of this form and click Copy Permission Level. This gives you a new, unnamed form with
How to Create New Permission Level in SharePoint 2010? How to Create New Permission Level in SharePoint 2010? Reviewed by Salaudeen Rajack on May 08, 2013 Rating: 5

How to Add User to Farm Administrator Group in SharePoint?

May 07, 2013    , , , , ,
By default, the account which was used (logged in) to install SharePoint becomes the SharePoint Farm Administrator. There are situations, where we need to add additional Farm Administrators to our SharePoint farm in order to delegate the tasks. Follow these three steps to add a farm administrator in SharePoint. Add user to Central Administration Farm Administrator Group Add user to Web Application Policy with FULL control Add user as a ShellAdmin for all SharePoint databases. 1. Add new user to farm administrator group from Central Administration: To add farm administrator in SharePoint 2010, Navigate to Central Administration >> Security >> Manage the farm administrator group >> Add the user by clicking New >> Add Users SharePoint Farm Administrators group by default consists of Local server administrators. So, You can see (BUILTIN\Administrators) group is already referenced in the Farm Administrators group in Central Administration. Add user to
How to Add User to Farm Administrator Group in SharePoint? How to Add User to Farm Administrator Group in SharePoint? Reviewed by Salaudeen Rajack on May 07, 2013 Rating: 5

SharePoint Farm Administrator Cannot Access Site, Gets Access Denied

May 06, 2013    , , , , ,
Problem: SharePoint 2013 farm administrator cannot access site! They get access denied error. Root cause: Its a common misconception that SharePoint Farm Administrator will get access to all SharePoint sites in the farm automatically! Farm administrator get access denied error in SharePoint 2010 site collection when trying to browse. Solution to SharePoint farm administrator access denied error Farm Administrators gets control over SharePoint Central Administration, but not all sites. So, we have to explicitly grant access to required web applications to the Farm Administrator through web application user policies by navigating to: Central Administration  >> Security >> Specify web application user policy >> Add web application user policy in SharePoint using PowerShell  Above step can be automated for all web applications using PowerShell. Lets add a user policy in web application to grant full access to all web applications in the farm. Add-PSSnapi
SharePoint Farm Administrator Cannot Access Site, Gets Access Denied SharePoint Farm Administrator Cannot Access Site, Gets Access Denied Reviewed by Salaudeen Rajack on May 06, 2013 Rating: 5

SharePoint People Picker Showing Deleted Users? Remove with PowerShell

May 01, 2013    , , , ,
Problem: Few consultants left the company after their contract is over. Their AD account was deleted, They are removed from SharePoint site collections even. But still, SharePoint People picker showing deleted users! Root cause: Because, People picker gets users NOT only from AD, But from "User Information List" of the site collection also, which is explained in one of my post: SharePoint People Picker Showing Deleted User Accounts from Active Directory and SharePoint Site Solution: We've to remove the users from hidden User Information list. For a quick fix, we can navigate to: http://your-sharepoint-site/_layouts/people.aspx?MembershipGroupID=0 and remove users from User Information List to fix this problem. But how about removing multiple users in bulk from all site collections? Well, I wrote an utility to remove users from User Information List in C# SharePoint Object Model  Delete Users and Clean up User Information List This time, Lets do it with PowerSh
SharePoint People Picker Showing Deleted Users? Remove with PowerShell SharePoint People Picker Showing Deleted Users? Remove with PowerShell Reviewed by Salaudeen Rajack on May 01, 2013 Rating: 5

SharePoint Sign in as Different User - How to Clear Cached Password?

May 01, 2013    , ,
There is a weird issue when SharePoint users try to sign in as different user. Here is the scenario: User "A" logged in with his account in his PC. User "B" wants to login on SharePoint 2010 site with his credentials on user "A" machine by selecting "Sign in as Different User" User "B" will successfully logged in. Once user "B" sign out and user "A" opens the IE browser, he will still see SharePoint uses user "B" credentials and automatically logged with User "B" Login details, even if he tries to close all browsers and re-open same issue, unless we have to re-login again by Signing in with Different User i.e. user "A" They tried clearing the saved passwords from Browser by: Going to Internet Explorer >> Tools menu  >> Internet Options >> General >> Delete >> Select "Passwords" and clicking OK. But no luck! Root Cause: This is
SharePoint Sign in as Different User - How to Clear Cached Password? SharePoint Sign in as Different User - How to Clear Cached Password? Reviewed by Salaudeen Rajack on May 01, 2013 Rating: 5
Powered by Blogger.