Tout sur le partage (Share)

Je fais le point sur le partage dans M365.

D’abord, voici tout ce que j’ai écrit à ce sujet:

La documentation officielle se résume à:

https://docs.microsoft.com/en-us/sharepoint/turn-external-sharing-on-or-off#change-the-organization-level-external-sharing-setting

https://docs.microsoft.com/en-us/microsoft-365/admin/create-groups/manage-guest-access-in-groups

File Request https://support.microsoft.com/en-us/office/create-a-file-request-f54aa7f8-2589-4421-b351-d415fc3b83af

Share Files and Folders https://support.microsoft.com/en-gb/office/share-sharepoint-files-or-folders-1fe37332-0f9a-4719-970e-d2578da4941c

Set to Read Only and Remove permissions in SharePoint 2013 with PowerShell

After migrating a SharePoint 2013 site to Microsoft 365, we need to put all its content in read only so users don’t continue updating the content in the old site.

A few months later, it’s necessary to remove all permissions to ensure that all the links to the old site won’t work anymore (favorites and links in documents) and that users don’t refer to content that is obsolete.

# Remplace toutes les permissions par lecture dans tout le contenu (site, ses sous-sites, listes, dossiers, éléments) à chaque bris d'héritage

# inspiré de https://www.c5insight.com/Resources/Blog/tabid/148/entryid/729/use-powershell-to-set-permissions-on-all-sharepoint-libraries-folders-and-files.aspx

# à cause des accents, il faut convertir le format en ANSI
$systemlibs =@("Style Library", "Bibliothèque de styles", "Contenu réutilisable", "Rapports sur le contenu et la structure", "Tâches de flux de travail", "Images de la collection de sites")

function FixPerms($permissions) {
    $ReadRole = $web.RoleDefinitions["Read"]
    
    foreach ($assignment in $permissions) {
        
    #write-host $assignment.Member.Name $assignment.RoleDefinitionBindings.Name
    #write-host $assignment.Member.Name $assignment.RoleDefinitionBindings.Count

# Création d'un tableau qui contient toutes les permissions à supprimer
$TousRoles = New-Object System.Collections.ArrayList

foreach ($autorisation in $assignment.RoleDefinitionBindings) {
	#write-host $autorisation.Name
	if (($autorisation.Name -ne "Read") -and ($autorisation.Name -ne "Limited Access") -and ($autorisation.Name -ne "Restricted Read")) {

	#$TousRoles.Add($autorisation.Name)
	$TousRoles += $autorisation.Name

	}
}

foreach ($Role in $TousRoles) {

	$assignment.RoleDefinitionBindings.Remove($web.RoleDefinitions[$Role])

if ($assignment.RoleDefinitionBindings.Name -notcontains "Read") {
	$assignment.RoleDefinitionBindings.Add($ReadRole); 
}
	$assignment.Update()  
}
    }    
}
#End function Fix Perms------------------------------------

function ToutleContenu($siteweb){

foreach ($list in $siteweb.lists) {

if ($systemlibs -contains $list) {continue;}
if ($list.Hidden -eq $true) {continue;}

 if ($list.HasUniqueRoleAssignments -eq "True") {
        write-host "Need to fix list perms:" $list.Title -fore yellow
	$permissions = $list.RoleAssignments
	FixPerms($permissions)
    }

#le dossier AB922... se trouve dans la liste Microflux
foreach ($folder in $list.folders) {
        if (($folder.HasUniqueRoleAssignments -eq "True") -and ($folder.Name -ne "AB922B82-8406-4E49-B17B-9057BDF09503")) {            

            write-host " Need to fix folder perms:" $folder.Name -fore green
	$permissions = $folder.RoleAssignments
	FixPerms($permissions)
      
        }
    }

foreach ($item in $list.items) {
        if ($item.HasUniqueRoleAssignments -eq "True") {
            write-host "  Need to fix item perms:" $item.Name -fore darkyellow
	$permissions = $item.RoleAssignments
	FixPerms($permissions)
        }
    }
}

}
#---end function ToutleContenu

function TouslesSites($web) {

ForEach($subsite in $web.Webs) {
	
if($subsite.HasUniqueRoleAssignments -eq "True") { 
     write-host "Need to fix subsite perms:" $subsite.url -fore cyan
$permissions = $subsite.RoleAssignments
FixPerms($permissions)
ToutleContenu($subsite)
TouslesSites($subsite)
}

}

}
#---end function TouslesSites


$web = get-spweb "URL of the site"


if($web.HasUniqueRoleAssignments -eq "True") { 
	write-host "Need to fix site perms:" $web.url -fore cyan
$permissions = $web.RoleAssignments
FixPerms($permissions)
ToutleContenu($web)
}

#Commenter la ligne suivante si seulement le site principal doit être mis en lecture
#Pour tous les sous-sites
TouslesSites($web)

Only the function FixPerm needs to be changed to remove permissions.

function FixPerms($permissions) {
    $ReadRole = $web.RoleDefinitions["Read"]
    
    foreach ($assignment in $permissions) {
        
    #write-host $assignment.Member.Name $assignment.RoleDefinitionBindings.Name
    #write-host $assignment.Member.Name $assignment.RoleDefinitionBindings.Count

	$assignment.RoleDefinitionBindings.RemoveAll()
	$assignment.Update()  
}
  
}
#End function Fix Perms------------------------------------

Ref.

https://www.c5insight.com/Resources/Blog/tabid/148/entryid/729/use-powershell-to-set-permissions-on-all-sharepoint-libraries-folders-and-files.aspx

The Complete SharePoint 2013/2016 Site Collection Permission Report using PowerShell – SharePoint Diary

List properties (Microsoft.SharePoint.Client) | Microsoft Docs

about Logical Operators – PowerShell | Microsoft Docs

about Comparison Operators – PowerShell | Microsoft Docs

sharepoint-server Module | Microsoft Docs

Ctrl+Break to stop a PowerShell script

Office préversions, versions préliminaires

Microsoft 365

Admin > Paramètres > Paramêtres de l’organisation > Profil de l’organisation > Préférences de publication

Teams Version préliminaire publique (public preview)

Admin Teams > Teams > Teams update policies > Global (Org-wide default)

‘Follow Office Preview’ dépend de ‘Office Current Channel (Preview)’.

https://docs.microsoft.com/en-us/microsoftteams/public-preview-doc-updates

Teams Version préliminaire pour développeur (Developper Preview)

https://docs.microsoft.com/en-us/microsoftteams/platform/resources/dev-preview/developer-preview-intro

Prérequis: Upload custom apps

Teams Admin > Teams apps > Setup policies > Upload custom apps = ON

Teams

Une fois que tous les paramètres sont sélectionnés correctement, chaque utilisateur peut activer les versions préliminaires.

https://support.microsoft.com/en-us/office/get-early-access-to-new-teams-features-a6e387fe-1cad-4f90-ad78-1a311c77b36d

Apps Update Channels

Admin > Paramètres > Paramètres de l’organisation > Office options d’installation

https://docs.microsoft.com/en-us/deployoffice/overview-update-channels