Skip to content

Send email to all users in SharePoint group

Last week I was asked if it’s possible to send email to all SharePoint Group Members. Quick solution I tried was to select all users and click “Email Users” Under “Actions” menu in SharePoint user group. I t will select only user that are on the page not on the next page. You will see an arrow (pagination) to go to next page in case you have more than 30 users.
Item limit any for SharePoint users Group is set to 30 by default. You can increase it to whatever you want. But let’s say if you have 500 users in a group called “Members” you can set the view limit to 99 but “Email Users” under “Actions” menu will not work anymore. You can try. It will throw error something like “cannot send email to that number of users “
Of course there are more than one way to achieve this goal, below is one I came up with quickly and though will share.
Copy and paste each line individually after changing the URL with your site collection url.

$Site=Get-SPSite http://SiteCollectionURL
($Site.rootweb).groups | Format-table -Property name, owner
           # in my case I wanted to send email to all users in “Approvers” group
($Site.rootweb).groups[“Approvers”].users | Format-Table -Property DisplayName, Email
($Site.rootweb).groups[“Approvers”].users | Format-Table -Property Email >email.txt

You can modify the script and make it short, by adding more variables but this gave me what I was looking for. Wonder how this will work if one has thousands of users in a group. I don’t have any group with that big number so can’t test, if you have that big group let us know. Might have to use –LimitAll in command.

Another way to do this is open up excel click on data connections and add a new web data connection. Enter URL of the SharePoint group and it will ask you to enter your SPGroupUserslcredentials and will open up group view in excel where you can export every ting from the page in to Excel. Some formatting is needed here but you can easily get user first name and last name and then using formulas convert these 2 column in email address. Let me know if need more info on this option and I will post in detail.


Improve Performance for SharePoint and Project Server – Part 2

I have mentioned few tweaks/changes that can help improve SharePoint/Project server performance in Part 1.

I will add few more item here in Part 2 of the same article….

16 – Another important when installing OS before SQL installation you can make is, change the NTFS allocation unit size on your disks/drives. By default its 4096 bytes on windows server 2012 and by changing it to 64 you can easily gain some performance. for more reading :

17 – Make sure the initial size in the “Files” windows of “temp” database properties is set to some higher number. This is in addition to the additional tempDB files. Also “Auto Growth” option must be set to some higher number, not percentage.

18 –  One more place to look is paging file size configuration on the server. Normally it is set to a lower number and can be configured based on the system RAM and other. It is recommended to set the paging size up to 150% of the physical RAM but I will suggest you to look in to your environment first and then set those numbers. At the minimum make sure it is set to “allow system to set the size “option.

19 –   Out Put Cache – one of the thing over looked sometimes but make sure you have Out Put caching enabled on site that will help improve performance.

20 –   Blob Cache- In case of significant use of images on Sharepoint site enabling blob cache can be help full. If you are planning to use new feature like Images renditions, Blob cache is required. It also help improve performance by delivering those images faster from cache.

Feel free to add more in the comment section.

Why HNSCs in a Single Web Application? and Best Practices in SharePoint 2013..

The new recommendations and path suggested by the MS is to go with single web application and multiple Host Named Site Collections (HNSCs) instead of multiple web applications as we use to do in the previous version of SharePoint.

For Software Boundaries and Limits click here.

You can still go with the additional web application if functionality is needed that can not be achieved in the web app shared by all the HNSCs e.g. different authentication requirement SAML or FBA.

I have spent lot of time building this new site architecture and during my research I put together some notes (with links) from different articles written by MVPs and other famous authors/TechNet.

I used this during the implementation and share and show the importance of this new architecture and how to implement e.g. no manual IIS bindings and other best practices.  I thought I will share this online as well for quick reference for others too.

If you have been playing with this new model and want to show your client the importance of this new structure you can use these points mentioned below and feel free to add any additional in the comment section.

  1. From TechNet “The recommended configuration for deploying sites is using host-named site collections with all sites located within a single web application, as illustrated in the following diagram.”

    • From the same TechNet link mentioned above “We recommend host-named site collections  unless requirements dictate that path-based sites with alternate access mapping are necessary”
    • From the link mentioned above “You can use host-named and path based site collections in the same web application. To ensure that both types of site collections are accessible to users, do not put host header bindings on the IIS website of your web application”
  2. Corporate Portal with Host named site collection
  3. Why only One Web App is recommended : “ The problem is that even the base binaries needed to load a Site into memory (e.g. using separate web apps) has a high performance impact — and given that people generally want vanity URLs, which meant separate Web Apps in the past, HNSC is a great alternative.”
  4. As per MVP , Paul Stork “Yes you can add a host header in the IIS binding after the fact, but it’s not a supported design from Microsoft’s point of view and I really wouldn’t recommend it.”” link :
  5. Brenda (MSFT) talks about a Single Web Application “New features and existing features are optimized to work with host-named site collections like never before. However, it’s not just the feature that is important. It’s how it is configured — all host-named site collections are deployed to a single web application. The App model and Request Management, for example, are optimized for this configuration.”
  6. Maximum number of web application is 20 but as per the same TechNet article “We recommended limiting the number of web applications as much as possible. Create additional host named site collections where possible instead of adding web applications.”
  7. As per Trevor, MVP “You should try to limit the number of Web Applications (preferably 1). You can mix HNSC and Path-Based site collections within the same Web Application.”
  8. Logical Architecture Guidance for SharePoint by Steve Peschka. Benefits of one Web Application
  9. MVP, Trevor says regarding single Web App and single AppPool “The Microsoft model provides far better scalability than individual Web Applications would. Each Web Application (or Application Pool) has a significant amount of overhead, just in the base binaries alone. This is why Microsoft is encouraging towards a single Web Application + single Application Pool + host-based site collection model”
  10. Removing IIS binding manually by Russ Maxwell “When you create a web application and specify a host header URL, you stamp the host header URL on the spwebapplication object which is stored in the objects table in the configuration database. When you try to change the host header URL by updating the Alternate Access Mapping and manually update the bindings in IIS, the SPWebApplication object is never updated so it continues to maintain knowledge of the original host header URL and not the new one. When you start the Microsoft SharePoint Foundation Web Application service in Central Admin, the information from the associated SPWebApplication object in the configuration database is used when instantiating IIS Sites. This is why the original host header URL shows up.”
    Also see this where MS recommend to remove IIS binding manually.
  11. Last but my favorite ,One of the best article written by Trevor Seward to show comparison of resources usage when use multiple web applications vs single web application with multiple HNSCs.

