“Attachments” folder in OneDrive for Business


In the first week of January, one of our customer rolled out OneDrive for business function to 5000 Users.  After all the sites were provisioned, some users came back and asked question about a “Attachments” folder.  We did not had any details. 

SNAGHTML15249fd

After some research I did found about “Email Attachment” folder.  This folder will be used by Office 365 Outlook App to store attachments to OneDrive.  This feature was introduced back in January 2016. You can find more information from https://blogs.office.com/2015/01/14/save-outlook-com-email-attachments-onedrive-one-click/

After working with Microsoft, we are told that this feature is part a new feature that is being rolled out. 

Focused Inbox for Outlook for Windows, Mac and web

The Focused Inbox helps you focus on the stuff that matters most. Loved on Outlook for iOS & Android, now available on Outlook for Mac. Soon to be available on all Outlook endpoints. More details

SharePoint Online Site Alerts with Mail-Enabled Security Groups


SharePoint alerts are important part of end user functions for SharePoint sites.  Alerts can be created for Lists, Libraries, folders and individual items.  You can create alerts for yourself and others.   In SharePoint Online you can not send alerts to mail-enabled Security Groups by default. You must add the Mail-Enabled security Group one SharePoint group with view permissions.  SharePoint Alerts will work.  If you do not want to add the group to SharePoint then you can use the Outlook Rules to forward email to the group.  SharePoint workflow can also be used to send email as well.

Disable OneDrive Sync for SharePoint Online Site Libraries


https://gallery.technet.microsoft.com/Disable-OneDrive-Sync-for-71f99ceb

Write-Host “Please Enter SharePoint Online Service Administrator Credentials!”
$Creds = Get-Credential

$SuperAdmin = “SCAadmin@tenant.onmicrosoft.com”

$AdminUrl = ‘https://admin.sharepoint.com’

Add-Type -Path “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll”
Add-Type -Path “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll”
Add-Type -Path “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll”

Connect-SPOService -Url $AdminUrl -Credential $Creds
$spocredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Creds.UserName , $Creds.Password)

$Sites = Get-SPOSite -Limit All | Select-Object Url
Write-Host “Total Sites are ” $Sites.Count -ForegroundColor Green

foreach($Site in $Sites)
{
    try
    {
        Set-SPOUser -Site $Site.Url -LoginName $SuperAdmin -IsSiteCollectionAdmin $true -Verbose
        $SiteUrl = $Site.Url
        Write-Host $SiteUrl

        #Get the Client Context and Bind the Site Collection
        $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl)
        $ctx.Credentials = $spocredentials
        #Authenticate
        $Rootweb = $ctx.Site.RootWeb
        $ctx.Load($Rootweb)
        $ctx.Load($Rootweb.Webs)
        $ctx.ExecuteQuery()

        Write-Host $Rootweb.Title
        write-host $Rootweb.ExcludeFromOfflineClient

        $Rootweb.ExcludeFromOfflineClient = $true
        $Rootweb.Update()
        $ctx.ExecuteQuery()

        #Fetch the users in Site Collection
        foreach($web in $Rootweb.Webs)
        {
            try
            {
                $ctx.Load($Web)
                $ctx.ExecuteQuery()
                Write-Host $web.Title
                write-host $web.ExcludeFromOfflineClient
                $web.ExcludeFromOfflineClient = $true
                $web.Update()
                $ctx.ExecuteQuery()
            }
            catch
            {
                Write-Host “Exception at Sub Web. Script will continue” -ForegroundColor Red
            }
        }

    }
    catch
    {
        Write-Host “Exception at Root Web. Script will continue” -ForegroundColor Red
    }
}

Export Office 365 User Roles and Members to Text or CSV file


$Creds = Get-Credential -Message “Please enter SharePoint Online Administrator User and password.”
Connect-MsolService -Credential $Creds

$Roles = Get-MsolRole | ? Name -Like “*”
foreach($Role in $Roles)
{
    $RoleName = $Role.Name
    $Members = Get-MsolRoleMember -RoleObjectId $Role.ObjectId
    if($Members)
    {
        $Role.Name | Out-File -FilePath C:\Scripts\Admins.txt -Append -Encoding default -Force
        $Members | Out-File -FilePath C:\Scripts\Admins.txt -Append -Encoding default -Force
    }
    else
    {
        $Role.Name | Out-File -FilePath C:\Scripts\Admins.txt -Append -Encoding default -Force
        “No Members” | Out-File -FilePath C:\Scripts\Admins.txt -Append -Encoding default -Force
    }

}

# You can also create a better CSV

