Tuesday, November 18, 2014

Procedure and tips to set up audience targeting of OneDrive for Business in Office 365 from SharePoint Server 2013 on-premises


As we discuss in previous session you can redirect targeted users to OneDrive for Business in Office 365 when they click OneDrive or Sites in the navigation bar from SharePoint Server 2013 on-premises. The way to implement this is to configure audiences in Microsoft SharePoint Server 2013. Here is the procedure to configure an audiences named “O365 users” for specific AD group.


1. Sync AD groups that would be used for audience
Before configure the audience from SharePoint central administration, you should use some AD tool to verify the type of the groups you would need to configure as audience. You should find the container that contains the group. Here is the screenshot to display the "O365.users" group from AD explore. The group is AD group inside "Exchange" container as highlighted.



 Now, you con use the group information to configure audience in SharePoint. Login to central administration-> Manage service applications-> User Profile Service Application-> Configure Synchronization Connections-> Edit or create new Synchronization Connections -> Enter password for the account used for AD sync -> Populate Container -> Select "Exchange" since the group is in this container.



 Please note, you might have multiple different groups in the containers like "Exchange", "Groups, and "CusGroups" depends on your AD configuration. You would need to identify which container groups you want to sync. Otherwise, the sync might take long time and will use lot of resource on the server.

SharePoint has a limitation and it will only display certain number of groups in the AD sync UI. As a result, you might not be able to just select the groups you need to sync. I'll provide a better way to configure to sync only group you need to sync in future. At this time, we will sync ALL groups in "Exchange" container.

2. Add an audience
  • On the Central Administration Web site, in the Application Management section, click Manage service applications.
  • On the Service Applications page, in the list of service applications, click the row of the User Profile service application that you want to configure.
  • On the Manage Profile Service page, in the People section, click Manage Audiences.
  • On the View Audiences page, click New Audience.
  • On the Create Audience page, in the Properties section, in the Name box, type a name like “o365 users” for the new audience.
  • In the Description box, type a detailed description of the new audience.
  • In the Owner box, type the account name of the user who will own and manage this audience. We recommend to use the SharePoint installer account.
  • You can click Check Names to verify that you have typed the name correctly, or you can click Browse to search for an account name.
  • Select Satisfy all of the rules to require that all of the rules need to be satisfied in order for a user to be included in the audience. You could select Satisfy any of the rules to allow membership in the audience as long as any of the rules are satisfied.
  • Click OK.
  • On the Add Audience Rule page, take one of the following actions: 
    • Select "User"
    • Operator as "Member of"
    • Values as "O365.Users" the group synced in previous session
  • Click OK as in the below screenshot.
If you are getting error "No security groups or distribution lists were found based on your search request. Refine the search text, and then rerun the search request." as in the following screenshot when searching the group you want to configure, you would need to check the step #1 again.

You could use Powershell to add the new audience if you need to make it consistent for different environments.

3. Schedule audience compilation
  • On the Central Administration Web site, in the Application Management section, click Manage service applications.
  • On the Service Applications page, in the list of service applications, click the row of the User Profile service application that you want to configure.
  • Clicking the row activates options in the ribbon.
  • In the Operations group of the ribbon, click Manage.
  • On the Manage Profile Service page, in the People section, click Schedule Audience Compilation.
  • On the Specify Compilation Schedule page, select the Enable scheduling check box.
  • Click OK.

4. Compile an audience
  • In the Central Administration Web site, in the Application Management section, click Manage service applications.
  • On the Service Applications page, in the list of service applications, click the User Profile Service Application link that you want to configure.
  • On the Manage Profile Service page, in the People section, click Compile Audiences

5. View audiences
  • In the Central Administration Web site, in the Application Management section, click Manage service applications.
  • Click "View Membership" on the audience.
  • You should see the users compiled into the audience


6. Verify targeting audience for Office 365 redirect
Now, we have the audience configured and you could use the following Powershell script to verify whether user has been configured the redirect to Office 365.


$userID=‘domain\userID’

$ca = Get-spwebapplication -includecentraladministration | where {$_.IsAdministrationWebApplication}

$spsite = $ca.url

$site = Get-SPSite $spsite

$context = Get-SPServiceContext $site

$upsa = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)

$profile = $upsa.GetEnumerator() |Where-Object {$_.AccountName -eq $userID}

$profile

You should look at the value of $profile.HybridRemotePersonalSiteHostUrl. All the users in the audience group should have the correct Office 365 URL. Other users should have null value.


At this time, you have audience targeting configured and only those users will be redirected to Office 365 from SharePoint Server 2013 on-premises.

We will continue in next session to configure SharePoint on-premises search to search content from both on-premises and Office 365.

See Ultimate procedure to display SharePoint online hybrid search results in SharePoint Server 2013 for other steps to configure hybrid search. 

No comments:

Post a Comment