Por ser um assunto um pouco mais extenso, dividimos nos seguintes passos:

Migração para o Office 365: Parte 01 – Entendendo Conceitos
Migração para o Office 365: Parte 02 – Verificando seu ambiente
Migração para o Office 365: Parte 03 – Contratando o serviço 365 e criando o Tenant
Migração para o Office 365: Parte 04 – Replicando usuários com o ADConnect e atribuindo licenças
Migração para o Office 365: Parte 05 – Migrando para o Exchange Online
Migração para o Office 365: Parte 06 – Conceitos sobre uso de arquivos no Office 365
Migração para o Office 365: Parte 07 – Usando o Sharepoint Online como repositório setorial de arquivos
Migração para o Office 365: Parte 08 – Usando o OneDrive como local individual de arquivos

Para criar um repositório no Sharepoint Online abra o portal de administração do Microsoft 365 (lembre-se de usar o Internet Explorer e não outros navegadores) com uma conta de administração global, no menu da esquerda clique em Mostrar tudo. Em seguida, no mesmo local, clique em Sharepoint.

No Centro de administração do Sharepoint, (no menu da esquerda) expanda Sites, clique em Sites ativos e clique em Criar. Na tela que irá abrir à direta para criar o site, desça e escolha Outras opções.

Na tela de criação do site:

  1. Clique na seta para escolher um modelo;
  2. Escolha o modelo Central de Documentos;
  3. Em Nome do site, defina o nome (sugestão SIGLADADIRETORIA_SIGLASETOR);
  4. Defina o administrador principal (não use contas de usuário, mas de administrador do sharepoint);
  5. Altere o idioma para Português (Brasil);
  6. Expanda as Configurações avançadas;
  7. Defina da cota de armazenamento e;
  8. Clique em Concluir (aguarde até o site ser criado, acompanhe se o ícone de atualização está em status “executando”).

Após o site criado, para darmos as permissões dos membros do site de acordo o guia de Referência de permissões de site do centro de administração – SharePoint in Microsoft 365 | Microsoft Docs, clique no site criado, na tela que abrir clique em Listas. Na tela que abrir, clique no menu Mostrar ações da pasta Documentos e escolha Configurações.

Na tela de configurações, clique em Permissões desta biblioteca de documentos. Na tela seguinte clique em Membros de NOME_DO_SITE para na tela seguinte confirme que está selecionado o grupo Membros, clique em Novo e clique em Adicione usuários a este grupo.

Adicione todas as pessoas que deverão ter acesso, clique em MOSTRAR OPÇÕES, demarque a opção de enviar convite por e-mail e clique em Compartilhar. Para conseguir utilizar o SharePoint Online mapeado em um Desktop, volte à tela de configurações e clique em Configurações de controle de versão.

Algumas versões de Office apresentam problemas de chech-in e check-out e, ao abrir alterar e salvar conteúdo, pode deixar o arquivo bloqueado (lock), para evitar esse erro, na tela seguinte, em Require Check Out, desabilite a obrigatoriedade de check-out clicando em No.

Automatizando a criação de sites, baseadas nos usuários das OUs, pelo PowerShell

Caso queira criar sites de acordo com as OUs (setores) e atribuir permissão à todos os membros que já estão nessa OU, baixe nosso script para Powershell mais atual de nosso repositório Github https://github.com/luizcarlosbranco/nvlan, se preferir manualmente abra o PowerShell como administrador execute os seguintes comandos:

