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

Find computer name and domain using Powershell

Sometimes it’s useful to know the computer name and domain you are working on. More than once I had to google for these commands because I just can’t keep them in mind, so I decided to write a quick post as a reminder. The following are my favorites.

The first one returns the FQDN of the computer on the format whereas the second one returns a list of information about the computer such as NETBIOS name (that could be different from the DNS name), domain name, phisical memory, etc… You can also select single properties, changing the cmdlet this way:

That’s all. As I said before this was a quick one :)
– Riccardo


Posted by Riccardo in Global, Tips & Tricks, 0 comments

Vintage Weekend Part II: Ottenere tutti gli utenti del sito con Powershell

Seconda parte della serie Vintage Weekend. Se vi siete persi la prima parte si tratta di esempi di script Powershell pensati per essere utilizzati con SharePoint 2007.

In questo caso il pretesto mi è stato dato da un cliente che aveva bisogno di conoscere tutti gli utenti e gruppi di una site collection. Come nell’esempio precedente trattandosi si SharePoint 2007 è necessario referenziare le librerie che interrogheremo prima di procedere. Successivamente, una volta memorizzato l’oggetto “site collection” effettueremo un ciclo su tutti i gruppi del sito e per ognuno di questi stamperemo a video tutti i nomi utente.

Happy PoSH
– Riccardo

Posted by sharepointpig in Global, PowerShell, 0 comments