$UserRoles = @()
$Roles = Get-MsolRole | ? Name -Like “*”
foreach($Role in $Roles)
{
    $RoleName = $Role.Name
    $Members = Get-MsolRoleMember -RoleObjectId $Role.ObjectId
    if($Members)
    {
        foreach($Member in $Members)
        {
            $Role = New-Object PSObject
            Add-Member -input $Role noteproperty ‘RoleName’ $RoleName
            Add-Member -input $Role noteproperty ‘RoleMemberType’ $Member.RoleMemberType
            Add-Member -input $Role noteproperty ‘EmailAddress’ $Member.EmailAddress
            Add-Member -input $Role noteproperty ‘DisplayName’ $Member.DisplayName
            Add-Member -input $Role noteproperty ‘isLicensed’ $Member.isLicensed
            $UserRoles += $Role
        }
    }
    else
    {
        $Role = New-Object PSObject
        Add-Member -input $Role noteproperty ‘RoleName’ $RoleName
        Add-Member -input $Role noteproperty ‘RoleMemberType’ “”
        Add-Member -input $Role noteproperty ‘EmailAddress’ “”
        Add-Member -input $Role noteproperty ‘DisplayName’ “”
        Add-Member -input $Role noteproperty ‘isLicensed’ “”
        $UserRoles += $Role
    }
}
$UserRoles | Out-GridView

Export Office365 User Roles to CSV


$User = “user@tenant.onmicrosoft.com”
#$User = Read-host “Please enter Office365 Admin User name username@domain.onmicrosoft.com. “
$Creds = Get-Credential

#Connect-SPOService -Url https://tenant-admin.sharepoint.com -Credential $Creds
Connect-MsolService -Credential $Creds

$AllUserRoles = @()

$Users = Get-MsolUser -All
foreach($user in $Users)
{
    $UserRoles = Get-MsolUserRole -UserPrincipalName $User.UserPrincipalName
    foreach($role in $UserRoles)
    {
        $aRole = New-Object PSObject
        $UserName = $User.UserPrincipalName
        $RoleName = $role.Name.ToString()

        Add-Member -input $aRole noteproperty ‘UserName’ $UserName
        Add-Member -input $aRole noteproperty ‘RoleName’ $RoleName
        $AllUserRoles += $aRole
    }
}

$AllUserRoles | export-csv -Path C:\Scripts\SPOUserRoles.csv -NoTypeInformation -Force

Export All SharePoint Online Term Group, Term Sets and Terms to CSV


param (
    [Parameter(Mandatory=$true)]
        [string]$RootSiteCollectionUrl
)

# Paths to SDK. Please verify location on your computer.
Add-Type -Path “c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll”
Add-Type -Path “c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll”
Add-Type -Path “c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll”

$Credentials = Get-Credential -Message “Please enter SPO Admin User Name and Password”
$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($RootSiteCollectionUrl)
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Credentials.UserName, $Credentials.Password)
$ctx.ExecuteQuery() 

$session = [Microsoft.SharePoint.Client.Taxonomy.TaxonomySession]::GetTaxonomySession($ctx)
$ctx.Load($session)
$ctx.ExecuteQuery()

$termstore = $session.GetDefaultSiteCollectionTermStore();
$ctx.Load($termstore)
$ctx.ExecuteQuery()

  $groups=$termstore.Groups
  $ctx.Load($groups)

  $ctx.ExecuteQuery()

  $Termstring = “”
  $Header=”TermGroup,TermSet,Term`r`n”
  $Termstring = $Header
  foreach($group in $groups)
  {
    $ctx.Load($group)
    $ctx.Load($group.TermSets)
    $ctx.ExecuteQuery()
    Write-Output $group.Name
    $Termstring +=”$($group.Name)`r`n”
    foreach($termset in $group.TermSets)
    {
        Write-Output ”    $($termset.Name)”
        $Termstring +=”,$($termset.Name)`r`n”
        $ctx.Load($termset)
        $ctx.Load($termset.Terms)
        $ctx.ExecuteQuery()
        foreach($term in $termset.Terms)
        {
            Write-Output ”        $($term.Name)”
            $Termstring +=”,,$($term.Name)`r`n”
        }
    }
  }

Out-File -InputObject $Termstring C:\Scripts\Terms.csv -Encoding ascii -Force
C:\Scripts\Terms.csv

List and Export External Users to CSV


This windows application allows SharePoint Online Administrators to list and export all external users to CSV.  You can run the script to iterate all site collections or against the list provided as CSV.  You can double click on a row to open external user management in internet explorer.  Next steps for me would be to allow you to remove the user without going to the site.

I have tested this tool with tenants of 4K and 10K sites without any issue.

Note: The Root Site Collection URL must be SharePoint Admin Url. Not the root site collection url as asked

#To Generate the Input CSV

$SitesToAudit

= Get-SPOSite -Limit All | Where-Object {$_.SharingCapability –ne “Disabled”}

$SitesToAudit

| Select Url | Export-Csv -Path C:\Scripts\InputCSV.csv -NoTypeInformation -Verbose -Force

image

https://gallery.technet.microsoft.com/office/List-and-Export-SharePoint-d670dc40