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
<# | |
Author: Jamie Chalmers of Agilico - 3rd Line Tech & Telco Engineer | |
Description: This script automates the provisioning of OneDrive for licensed users in a SharePoint Online environment. | |
It connects to Microsoft Graph and SharePoint Online, retrieves licensed users, and provisions their OneDrive accounts in batches. | |
#> | |
Param( | |
[Parameter(Mandatory = $True)] | |
[String] | |
$SharepointURL, |
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
# Enable TLS 1.1 | |
New-Item -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1' -Force | |
New-Item -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server' -Force | |
New-Item -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client' -Force | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server' -Name 'Enabled' -Value 1 | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server' -Name 'DisabledByDefault' -Value 0 | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client' -Name 'Enabled' -Value 1 | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client' -Name 'DisabledByDefault' -Value 0 | |
# Enable TLS 1.2 |
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
# Check if ExchangeOnlineManagement module is installed | |
if (-not (Get-Module -ListAvailable -Name ExchangeOnlineManagement)) { | |
Write-Host "ExchangeOnlineManagement module is not installed. Installing it..." | |
# Install the ExchangeOnlineManagement module from the PowerShell Gallery | |
Install-Module -Name ExchangeOnlineManagement -Force -Scope CurrentUser | |
if ($?) { | |
Write-Host "ExchangeOnlineManagement module has been successfully installed." -ForegroundColor Green | |
} else { |
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
## CONNECT TO EXCHANGE ONLINE POWERSHELL OR USE EXCHANGE MANAGEMENT SHELL FOR ON-PREMISES EXCHANGE | |
if (-not (Get-Module -ListAvailable -Name ExchangeOnlineManagement)) { | |
Write-Host "ExchangeOnlineManagement module is not installed. Installing it..." | |
## INSTALL THE EXCHANGEONLINEMANAGEMENT MODULE FROM THE POWERSHELL GALLERY | |
Install-Module -Name ExchangeOnlineManagement -Force -Scope CurrentUser | |
if ($?) { | |
Write-Host "ExchangeOnlineManagement module has been successfully installed." -ForegroundColor Green | |
} else { |
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
## DEFINE THE DIRECTORY PATH | |
$directoryPath = "C:\temp" | |
## CHECK IF THE DIRECTORY EXISTS | |
if (-Not (Test-Path -Path $directoryPath)) { | |
## IF THE DIRECTORY DOES NOT EXIST, CREATE IT | |
New-Item -Path $directoryPath -ItemType Directory | |
Write-Output "Directory $directoryPath created." | |
} else { | |
Write-Output "Directory $directoryPath already exists." |
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
/** | |
* Replace all speech marks with blanks in the active sheet of Excel Online. | |
*/ | |
function main(workbook: ExcelScript.Workbook) { | |
// Get the currently active worksheet in the workbook | |
let activeSheet = workbook.getActiveWorksheet(); | |
// Get the used range of the active sheet | |
let usedRange = activeSheet.getUsedRange(); |
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
/** | |
* Adds CSV data to a specified worksheet in the workbook. | |
* | |
* @param {ExcelScript.Workbook} workbook - The target workbook. | |
* @param {string} csv - The CSV data as a string. | |
*/ | |
function main(workbook: ExcelScript.Workbook, csv: string): void { | |
// Access the target worksheet. | |
let targetSheet = workbook.getWorksheet("Sheet1"); |
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
Connect-PnPOnline -Url *sharepointadminurl* -Interactive | |
$Sites = Get-PnPTenantSite | |
for($x = 0; $x -lt $Sites.Count; $x++) { | |
Set-PnPTenantSite -Url $Sites[$x].Url -Owners "*adminemailaddress*" | |
Write-Host "Updating $($Sites[$x].Title), Site $($x)" | |
} |
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
# Parameters for source and destination for the Image file | |
# Current script is edited to put the same image on LockScreen and Wallpaper | |
$WallpaperURL = "bloburl from azure" # Change to your fitting | |
$LockscreenUrl = "bloburl from azure" # Change to your fitting | |
$ImageDestinationFolder = "c:\temp" # Change to your fitting - this is the folder for the wallpaper image | |
$WallpaperDestinationFile = "$ImageDestinationFolder\wallpaper.png" # Change to your fitting - this is the Wallpaper image | |
$LockScreenDestinationFile = "$ImageDestinationFolder\LockScreen.png" # Change to your fitting - this is the Lockscreen image |
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
$members = net localgroup administrators | | |
where {$_ -AND $_ -notmatch "command completed successfully"} | | |
select -skip 4 | |
$members += $(Get-Date -format 'd') | |
write-host $members | |
#Only keep this line if you are using Datto RMM for a UDF. | |
#New-ItemProperty -PropertyType String "HKLM:\SOFTWARE\CentraStage" -Name "Custom5" -Value $members |
NewerOlder