#https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/new-sposite?view=sharepoint-ps
#https://docs.microsoft.com/pt-br/powershell/module/sharepoint-online/add-spouser?view=sharepoint-ps
#--------------------------------------------------------------------------------
#Import-Module -Name Microsoft.Online.SharePoint.PowerShell
#Install-Module SharePointPnPPowerShellOnline
#Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Update-Module -Name Microsoft.Online.SharePoint.PowerShell
#Install-Module SharePointPnPPowerShellOnline
#Update-Module SharePointPnPPowerShellOnline
#--------------------------------------------------------------------------------
#ALTERE ESSAS VARIAVEIS CONFORME SUA REALIDADE
$domain = "seudominio.com.br"
$Base_OU = "Nome_da_OU_raiz_onde_tem_as_OUs_dos_setores"
$tenant = "Nome_do_Tenant"
$SP_Owner = "Login_Admin_Sharepoint_Online"
$SP_Quota_GB = "50"
#--------------------------------------------------------------------------------
$env:PNPLEGACYMESSAGE='false'
$cred = Get-Credential
#--------------------------------------------------------------------------------
$ErrorActionPreference= 'silentlycontinue'
$SP_Quota = [int]$SP_Quota_GB * "1024"
$SearchBase = "DC="+$domain.replace(".",",DC=")
If ($Base_OU) {
    $SearchBase = "OU="+$Base_OU+","+$SearchBase
}
Connect-SPOService -Url https://$tenant-admin.sharepoint.com
Clear-Host
Get-ADOrganizationalUnit -filter * -SearchBase $SearchBase -Properties Description | ForEach-Object {
    $count = $null
    $count_site = 0
    $Description = $_.Description  
    $dn = $_.distinguishedname
    $Name = $dn.ToUpper()
    [regex]$regex = ",DC="
    $Name = $regex.replace($Name,"|", 1)
    $Name = $Name.Split('|')[0].Replace('CN=','').Replace('OU=','').Replace('.','').Split(',')
    [array]::Reverse($Name)
    #$Name = ($Name[($Name.Length-1)..0])
    $Name = $Name -join "_"
    $count = ([regex]::Matches($Name, "_" )).count
    $Company = $Name.Split('_')[0]
    If ($count -ge 2) {
        $SiteURL = "https://$tenant.sharepoint.com/sites/$Name"
        $count_site = (Get-SPOSite -identity $SiteURL).count
        $count_users = 0
        $count_users = (Get-AdUser -filter * -SearchBase $dn -SearchScope OneLevel).count
        If ( ($count_site -eq 0) -and ($count_users -gt 0) ){
            Write-Host "- Creating the sharepoint site https://$tenant.sharepoint.com/sites/$Name" -NoNewline
            New-SPOSite -Url https://$tenant.sharepoint.com/sites/$Name -Owner "$SP_Owner@$domain" -LocaleID 1046 -StorageQuota $SP_Quota -CompatibilityLevel 15 -Template "BDR#0" -TimeZoneId 8 -Title "$Company - $Description"
            Set-SPOSite -Identity "https://$tenant.sharepoint.com/sites/$Name" -DisableSharingForNonOwners
            Write-Host " - Finished" -ForegroundColor Green
        }
        Get-AdUser -filter * -SearchBase $dn -SearchScope OneLevel | ForEach-Object {
            $who = $_.UserPrincipalName
            Add-SPOUser -Site $SiteURL -LoginName $who -Group "Membros de $Company - $Description" | Out-Null
            Write-Host "     - User " -NoNewline
            Write-Host "$who" -ForegroundColor Green -NoNewline
            Write-Host " added as Membros de $Company - $Description"
        }
    }
                Connect-PnPOnline https://$tenant.sharepoint.com/sites/$Name -Credentials $cred
                Register-PnPManagementShellAccess https://$tenant.sharepoint.com/sites/$Name/Documentos
                Set-PnPList -Identity "Documentos" -ForceCheckout $false
}

Mapear o site como um drive local

Para mapear o Sharepoint Online como pastas de rede, é necessário que os computadores dos usuários possuam a seguinte configuração (possível aplicar por GPO):

  • O Serviço Cliente da Web (WebClient) deve estar iniciado e iniciando quando o computador é reiniciado;
  • As seguintes URLs definidas como Sites Confiáveis:
    • https://*.sharepoint.com
    • https://portal.office.com
    • https://*.microsoftonline.com
    • https://*.microsoft.com
  • Desabilite o modo protegido (Protected mode) para Sites Confiáveis

