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
#Litra Glow and Litra Beam Powershell Controller | |
#Download hidapitester here : https://github.com/todbot/hidapitester/releases | |
#Based on https://www.reddit.com/r/LogitechG/comments/sacz2x/comment/j7doia4/?utm_source=share&utm_medium=web2x&context=3 | |
#Change to point to the extract folder | |
$HIDAPItesterFolderPath = "C:\Users\username\Scripts\" | |
#HIDAPItester | |
$global:HIDAPItesterPath = $HIDAPItesterFolderPath + "hidapitester.exe" |
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
#This is a quick and dirty way to dump all the last 90 days analytics of a Team to a CSV file | |
#Requirement : | |
#-Install-module MicrosoftTeams | |
#-Get your bearer token and replace it in the variable | |
$UPN = "[email protected]" | |
$TeamDisplayName = "My Team To Analyse" | |
$bearer ="Bearer ESAsadmaisjdoasjdoaskdokasopdkasopdjaiopjdd very long bearer token" | |
########### | |
$headers = @{ |
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
$StorageAccountName = "Demostorage" | |
$ContainerName = "Democontainer" | |
$BlobDirectory = "BlobDir" | |
$localFilePath = "C:\Temp\" | |
$CredObj = Get-Credential "Enter Storage Account Key Only" | |
Import-Module AzureRM | |
$StorageAccountKey = $CredObj.GetNetworkCredential().Password | |
$ctx = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey |
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
#You need Powershell API module @ https://github.com/poiriersimon/PowershellAPIModule | |
Import-Module "C:\Modules\PowershellAPI\PowershellAPI.psd1" | |
$AdminAccount = "[email protected]" | |
$clientid = "1b730954-1685-4b74-9bfd-dac224a7b894"; | |
$RessourceURI = "https://graph.windows.net"; | |
$RedirectURI = "urn:ietf:wg:oauth:2.0:oob"; | |
#FindGroupId | |
$Groupids = Invoke-GraphApi -Resource groups -UserPrincipalName $AdminAccount -ClientID $Clientid -redirectUri $RedirectURI | select Displayname,id | |
# Choose une from here Need to be a Office 365 group or a security group based on https://docs.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http |
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
#Help identify rule size for limit | |
# https://docs.microsoft.com/en-us/office365/servicedescriptions/exchange-online-service-description/exchange-online-limits#journal-transport-and-inbox-rule-limits | |
$TransportRules = Get-TransportRule | |
$Result = @() | |
Foreach($TransportRule in $TransportRules){ | |
if($Matches){$Matches.Clear()} | |
$RuleLength = 0 | |
$Regex = $TransportRule.Description -match "If the message:([\w\W]*)Take the following actions:" | |
if($Regex){ | |
$RuleLength+= $Matches[1].trim().Length |
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
Function Get-CurrentUPN | |
{ | |
$UserPrincipalName = $NULL | |
# | |
$UPNList = @() | |
$UPN = $Env:USERNAME | |
if($UPN -eq $NULL){ | |
$UPN = (whoami) | |
if($UPN -ne $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
#You need AzureAD Module (Save-Module AzureAD -Path C:\temp) | |
#You need Function Get-GraphAuthHeaderBasedOnUPN @ https://gist.github.com/poiriersimon/ded7cdca600ba0aab84b75b7f47c1235 | |
Function Connect-Intune{ | |
param | |
( | |
[Parameter(Mandatory = $True)] | |
[string]$Tenant, | |
[Parameter(Mandatory = $True)] | |
[string]$UserPrincipalName, | |
[string]$clientId = "d1ddf0e4-d672-4dae-b554-9d5bdfd93547", |
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
#You need AzureAD Module (Save-Module AzureAD -Path C:\temp) | |
#Azure DLL are sideloaded in a job to bypass potential conflict with other version | |
function Get-GraphAuthHeaderBasedOnUPN | |
{ | |
[cmdletbinding()] | |
param( | |
[Parameter(Mandatory = $True)] | |
[string]$Tenant = "", | |
[Parameter(Mandatory = $false)] | |
[string]$clientId = "1950a258-227b-4e31-a9cf-717495945fc2", |
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
#Configuration du proxy pour permettre l'Accès a Graph API sans problème | |
$wc = New-Object System.Net.WebClient | |
$wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials |
NewerOlder