powershell

Find and remove missing features, the PowerShell way

I do SharePoint updates and migrations since a long time and one of the most annoying error I often get is the "Missing feature". Searching the web you will find a lot of posts that show how to find the missing feature details by querying the content database. Most of them warn about the fact that querying SharePoint database is non supported by Microsoft (ref. https://support.microsoft.com/en-us/help/841057/support-for-changes-to-the-databases-that-are-used-by-office-server-pr). You could create a database snapshot and query against it or you could use 3rd party tools, but if none of these fit your needs you could try the PowerShell way.

Read More

Posted by Riccardo in PowerShell, Troubleshooting, updates

Check for free disk space with Powershell

Recently I’ve been asked from a client to create a script to check for free disk space on their SharePoint VMs on a daily basis, no matter if other software, like SCOM, was in place or not.

I created a PowerShell script that checks all drives from a list of servers. If the script detect less 20 GB it sends and e-mail to the SharePoint admin.

See the script below for details. Continue reading →

Posted by Riccardo in Global, PowerShell, 0 comments

List all publishing pages and their associated page layout

I’ve often been asked to get almost any kind of report about SharePoint’s content. This time the customer asked me to get the list of all publishing pages and their page layout in a site collection. This is quite an easy task, of course using PowerShell! It’s just a matter of looping through all SPWebs in the site collections, get the page library content and print some item properties in a text file. Let’s see how to do that.

Since this is just a quick tip take a look to the comments in the script, they should be self explaining :)

Continue reading →

Posted by Riccardo in Global, 0 comments
Enabling content type on multiple SharePoint lists with PowerShell

Enabling content type on multiple SharePoint lists with PowerShell

In a new project I’m working on I had to create a new Content Type and make it available on all the document libraries in the site collection. I had to choices: browse each document library’s settings page and enable the content type via the UI or let PowerShell do it for me. Since I’m really lazy I chose the scripting way.

A few days ago I published the script on TechNet Gallery,Enabling content type on multiple lists with PowerShell. As you can imagine the script enables a content type on each document library in a site collection. It takes three parameters: site, name and list.

Continue reading →

Posted by Riccardo in PowerShell, TechNet Gallery, 0 comments
Populate SharePoint group from User Profile using Powershell

Populate SharePoint group from User Profile using Powershell

Happy new year everyone!! A few days before the end of the year I published a new script on TechNet Gallery about how to populate a SharePoint group reading from User Profiles using Windows Powershell.

I chose to read from User Profiles instead of querying Active Directory because user profiles could have more information than AD since we could add a synchronization connection that reads from BCS or other sources. Continue reading →

Posted by Riccardo in TechNet Gallery, 0 comments