Estando todos os requisitos atendidos, faça os testes com um usuário manualmente:

  • Acesse via navegador (Internet Explorer);
  • Reinicie o computador e tente mapear uma unidade de rede;

Funcionando tudo corretamente, faça uma GPO para criar as variáveis de logon personalizada para casa usuário (leia nosso post Definindo informações da OU do computador como variáveis de ambiente no Windows) e para mapear a pasta do sharepoint, com as variáveis de cada equipe. Para isso, adicione a GPO Sharepoint Mapping com o seguinte script de inicialização para os usuários:

Se for automatizar utilizando PowerShell, adicione na GPO Sharepoint Mapping o seguinte script PowerShell de inicialização para os usuários:

$ErrorActionPreference= 'silentlycontinue'
$Tenant = "seu_tenant"
$drive = "seu_drive:"
-----------------------------------------------------------------------------------
$site = "$Tenant.sharepoint.com"
$search = [adsisearcher]"(&(ObjectCategory=Person)(ObjectClass=User)(samaccountname=$env:USERNAME))"
$user = $search.FindAll()
$distinguishedname = $user.Properties['DistinguishedName']
$distinguishedname = $distinguishedname.ToUpper()
[regex]$regex = ",DC="
$distinguishedname = $regex.replace($distinguishedname,"|", 1)
$distinguishedname = $distinguishedname.Split('|')[0].Replace($distinguishedname.Split(',')[0]+",",'').Replace('CN=','').Replace('OU=','').Replace('.','').Split(',')
$folder = $distinguishedname -join "_"
-----------------------------------------------------------------------------------
If ( (-Not (get-item $drive)) -or ((Get-PSDrive $drive.replace(":","")).DisplayRoot -notlike "$site") ) {
net use $drive /del
If ( get-item $drive | Out-Null ) {
(New-Object -ComObject WScript.Network).RemoveNetworkDrive("$drive")
net use $drive /del
}
$ie = Start-Process -file "C:\Program Files\Internet Explorer\iexplore.exe" -arg "https://$site/sites/$folder" -PassThru
while ( (get-service webclient).Status -ne "Running")
{
sleep 10
}
(New-Object -ComObject Wscript.Network).MapNetworkDrive($drive, "\$site@SSL\sites$folder\Documentos", $true)
}
-----------------------------------------------------------------------------------
Function Rename-Drive([string]$URL, [string]$Path)
{
$FolderName = "SharepointOnline " + $Path.Split('_')[-1]
If (-Not (Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2$URL")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\" -Name $URL
}
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2$URL" -Name "_LabelFromReg" -Value $FolderName
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2$URL" -Name "_LabelFromReg" -Value $FolderName
}
Rename-Drive "##$site@SSL#DavWWWRoot#sites#$folder#Documentos" $folder
Rename-Drive "##$site@SSL#sites#$folder#Documentos" $folder

Se for automatizar utilizando VBS para mapear de acordo com o nome da OU, adicione na GPO Sharepoint Mapping o seguinte script VBScript de inicialização para os usuários:

Option Explicit

Dim DesktopPath, link, MappedDrive, objArgs, objEnv, objExplorer, objGroup, objNetwork, objRegistry, objShell, objSysInfo, objUser, objWMIService 
Dim regkey, SectorName, SharepointMapFolder, SiteName, state, strKeyPath, strRemoteShare, Tenant

Dim array, i, InvertedArray, OrganizationalUnit

On error resume next
'--------------------------------------------------------------------------------
' DEFININDO VARIAVEIS
'--------------------------------------------------------------------------------
'Set objArgs = Wscript.Arguments
'Tenant = objArgs(0)
'MappedDrive = objArgs(1)
Tenant = "SEU_TENANT"
MappedDrive = "SEU_DRIVE:"
'--------------------------------------------------------------------------------
' INICIO DO SCRIPT
'--------------------------------------------------------------------------------
Set objSysInfo = CreateObject("ADSystemInfo")
Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = WScript.CreateObject("Wscript.Network")
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
Set objExplorer = WScript.CreateObject("InternetExplorer.Application")
Set objShell = WScript.CreateObject("WScript.Shell")
Set wmi = GetObject("winmgmts://./root/cimv2")
'--------------------------------------------------------------------------------
' OBTENDO INFORMACOES DO ACTIVE DIRECTORY
'--------------------------------------------------------------------------------
OrganizationalUnit = Replace(objUser.distinguishedName,Split(objUser.distinguishedName,",")(0)&",","",1,1)
OrganizationalUnit = Replace(OrganizationalUnit ,",DC=","|",1,1)
OrganizationalUnit = Replace(OrganizationalUnit ,".","")
OrganizationalUnit = Replace(OrganizationalUnit ,",DC=",".")
OrganizationalUnit = Replace(OrganizationalUnit ,"OU=","")
OrganizationalUnit = Replace(OrganizationalUnit ,"CN=","")
OrganizationalUnit = Replace(OrganizationalUnit ,"|" &Split(OrganizationalUnit ,"|")(1) ,"")
SectorName = Split(OrganizationalUnit ,",")(0)
array = Split(OrganizationalUnit ,",")
InvertedArray = array
For i = Ubound(array) to LBound(array) Step - 1
InvertedArray(Ubound(array)-i) = array(i)
Next
OrganizationalUnit = join(InvertedArray,"_")
'--------------------------------------------------------------------------------
' ABRIR NAVEGADOR
'--------------------------------------------------------------------------------
'objShell.Run "msedge https://" & Tenant & ".sharepoint.com/sites/" & OrganizationalUnit & "/Documentos --hide-scrollbars --content-shell-hide-toolbar"
objExplorer.Navigate "https://" & Tenant & ".sharepoint.com/sites/" & OrganizationalUnit & "/Documentos"
objExplorer.Visible = true
Set objExplorer = Nothing
'--------------------------------------------------------------------------------
' DAR 60 SEGUNDOS PARA O USUARIO SE AUTENTICAR (CASO NAO ESTEJA)
'--------------------------------------------------------------------------------
'wscript.sleep 60000
'--------------------------------------------------------------------------------
' AINDA ESPERAR O SERVICO WEBCLIENT ESTAR OPERANDO
'--------------------------------------------------------------------------------
'state = wmi.Get("Win32_Service.Name='WebClient'").State
'Do Until state="Running"
'state = wmi.Get("Win32_Service.Name='WebClient'").State
'wscript.sleep 5000
'Loop
'--------------------------------------------------------------------------------
' MAPEAR DRIVE DE REDE
'--------------------------------------------------------------------------------
strRemoteShare = "\\" & Tenant & ".sharepoint.com@SSL\sites\" & OrganizationalUnit & "\Documentos"
objNetwork.MapNetworkDrive MappedDrive, strRemoteShare, False
'--------------------------------------------------------------------------------
' ALTERAR NOME DO COMPARTILHAMENTO
'--------------------------------------------------------------------------------
'strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2##" & Tenant & ".sharepoint.com@SSL#sites#" & OrganizationalUnit & "#Documentos"
'regkey = objshell.RegRead ("HKCU\" & strKeyPath & "_LabelFromReg")
'Const HKEY_CURRENT_USER = &H80000001
'strComputer = "."
'Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
'If err.number<>0 then
'objRegistry.CreateKey HKEY_CURRENT_USER, strKeyPath
'End If
'strValueName = "_LabelFromReg"
'szValue = "SharepointOnline - "& SectorName
'objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, szValue
'--------------------------------------------------------------------------------
' DEFININDO VARIAVEIS DE AMBIENTE
'--------------------------------------------------------------------------------
Set objEnv = objShell.Environment("User")
objEnv("SharepointMapFolder") = OrganizationalUnit
objEnv("SectorName") = SectorName

Se for automatizar utilizando VBS para mapear de acordo com o nome do grupo, adicione na GPO Sharepoint Mapping o seguinte script VBScript de inicialização para os usuários:

Dim DesktopPath, link, MappedDrive, objArgs, objEnv, objExplorer, objGroup, objNetwork, objRegistry, objShell, objSysInfo, objUser, objWMIService
Dim regkey, SectorName, SharepointMapFolder, SiteName, state, strKeyPath, strRemoteShare, Tenant

Dim Check, GroupName

On error resume next
'--------------------------------------------------------------------------------
' INICIO DO SCRIPT
'--------------------------------------------------------------------------------
Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = WScript.CreateObject("Wscript.Network")
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
Set objExplorer = WScript.CreateObject("InternetExplorer.Application")
Set objShell = WScript.CreateObject("WScript.Shell")
Set objWMIService = GetObject("winmgmts://./root/cimv2")
'--------------------------------------------------------------------------------
' DEFININDO VARIAVEIS
'--------------------------------------------------------------------------------
Tenant = "SEU_TENANT"
MappedDrive = "SEU_DRIVE:"
Check = 0
'--------------------------------------------------------------------------------
' OBTENDO INFORMACOES DO ACTIVE DIRECTORY
'--------------------------------------------------------------------------------
For Each objGroup in objUser.Groups
	GroupName = Replace(objGroup.Name ,"CN=","",1,1)
	If (InStr(GroupName, "Sharepoint") > 0) And (Check=0) Then
'--------------------------------------------------------------------------------
' OBTENDO O NOME DO SITE SHAREPOINT
'--------------------------------------------------------------------------------
		SiteName = Replace(GroupName ,"Sharepoint ","",1,1)
		Check = 1
'--------------------------------------------------------------------------------
' CRIANDO ATALHO NO DESKTOP
'--------------------------------------------------------------------------------
		DesktopPath = objShell.SpecialFolders("Desktop")
		Set link = objShell.CreateShortcut(DesktopPath & "\Sharepoint " & SiteName & ".lnk")
		link.Arguments = "https://" & Tenant & ".sharepoint.com/sites/" & SiteName & "/Documentos/"
		link.TargetPath = "%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe"
		link.WindowStyle = 3
		link.WorkingDirectory = DesktopPath
		link.Save
'--------------------------------------------------------------------------------
' ABRINDO O NAVEGADOR
'--------------------------------------------------------------------------------
		objShell.Run "C:\PROGRA~1\INTERN~1\iexplore.exe https://" & Tenant & ".sharepoint.com/sites/" & SiteName & "/Documentos/ -extoff"
'--------------------------------------------------------------------------------
' DAR 60 SEGUNDOS PARA O USUARIO SE AUTENTICAR (CASO NAO ESTEJA)
'--------------------------------------------------------------------------------
		wscript.sleep 60000
'--------------------------------------------------------------------------------
' ESPERANDO O SERVICO WEBCLIENT ESTAR OPERANDO
'--------------------------------------------------------------------------------
		state = objWMIService.Get("Win32_Service.Name='WebClient'").State
		Do Until state="Running"
			state = objWMIService.Get("Win32_Service.Name='WebClient'").State
			wscript.sleep 5000
		Loop
'--------------------------------------------------------------------------------
' MAPEANDO DRIVE DE REDE
'--------------------------------------------------------------------------------
		strRemoteShare = "\\" & Tenant & ".sharepoint.com@SSL\sites\" & SiteName & "\Documentos"
		objNetwork.MapNetworkDrive MappedDrive, strRemoteShare, False
'--------------------------------------------------------------------------------
' ALTERANDO O NOME DO COMPARTILHAMENTO
'--------------------------------------------------------------------------------
		strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##" & Tenant & ".sharepoint.com@SSL#sites#" & SiteName & "#Documentos"
		regkey = objshell.RegRead ("HKCU\" & strKeyPath & "\_LabelFromReg")
		Const HKEY_CURRENT_USER = &H80000001
'		strComputer = "."
'		Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
		Set objRegistry = GetObject("winmgmts:\\.\root\default:StdRegProv")
		If err.number<>0 then
			objRegistry.CreateKey HKEY_CURRENT_USER, strKeyPath
		End If
		strValueName = "_LabelFromReg"
		szValue = "SharepointOnline - "& SectorName
		objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, szValue
'--------------------------------------------------------------------------------
' DEFININDO VARIAVEIS DE AMBIENTE
'--------------------------------------------------------------------------------
		Set objEnv = objShell.Environment("User")
		objEnv("SharepointMapFolder") = SiteName
		objEnv("SectorName") = SectorName
	End If
Next

Adicionalmente, se quiser que as variáveis possam ser definidas na GPO (em vez de ficar fixa no código), é possível definir os Parâmetros na GPO (colocando com aspas duplas e separando cada variável com espaço) e alterar a seguinte parte do código:

'--------------------------------------------------------------------------------
' DEFININDO VARIAVEIS
'--------------------------------------------------------------------------------
Set objArgs = Wscript.Arguments
Tenant = objArgs(0)
MappedDrive = objArgs(1)
'Tenant = "SEU_TENANT"
'MappedDrive = "SEU_DRIVE:"
If (IsNull(Tenant) Or IsEmpty(Tenant)) Or (IsNull(MappedDrive) Or IsEmpty(MappedDrive)) Then
	wscript.quit
End If

Ainda na GPO Sharepoint Mapping, Expanda Configuração do Computador, Preferências , Configurações do Painel de Controle e clique em Serviços. Clique com o botão direito na tela dos serviços configurados (provavelmente está em branco), clique em Novo, escolha Serviço. Na nova tela, coloque (altere as partes em cinza, conforme a sua realidade):

  • Em Inicializar, coloque como Automático
  • Em Nome do serviço, coloque WebClient
  • Em Ação do serviço deixe a opção Iniciar serviço
  • Clique na aba Recuperação, deixe as três respostas em caso de falha como Reiniciar o Serviço
  • Deixe a demais opções padrões e clique em OK

Fontes/Referências

https://github.com/luizcarlosbranco/nvlan
NVLAN – Definindo informações da OU do computador como variáveis de ambiente no Windows
NVLAN – Migração para o Office 365: Parte 01 – Entendendo Conceitos
NVLAN – Migração para o Office 365: Parte 02 – Verificando seu ambiente
NVLAN – Migração para o Office 365: Parte 03 – Contratando o serviço 365 e criando o Tenant
NVLAN – Migração para o Office 365: Parte 04 – Replicando usuários com o ADConnect e atribuindo licenças
NVLAN – Migração para o Office 365: Parte 05 – Migrando para o Exchange Online
NVLAN – Migração para o Office 365: Parte 06 – Conceitos sobre uso de arquivos no Office 365
NVLAN – Migração para o Office 365: Parte 08 – Usando o OneDrive como local individual de arquivos

https://answers.microsoft.com/en-us/msoffice/forum/all/unable-to-map-a-sharepoint-network-drive/cf9e2cff-d0ff-407d-b855-b2b76c7ba768
https://community.spiceworks.com/topic/2239221-mapping-sharepoint-drive-through-gpo-on-active-directory
https://devblogs.microsoft.com/scripting/how-can-i-create-a-new-registry-key/
https://docs.microsoft.com/pt-BR/sharepoint/site-permissions
https://docs.microsoft.com/pt-br/sharepoint/troubleshoot/administration/troubleshoot-mapped-network-drives
https://morgantechspace.com/2015/07/vbscript-check-if-user-is-member-of-group.html
https://ss64.com/vb/syntax-userinfo.html
https://stackoverflow.com/questions/37168882/search-a-string-in-vbscript-to-verify-if-contains-a-character
https://www.tachytelic.net/2019/03/powershell-environment-variables/

Mais Informações

Esperamos ter ajudado da melhor forma possível e estaremos sempre a disposição para mais informações.

Entre em contato conosco pelo e-mail equipe@nvlan.com.br.

NVLAN - Consultoria