Get Email from Document Libraries via PowerShell


There’s no feature to get all the email addresses used in libraries in a SharePoint Farm.

This tiny PowerShell Script will help.

function GetLibEmail ($WebApp)
{

    $WebApplication = Get-SPWebApplication $WebApp
    $WebApplication | Get-SPSite | Get-SPWeb  -limit all | ForEach-Object {
            write-host "——-"
            write-host "URL of Webs: " $_.Url
            $lists = $_.lists
            $lists | ForEach-Object {
            if( ($_.CanReceiveEmail) -and ($_.EmailAlias) ){
                write-host "Title of list: " $_.Title
                write-host "Email of list: " $_.EmailAlias
             }
          }  
     }

}

#URL of WebApplication as parameter

ModLibs -WebApp http://projekte.test.local

Advertisements

About binoeder

SharePoint and Project Server Consultant
This entry was posted in PowerShell, SharePoint. Bookmark the permalink.

One Response to Get Email from Document Libraries via PowerShell

  1. Nice use of pipes to write slick code. This is useful for getting mail enabled lists, but it’s also a neat structure for doing something with all the lists in your web application.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s