how to get list of site collection and sites last modified date in sharepoint using powershell

how to get list of site collection and sites last modified date in sharepoint using powershell
We having a requirement to know the last modified date for a web application, for the web application having so many site collection and sub sites under the web application doing it manually it will take lot of time, so we prepared a script to know the last modified date under the web application having the list of site collection and its sub sites with URL, Title and site last modified date.

Get-SPWebApplication – Is used to identify the web application URL.
Get-SPSite  – Is used to get the  site collections.
Get-SPWeb – Is used to get the sub sites.

Run the below Power Shell to get all sites last modified information form a particular web application command.

List of sites under Web Application last modified date.

Get-SPWebApplication http://dotnetsharepoint/ | Get-SPSite -limit all | Get-SPWeb -limit all | select url,Lastitemmodifieddate | sort-Object -Property LastItemModifiedDate  > lastmodifiedinformation.txt

Once the script completed, we can verify the list on sites information  in the text file.

In the same way if we want to get the last modified date only for a particular site collection and its sub sites run the below script.

List of sites under Site Collection last modified date.

Get-SPSite http://dotnetsharepoint/sites/SP/ | Get-SPWeb -limit all | select url,title,Lastitemmodifieddate | sort-Object -Property LastItemModifiedDate  > lastmodifiedsitecollectioninfo.txt



Change the site logo hyperlink URL in SharePoint

Change the site logo hyperlink URL in SharePoint
In SharePoint having the site logo I will indicates the link of the current siteURL, when we want to change the different URL we have to do modify in the master page level.

Locate and identify the currently using master page take a backup before modifying the master page.
Best use of modifying the master page using VS or SharePoint Designer.
Open the master page and search for SPSimpleSiteLink.

This is the exact code we can able to find.
     <SharePoint:SPSimpleSiteLink CssClass="ms-siteicon-a" runat="server" id="onetidProjectPropertyTitleGraphic" >
     <SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=23" runat="server"/>
      </SharePoint:SPSimpleSiteLink>

Replace the code with following changes with your URL.

  <SharePoint:SPLinkButton runat="server" CssClass="ms-siteicon-a"  NavigateUrl="http://dotnetsharepoint.com" id="onetidProjectPropertyTitleGraphic">     <SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=23" runat="server"/>
  </SharePoint:SPLinkButton>

SPLinkButton is the property to navigate the URL.

Save the master page and check the logo hyper link url has changed.


There was an error processing the request my site in SharePoint

We are having a My Site in our SharePoint environment,for every one having their own personal site,in that site when they  tried to edit SharePoint profile information we are getting issue

“There was an error processing the request my site in SharePoint”
                        

We are having multiple web applications and one Managed Meta data service application.

Web application 1: http://dotnetsharepoint.com -> connected to Managed Meta data service and all service applications connected with default proxy group.
Web application 2: http://mysite.dotnetsharepoint.com -> not connected to Managed Meta data service and all remaining service application connected with custom proxy group.

Navigate to Central admin->Application management ->Configure service application associations
There we can able to see all the web application connections connected to Application Proxy Default/Custom.

In my case “my site web application” is connected to “Custom proxy group”, click on the custom and check the check box of “Managed Meta data service application” and click ok.

Now navigate to my site and we can able to edit and update the profile information without issues.



Sorry, you're not set up to follow Unfortunately, it looks like your account hasn't been set up to follow documents or sites.


When we are trying to "follow" a document we are getting the error "Unfortunately, it looks like your account hasn't been set up to follow documents or sites."
Using the "Follow" link we can Follow the Sites,Documents,People and #Tags.
Once we are following these features we can keep track of all these changes.

First check weather My Site is Configured or not.

Also make sure that we are having required permissions to follow the content.

Navigate to ->Central Admin->Application Management->Manage service applications->Click on user on your "user profile service application"->Click on Manage User Permissions.
here we have to check the option as shown in the below screen shot.


Once we verified the permissions,now we can able to follow with out any issues.




Sorry something went wrong with adding the app.click to retry

Sorry something went wrong with adding the app.click to retry
We tried to  install an access app and that installation has failed,we are unable to remove the apps in SharePoint through GUI  we got this error "Sorry something went wrong with adding the app.click to retry",The app cannot be removed or uninstalled from GUI,Remove option is also not available.
Navigating to the Site Contents,while seeing the "Access App" corrupted list its not looking good to see.

Finally we tried there is an option using the power shell we can uninstall the corrupted app as shown in the below.


$geturl = Get-SPAppInstance -Web <Your URL Name>

$getapp = $geturl  | where {$_.Title -eq '<app title Name>'}

Uninstall-SPAppInstance -Identity $getapp 


Once the Power Shell ran's completed successfully,go and verify the list is deleted successfully.



How to open the closed web parts in SharePoint?


when we edit the webpart we can able to dropdown options like Close,Delete.
Some times user scared what would happen if they click on delete the webpart,so they will click on close.once click on close the webpart is gone!.
It is very surpriesed how to get back the closed webpart,we can able to see the web part maintenance page by appending with ?contents =1,but it wont usefull to get back the webpart again.

