Advertisement
In this article we can see
how to send email only from a particular group of people using power shell, it
is very easy to user to remove/add new users whenever they want. In the below
code we created a SharePoint Group with name “DotNetSharePoint”
add-pssnapin
microsoft.sharepoint.powershell
$web = get-spweb
-identity
"http://dotnetsharepoint.com/sites/SharePoint2013/BusinessUsers"
$groupss =
$web.Groups.GetByName("DotNetSharePoint")
$emailgrouptoo =@()
foreach($user in
$groupss.Users)
{
$sendemailto =
$user.Email
$totalemail = $sendemailto
$emailgrouptoo+=$totalemail
}
#You can also get this below
information from Custom List also , in the article we are mainly showing how to
send email to Owners Group Using PowerShell.
$smtpserver = "yourSMTP
severname"
$emailfrm =
"emailidfrom whom you have to send this email"
$Subject = "We are sending email to Users"
$EmailBody = "You type some information which you
want to show in side the email body"
thanks for sharing this information
ReplyDeletebest devops training institute in sholinganallur
best data science training in sholinganallur
data science training in siruseri
azure training in sholinganallur
azure training in omr
angular js training institute in omr
angular js training in omr
Get best of SharePoint related topics covered at https://www.sharepointgems.com
ReplyDeleteEnvelopes Printed Stationary Business Directories Catalog Samples Drop-transport Samples Printed Circulars Formulas Books Mail Order Plans Magazine Subscriptions Name Listing Services Pen Pal Clubs, and so on, and so on email marketing
ReplyDelete