Tuesday, April 18, 2017

Give Read Permission for SharePoint Add-in for Azure AD Send Mail to Office 365 Domain Group users.

Below are the Steps for Send Mail to Office 365 Domain Group or AD Group users from Provider Hosted ADD-IN. For this we needs to Give Permission for ADD-IN Client-ID.

1. Give Permission for Client-ID for Access AD Group. For this Open SharePoint online Management Power shell.  Run the Below

$msolcred = get-credential
connect-msolservice -credential $msolcred
## Set the add-in Client Id
$appId = "00000000-0000-0000-0000-0000000000000"

## get the add-in Service Principal
$appPrincipal = Get-MsolServicePrincipal -AppPrincipalId $appId 

## Get the Directory Readers Role
$directoryReaderRole = Get-MsolRole -RoleName "Directory Readers" 
##get the role you want to set

##Give the add-in the Directory Reader role
Add-MsolRoleMember -RoleMemberType ServicePrincipal -RoleObjectId $directoryReaderRole.ObjectId -RoleMemberObjectId $appPrincipal.ObjectId

##Confirm that the role has our add-in
Get-MsolRoleMember -RoleObjectId $directoryReaderRole.ObjectId

2. In My Example send Email from Remote Event Receiver. While Document Updated Alert Email send the uses available in Person or Group field. In this Example Azure Web-App as a Provider. Send Grid is used for SMTP.





Give Read Permission for SharePoint Add-in for Azure AD Send Mail to Office 365 Domain Group users.

Below are the Steps for Send Mail to Office 365 Domain Group or AD Group users from Provider Hosted ADD-IN. For this we needs to Give Permi...