This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Param( | |
| [Parameter(Mandatory=$true)] | |
| [string]$folderName, | |
| [Parameter(Mandatory=$true)] | |
| [string]$driveLetter = "Z:\" | |
| ) | |
| New-Item "$($env:OneDrive)\$folderName" -ItemType Directory -force | |
| $command = "subst $driveLetter ""$($env:OneDrive)\$folderName""" | |
| New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run" -Name OneDriveMapping -Value $command -PropertyType String -Force | Out-Null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $logoPath = "./pnpImage.png" | |
| $memberDisplayName = "A" | |
| $displayName = "Contoso Group" | |
| $mailNickName = "demoGroup4" | |
| $channelNames = @("Public relations", "CLI Project") | |
| Write-Host "Creating the Group '$displayName'..." | |
| $group = $null | |
| $group = m365 aad o365group add --displayName $displayName ` | |
| --description "." --mailNickname $mailNickName ` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $tenant = "tenantAdmin" | |
| $adminUrl = "https://$tenant-admin.sharepoint.com" | |
| $appId = "appId" | |
| $appSecret = "secretKey" | |
| $userNameOrPattern = '*' | |
| Connect-PnPOnline $adminUrl -ClientId $appId -ClientSecret $appSecret | |
| $tenantSites = Get-PnPTenantSite -Filter "Url -like 'prj_'" | |
| $tenantSites = $tenantSites | Sort-Object Url -Descending |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $tenant = "yourTenantUrl" | |
| $adminUrl = "https://$tenant-admin.sharepoint.com" | |
| Connect-PnPOnline $adminUrl -UseWebLogin | |
| $tenantSites = Get-PnPTenantSite -Filter "Url -like 'prj_'" | |
| $tenantSites = $tenantSites | Sort-Object Url -Descending | |
| $i = 0 | |
| $total = $tenantSites.Count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| set folderName=%1 | |
| set driveLetter=%2 | |
| if "%~1"=="" goto blank | |
| echo Processing folder %folderName%... | |
| set onedriveFolder=%OneDrive%\%folderName% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Get CLI for Microsoft 365 here: https://pnp.github.io/cli-microsoft365/ | |
| $fileExportPath = "<PUTYOURPATHHERE.csv>" | |
| $m365Status = m365 status | |
| if ($m365Status -eq "Logged Out") { | |
| # Connection to Microsoft 365 | |
| m365 login | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $fileExportPath = "<putyourExportPathHere>" | |
| $tenant = "<putYourTenantHere>" | |
| $adminUrl = "https://$tenant-admin.sharepoint.com" | |
| Connect-PnPOnline $adminUrl -UseWebLogin | |
| # Get the site collections | |
| $siteCollections = Get-PnPTenantSite | |
| $results = @() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Get CLI for Microsoft 365 here: https://pnp.github.io/cli-microsoft365/ | |
| ## Script inspired from https://veronicageek.com/powershell/powershell-for-m365/get-teams-channels-tabs-and-privacy-settings-using-teams-pnp-powershell/2020/07/ | |
| ## Author: Patrick Lamber (https://www.nubo.eu) | |
| $fileExportPath = "<PUTYOURPATHHERE.csv>" | |
| $m365Status = m365 status | |
| if ($m365Status -eq "Logged Out") { | |
| # Connection to Microsoft 365 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $baererToken = "Put your baerer token here" | |
| $searchQuery = "searchQuery" | |
| $yammerBaseUrl = "https://www.yammer.com/api/v1" | |
| Function Get-BaererToken() { | |
| $headers = @{ Authorization=("Bearer " + $baererToken) } | |
| return $headers | |
| } | |
| $headers = Get-BaererToken |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param( | |
| [string]$locale="en-US" | |
| ) | |
| $configPath = "$ENV:APPDATA\Microsoft\Teams\desktop-config.json"; | |
| $cookiesFilePath = "$ENV:APPDATA\Microsoft\Teams\Cookies" | |
| $cookiesJournalPath = "$ENV:APPDATA\Microsoft\Teams\Cookies-journal" | |
| $teams = Get-Process Teams -ErrorAction SilentlyContinue | |
| if ($teams) { |