Feel free to add any comments or share your thoughts …

Restore-SpSite : The operation that you are attempting to perform cannot be completed successfully

Recently I was asked to move a site collection from one farm to the other. No problem, piece of cake, right?

That what I thought and ran the command

SPSite-Restore …..After backing up. I have 20 site collection in the data base already and limit is set to 2000 but got this error

Restore-SpSite : The operation that you are attempting to perform cannot be completed successfully. No content databases in the web application were available to store your site collection. The existing content databases may have reached the maximum number of site collections, or be set to read-only, or be offline, or may already contain a copy of this site collection. Create another content database for the Web application and then try the operation again


Woo, I will never create a new data base for this, here is how I resolved this. Run the same command with additional parameters of “ Databasename” & “DatabaseServer”

E.g. Restore-SpSite URLGoesHere –Path **.bak -force –DatabaseServer ** -DatabaseName **

And it worked this time. Site was successfully restored.


In some cases if you are trying to restore or create a new site with the same url that was deleted some time ago, there are possibilities it has not been removed from the database permanently in that case try this.



If the site exist with the same URL remove using

Remove-SPDletedSite –Identity

As shown in the image above. Once removed this site will be removed from database for ever permanently.

Hope that helps.

What is Web Application , Application Pool and Site Collection in SharePoint.

In this article I try to explain difference between web application, application pool & site collections etc. Pretty basic topic but might help someone out there to understand the difference and how each object connects with other and what it does in term of functionality and connections with each other.

I will use an example and your opinion can be lot different than this, if so, please feel free to leave a comment and I will update this accordingly to make concept easier to understand.

Let’s do some definitions first: I know we don’t like definitions but there are easy ones.

Application Pool:

An application Pool is IIS object that contains either one or multiple web applications in it. On a high level application pool reserves or releases memory for web applications (and every thin in that web application) to use and take it back when not in use. It does lot more than this like security & web app isolation but we will discuss about this some other time.

Web Application:

Web application is nothing but just an IIS site. Which, in SharePoint comes with on data base attach to it by default (you can have more than one data bases but for simplicity we will discuss this some other time). Think of web application as an empty container that has nothing inside i.e. No contents.

Site Collection:

From the name it seems like a collection of sites but it’s an object with in the web application. As mentioned earlier the web application is an IIS Site, but site collection is a SharePoint object and you will not see this in IIS, it resides in web application. You can have n number of Site collection in a web application. Usually site collections are our team sites, Project sites etc.

Sub site & Lists, libraries

Sub site is a complete “web site “but it lives with in site collection (and that’s why it is called site collection). There can be n number of sites with in a Site Collection and each site can have a multiple lists and libraries where we store contents


Let’s take an example of an under construction house. All we have is boundary of the house and full basement, so if you go in to house it’s empty, nothing in there and basement is there. This is a web application that has one data base ( basement ) and its empty, address of this house is http://SPHouse and you can see this address in IIS as well.

Let’s build one room in this empty house and few closets and drawers with in this room. This room is our site collection and closets and drawers will be lists and libraries. You can have several rooms in this empty house and this way you will end up many site collections.

In each room you can have several small rooms let’s call them sub sites, these sub sites will always be in that site collection.

Now in technical terms you have one web application that deals with authentication and IIS routing, NLB and much more and within that one web application you can have N number of site collections (rooms), By default each site collection use the same Database that comes with the web application ( our basement) to store all the contents but we use list an libraries with in those site collections to store and manage contents in that data base( let’s say we forgot to build stairs to go in to basement)

Some URL examples (addresses)

This is a very basic overview of each object. But with the new version of SharePoint ( 2013 ) there are several options for HNSC and managed path that allow to configure URLs of end user choice like vanity URLs or dedicated url for each site collections i.e. not dependent on web app url and much more . But I will cover this at some other time as I want to keep it basic for now.

I will try to add some diagram too to help support the architecture of this house, if I find one. Feel free to leave a comment to make it more easier to understand for some folks out there.