Reading List
https://veronicageek.com/sharepoint/sharepoint-2013/get-nested-folders-files-count-folder-size-and-more-in-spo-document-libraries-using-powershell-pnp/2019/09/
$LAYYYTER
tumblr dot com
Jules of Nature

#extradirty

Andulka
cherry valley forever
AnasAbdin
Xuebing Du
NASA

Love Begins
Cosimo Galluzzi
dirt enthusiast
Keni
Cosmic Funnies
he wasn't even looking at me and he found me
we're not kids anymore.

⁂
TVSTRANGERTHINGS
todays bird

Origami Around
seen from Germany

seen from Malaysia
seen from China
seen from China

seen from United States
seen from Netherlands
seen from Türkiye
seen from Italy

seen from Singapore

seen from Malaysia

seen from Brazil
seen from United States

seen from United Kingdom

seen from T1
seen from United States
seen from Colombia

seen from United States
seen from United States
seen from United Kingdom

seen from United States
@s13cloud
Reading List
https://veronicageek.com/sharepoint/sharepoint-2013/get-nested-folders-files-count-folder-size-and-more-in-spo-document-libraries-using-powershell-pnp/2019/09/
this is a caption
Exchange Mailbox Migration Document from Microsoft
https://docs.microsoft.com/en-us/exchange/mailbox-migration/migrate-mailboxes-across-tenants
Export Distribution Group members to CSV
$Result=@() $groups = Get-DistributionGroup -ResultSize Unlimited $totalmbx = $groups.Count $i = 1 $groups | ForEach-Object { Write-Progress -activity "Processing $_.DisplayName" -status "$i out of $totalmbx completed" $group = $_ Get-DistributionGroupMember -Identity $group.Name -ResultSize Unlimited | ForEach-Object { $member = $_ $Result += New-Object PSObject -property @{ GroupName = $group.DisplayName Member = $member.Name EmailAddress = $member.PrimarySMTPAddress RecipientType= $member.RecipientType }} $i++ } $Result | Export-CSV "C:\Temp\All-Distribution-Group-Members.csv" -NoTypeInformation -Encoding UTF8
Shared Mailbox permissions Export/Import
Check access rights first. look for fullAccess/SendAs etc. In this example all rights were Full Access.
Get-exoMailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | sort Identity | Get-exoMailboxPermission |Select-Object Identity,User | Where-Object {($_.user -like '*@*')}
Edit to return the correct access rights if required and export to CSV:
Get-exoMailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | sort Identity | Get-exoMailboxPermission |Select-Object Identity,User | Where-Object {($_.user -like '*@*')}|Export-Csv C:\Temp\sharedmailboxpermissions.csv -NoTypeInformation
Open CSV and edit username if required.
Create PowerShell cmdlet
=CONCATENATE("Add-MailboxPermission -Identity """,A2,"""","-User """,B2,""""," -AccessRights FullAccess")
Copy and paste result into PowerShell and run
Get-User_Licenses.PS1
$MSOLCompanyInformation = Get-MsolCompanyInformation $MSOLCompanyInformationDisplayName = $MsolCompanyInformation.displayname
$ClientPath = Test-Path -Path "C:\Temp\Clients" If($ClientPath -eq $False){
New-Item -ItemType Directory -Path "C:\Temp\Clients" }
$OrgPath = Test-Path -Path "C:\Temp\Clients\$MSOLCompanyInformationDisplayName" If($OrgPath -eq $False){
New-Item -ItemType Directory -Path "C:\Temp\Clients\$MSOLCompanyInformationDisplayName" }
$ReportPath = "C:\Temp\Clients\$MSOLCompanyInformationDisplayName" $Date = Get-Date -uformat %H%M%S_%d%m%Y $Date1 = Get-Date -Format U
$licensedUsers = Get-MsolUser -All | Where-Object {$_.islicensed} | Sort DisplayName
foreach ($user in $licensedUsers) { Write-Host "$($user.displayname)" -ForegroundColor Yellow $licenses = $user.Licenses $licenseArray = $licenses | foreach-Object {$_.AccountSkuId} $licenseString = $licenseArray -join ", " Write-Host "$($user.displayname) has $licenseString" -ForegroundColor Blue $licensedSharedMailboxProperties = [pscustomobject][ordered]@{
DisplayName = $user.DisplayName Licenses = $licenseString UserPrincipalName = $user.UserPrincipalName } $licensedSharedMailboxProperties | Export-CSV -Path $ReportPath\UserLicenses.csv -Append -NoTypeInformation }
Unified Group Storage Info
$UnifiedGroups = Get-UnifiedGroup -ResultSize unlimited | sort Displayname
$CustomResult=@() ForEach ($UnifiedGroup in $UnifiedGroups){
If($UnifiedGroup.SharePointSiteUrl -ne $null) { $UnifiedGroupSite=Get-SPOSite -Identity $UnifiedGroup.SharePointSiteUrl $CustomResult += [PSCustomObject] @{ GroupName = $UnifiedGroup.DisplayName StorageUsed_inMB = $UnifiedGroupSite.StorageUsageCurrent Classification = $UnifiedGroup.ResourceProvisioningOptions -join ', '
} }} $CustomResult | FT
$CustomResult | Export-CSV "C:\\Temp\UnifiedGroupInfo-MDSL.csv" -NoTypeInformation -Encoding UTF8
https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-install-custom
This document details the custom installation options for Azure AD Connect. Use these instructions to install Active Directory through Azure
PowerShell Script File Path Check
$MSOLCompanyInformation = Get-MsolCompanyInformation $MSOLCompanyInformationDisplayName = $MsolCompanyInformation.displayname
$ClientPath = Test-Path -Path "C:\Temp\Clients" If($ClientPath -eq $False){
New-Item -ItemType Directory -Path "C:\Temp\Clients" }
$OrgPath = Test-Path -Path "C:\Temp\Clients\$MSOLCompanyInformationDisplayName" If($OrgPath -eq $False){
New-Item -ItemType Directory -Path "C:\Temp\Clients\$MSOLCompanyInformationDisplayName" }
$ReportPath = "C:\Temp\Clients\$MSOLCompanyInformationDisplayName" $Date = Get-Date -uformat %H%M%S_%d%m%Y $Date1 = Get-Date -Format U
Creating Cloud Users from CSV
Create an .xlxs and populate with the following fields:
UserPrincipalName
DisplayName
you can add the following if required (I have for the example and the example script):
FirstName
LastName
You can use a formula to build the required fields if needed. Populate FirstName and LastName fields:
Manage ADSyncScheduler
Get-ADSyncScheduler
Set-ADSyncScheduler -SyncCycleEnabled $False
Mimecast SmartHosts
eu-smtp-outbound-1.mimecast.com eu-smtp-outbound-2.mimecast.com
Sign Users Out of all Apps and Browser Sessions
Get-AzureADUser -All $True | Where{$_.userprincipalname -ne "[email protected]"} | Sort UserPrincipalName
Get-AzureADUser -All $True | Where{$_.userprincipalname -ne "[email protected]"} | Revoke-AzureADUserAllRefreshToken
Archiving Teams
To archive all Teams:
$Teams = Get-Team Foreach($Team in $Teams){
Set-teamarchivedstate -GroupId $Team.GroupID -Archived:$True
}
Or $False if you want to activate them.
$Teams | Select DisplayName, Archived
Removing AD -AAD Synchronization
Connect to Office 365 (MSOL) with PowerShell.
Set-MsolDirSyncEnabled –EnableDirSync $false
To check synchronization is disabled:
(Get-MSOLCompanyInformation).DirectorySynchronizationEnabled
SharePoint - Add Admin to all Sites
$AdminUser = “[email protected]”
$SPOSites = Get-SPOSite -Limit All
Foreach ($SPOSite in $SPOSites) { Write-host "Adding Site Collection Admin for:"$SPOSite.URL Set-SPOUser -site $SPOSite -LoginName $AdminUser -IsSiteCollectionAdmin $True }
Teams T2T Migration, set Owner and list Owners and Members
# Get all the teams from tenant $teams=Get-Team
#Add migration GA as Owner
$Teams | Add-TeamUser -user USERACCOUNT -Role Owner
# Loop through the teams foreach($team in $teams) { Write-Host -ForegroundColor Magenta "Getting all the owners from Team: " $team.DisplayName
# Get the team owners $ownerColl= Get-TeamUser -GroupId $team.GroupId -Role Owner
#Loop through the owners foreach($owner in $ownerColl) { Write-Host -ForegroundColor Yellow "User ID: " $owner.UserId " User: " $owner.User " Name: " $owner.Name } }
# Loop through the teams foreach($team in $teams) { Write-Host -ForegroundColor Magenta "Getting all the members from Team: " $team.DisplayName
# Get the team owners $memberColl= Get-TeamUser -GroupId $team.GroupId -Role Member
#Loop through the owners foreach($member in $memberColl) { Write-Host -ForegroundColor Yellow "User ID: " $member.UserId " User: " $member.User " Name: " $member.Name } }