Solution:
Edit the page
Click on the add web part
In the top ribbon "Categories" last option "Closed Parts" click on it,we can able to see the closed web parts.Select the particular webpart and clik on Add as shown in the image below.

Now the closed  web part is appearing, our problem is resolved.


Set the masterpage using PowerShell in SharePoint

Set the masterpage using PowerShell in SharePoint
 Using Power Shell We can easily change our custom master page in our SharePoint site,once we prepare the script we can use for every time to change the master page.
 "Get-SPWeb" i used to get the site URL of the SharePoint in a variable.

We have two Properties to control the master Page settings, CustomMasterUrl and MasterUrl

Site Master Page         ---   CustomMasterUrl
System Master Page    ---   MasterUrl

Example:
$web = Get-SPWeb http://Dotnetsharepoint.com
$web.CustomMasterUrl = "/_catalogs/masterpage/Custom.master"
$web.MasterUrl = "/_catalogs/masterpage/Custom.master"
$web.Update()


If we have a site collection under a managed path like "sites”, we can change using 

“/sites/SITECOLLECTION/_catalogs/masterpage/Custom.master"
$web.CustomMasterUrl = "/sites/DotnetSharePoint/_catalogs/masterpage/Custom.master"
$web.MasterUrl = "/sites/DotnetSharePoint/_catalogs/masterpage/Custom.master


Labels

