Tuesday, June 16, 2015

Group membership in SharePoint Online

Yesterday, one of my customers asked me to provide her a list of groups and its members for her main SharePoint site. An internal technician used to provide her that information every month by manually going to the site and copying/pasting screenshots of each group.
I decided to use PowerShell for that. I have never used PS cmdlets for SharePoint Online before, so this is my first try. I hope it is useful for you.

$cred = Get-Credential
$adminSite = "https://contoso-admin.sharepoint.com/"
$rootSite =  "https://contoso.sharepoint.com/"
Connect-SPOService -Url $adminSite -Credential $cred

$groups = Get-SPOSiteGroup -Site $rootSite

$objectCollection = $groups |

    ForEach-Object {
        $groupName = $_.LoginName
        $_.Users | ForEach-Object {
            $user = Get-SPOUser -Site $rootSite -LoginName $_
            $properties = @{
                GroupName = $groupName;
                UserName = $user.DisplayName;
                LoginName = $_
            New-Object -TypeName PSObject -Property $properties



Let me know in the comments if there is something that can be done to make it run faster (it takes about 80 second to complete for this specific tenant).

Wednesday, January 16, 2013

Enable Mailbox’s UM features with Lync On-Premises

I have a call today from a customer that has Lync on-premises already deployed. He moved from Exchange on-premises to Exchange Online a while ago and had the UM integration between Lync and Exchange Online already configured. He finally moved his users from a E1 plan to E3 plan and wanted to know how to enable VM and other UM features. I wrote the following instructions for him that I want to share with all of you:

I.                   Enable UM in the mailbox:

1.       On Exchange Online: Manage My Organization/User & Groups/Mailboxes, open the user's mailbox
2.       Expand Phone & Voice Features
3.       Click on Unified Messaging and then click on Enable
4.       On Enable UM Mailbox (Step 1 of 2), click Browse and select a UM Dial Plan Policy
5.       On Enable UM Mailbox (Step 2 of 2), leave the default values (or change the extension if necessary)
6.       Click Ok to save

II.                 Assign a Hosted UM Policy to the users:

1.       Connect to the Lync pool using Power Shell:
$cred = get-credential
$session = New-PSSession -ConnectionUri https://lyncpool.domain.com/ocspowershell -Credential $cred
Import-PSSession $session
2.       Run the following PowerShell commands:
Grant-csHostedVoiceMailPolicy -identity <user> -PolicyName "Exchange Online"
Set-csUser -identity <user> - HostedVoicemail $true

Very straight forward steps. I hope this post is helpful to you.