.Net Interview Questions add custom button in sharepoint using javascript Add custom column property into a PageLayout in SharePoint Add Page Title on their browser's title bar in SharePoint Customly add zip files in blogger Add-SPOSiteCollectionAppCatalog : Must have Manage Web Site permissions or be a tenant admin in order to add or remove sites from the site collection app catalog allow list Advance SmartObject An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL. Angular 2 Angular JS Angularjs Angularjs 1 anonymous users accessing lists and libraries App Permissions for SharePoint 2013 asp.net membership unique email Asp.net TreeView Control asp.net. Attendees in SharePoint Auto refresh list using Content Editor WebPart in SharePoint 2013. Auto Refresh SharePoint list using JavaScript Block and unblock of attachment types in SharePoint Blogger C# Callouts in SharePoint 2013 Cascading Dropdown list in SharePoint change onenote to another location. change SuiteBarLeft in SharePoint 2013 check if userid exists in database c# click node text to expand/collapse in Treeview client object model Close webpart CQWP crate chart using BI site in PPS Create a modern team site collection in SharePoint online Create BI chart in PPS SharePoint 2013 create filter in dashboard designer. create kpi's in dashboard designer create kpi's in SharePoint 2013 dashboard designer Create List Create List In SharePoint Create List using Power Shell Script Create Lookup Field in List using Power Shell Script Create lookup field in List create SharePoint List custom view. create SharePoint List views in List Schema create site collection in site collection in SharePoint using powershell created Date Time calculated field in SharePoint Cross site Collection in SharePoint 2013 Crud Operation in Asp.net Using Stored Procedure Custom MasterPage Approval in SharePoint custom view for survey list Customly add SharePoint List view in Page. delete items in sharepoint using powershell Difference between Angular 1.x & Angular 2 difference between Office 365 and Windows Azure difference between Windows Azure and Office 365 in sharepoint? DifferenceBetween discussion board Display Data in Grid View display radio buttons and choice fields horizontally in SharePoint 2013 Document library DotNet Drag and drop documents in document library in SharePoint dynamically populating values from one list to another list using jquery in sharepoint edit and delete buttons in datagridview Edit Links email notification using Nintex enable anonymous access in SharePoint 2013 enable app catalog sharepoint online site collection powershell Enable appcatalog site collection level using PowerShell based on Input file Enable versions for list and library except the hidden lists using PowerShell Script Error occurred in deployment step 'Recycle IIS Application Pool': Cannot resolve model for the project package Errors&Solutions Export document library in sharepoint using powershell Export particular Group in Term Store Management in SharePoint 2013 Export to Excel first release Flow Flow features free disk space on servers using powershell Friendly URLs and Managed Navigation in SharePoint 2013 get a list of site collection with template in web application using PowerShell Script in SharePoint Get attachments in SharePoint custom list using c# get current list item id sharepoint programmatically Get current url using jquery Get data from SharePoint list using Rest api & Angular JS Get Random Get Random SharePoint items using PowerShell Get Random values from SharePoint list using PowerShell Get url of the last value using jquery Get-SPOSite : The managed path sites/yoursitename is not a managed path in this tenant. Getting Email From User Hide “Edit Links” in left navigation SharePoint 2013 hide button in sharepoint based on permissions Hide column in SharePoint List view hide fields using client side object model Hide list in Quick Launch in SharePoint using PowerShell How to add Custom Tiles to SharePoint site Page. How to add extension files in Search Navigation in SharePoint 2013 How to Add Multiple users Using SharePoint People Picker How to add SharePoint list view in Page using C# How to Approve MasterPage using PowerShell in SharePoint How to bind Multiple users Using SharePoint People Picker how to change indicators on kpi performance how to check if an email address already exists in the database in asp.net how to configure workflow manager platform for SharePoint 2013 how to create calculated value using powershell how to create certificate in SharePoint How to create flow. how to create gantt chart webpart in sharepoint how to create KPI indicators in Dashboard designer How to create moden communication site in SharePoint online How to create Multi selected filter in Dashboard How to create nintex workflow in sharepoint how to create rdlc reports in asp.net How to Display Data Grid View in ASP.net How to enable anonymous access in SharePoint How to find data in datagridview in c# How to get image names from the folder using C# how to get particular list content type id in SharePoint 2013 How to get QueryString value in SharePoint WebPart Programatically how to get the current item id for newly created item using REST API and JQuery how to hide list in sharepoint how to know who created list in sharepoint How to make a Site Collection Read-Only in SharePoint 2010 How to overlay Office 365 shared calendar on SharePoint Site how to pass jquery value to asp.net textbox control How to pass pagename as a browser's title bar in the page how to remove unused Application Pool in SharePoint how to remove zone using powershell script How to send mail to particular group of people using PowerShell how to update modified by and created by using powershell how to uplaod RAR files in blogger import csv data into sharepoint import data using powershell Import group to term store management using SharePoint 2013. InfoPath InfoPath Cascading Dropdown list Insert update delete in datagridview in C# winforms Integration from SharePoint to k2. K2 Smart Forms for SharePoint JavaScript Injection jquery JSON K2 blackpearl K2 Designer K2 Designer Workflow. K2 smartform cascading dropdown list k2 Workflow K2 workflow to send a mail with PDF left navigation Local Term Set in managed meta data Managed meta data navigation in SharePoint 2013 Managed metadata service in SharePoint 2013. Managed Navigation in SharePoint 2013. Managed Promoted Sites. meta data navigation Microsoft Flow New Features New-SPConfigurationDatabase The user does not exist or is not unique NintexWorkFlow Office 365 OneDrive OneNote overwrite existing document in sharepoint using javascript PDF Converter PDF Method in K2 Performance Point Service in SharePoint 2013 PerformancePoint Services Configurtion PerformancePoint Services Configurtion for SharePoint 2013 PerformancePoint Services in SharePoint Server 2013 Popularity trends in SharePoint 2013 Pages populate dropdown list dynamicallyusing jquery Power Power Automate Power Shell Power shell script to get SharePoint site size. PowerApps powershell read xml PowerShell Script PowerShell script to get list of users from SharePoint groups PowerShell Scripts in SharePoint 2013 Powershell to set the masterpage in SharePoint Promoted Links Promoted Sites psconfig.exe quick launch Rdlc reports Readonly Column in SharePoint Editview Realtime DotNet Interview Questions Recent Dotnet interview questions Recent SharePoint interview questions recover deleted OneNote page. OneNote content is missing Regional Settings in SharePoint 2013 Replace New Item text in SharePoint Rest API Schedule PowerShell Script Search in SharePoint 2013 Search navigation in SharePoint 2013 Secure store service SecureStore Services SecureStore Services configuration for SharePoint 2013 self-signed certificate on IIS Server Send email to members of SharePoint Group using PowerShell sharepint2010 sharepoin2010 SharePoint 2013 SharePoint 2010 SharePoint 2013 SharePoint 2013 Dashboard Designer SharePoint 2013 features SharePoint 2013 Interview Questions SharePoint 2013. SharePoint 2013.disable views from user to create SharePoint 2013.Power shell SharePoint 2013.SharePoint 2010 SharePoint 2016 SharePoint Administration SharePoint Alerts and Reminders SharePoint App Configuration SharePoint Apps SharePoint Bulk upload SharePoint Calculated field SharePoint Calendar View sharepoint interview questions SharePoint online interview questions SharePoint online training SharePoint Onprem vs Online SharePoint RealTime Online Training SharePoint2010 SharePoint2013 SharePoint2016 SharePointInterview SharePointOnline SharePointOnline;Restore deleted site;SharePoint 2013 show data in datagridview in C# Simple Insert update Delete Retrieve Clear in asp.net. Site Collection Operations in SharePoint 2013 Site Collection Read-Only in SharePoint 2013 site contents Sorting & Filtering SPO SPSite Site Collection Operation parameters in SharePoint 2013 Step by step to create rdlc report in .Net Store names in text files in C# Sub site Subsite Term store management. The server was unable to save the form at this time. please try again UI New look update created by using client side object model update field values in SharePoint using powershell update items in SharePoint list using client object model update modified by field using client side object model upload zip files in blog use IsNullOrEmpty in PowerShell VirtoSoftware VirtoSofware vitrosoftware WebParts what is Document Set in SharePoint 2010 What is Filter in SharePoint Dashboard what is Limited-access user permission lock down mode feature What is Modern Team site What is Target Audience in SharePoint Who Created Site Using PowerShell Workflow in SharePoint 2013 Workflow management platform in SharePoint 2013 Workflow manager for SharePoint 2013 XSL-Template.