This file contains 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
winget install Microsoft.dotnet | |
winget install Microsoft.PowerShell | |
winget install Microsoft.WindowsTerminal | |
winget install Postman.Postman | |
winget install Notepad++.Notepad++ | |
winget install Telerik.Fiddler | |
winget install Microsoft.VisualStudioCode | |
winget install Microsoft.VisualStudio.Enterprise | |
winget install Microsoft.Powertoys | |
winget install microsoft.mousewithoutborder |
This file contains 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
Set-StrictMode -Version "Latest" | |
# eDiscovery case creation | |
$caseName = 'Smith v. Johnson'; | |
$UPN = 'user1@contoso.onmicrosoft.com', 'user2@contoso.onmicrosoft.com' | |
$description = "$caseName" | |
$policyName = "$caseName - Hold Policy" | |
$ruleName = "$caseName - Hold Rule" | |
$searchName = "$caseName - Search Name" | |
$rootFolderNameQuery = "Legal Hold" |
This file contains 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
New-PSDrive -Name Scripts -PSProvider FileSystem -Root <folderLocationOfScriptsGoesHere> | |
#read-host -AsSecureString -Prompt "Enter O365 password 1" | ConvertFrom-SecureString | set-content scripts:\O365AdminPassword1.txt | |
#read-host -AsSecureString -Prompt "Enter O365 password 2" | ConvertFrom-SecureString | set-content scripts:\O365AdminPassword2.txt | |
function Import-O365AdminCredential | |
{ | |
$smtpAddress1 = "admin@m365x974797.onmicrosoft.com" | |
$CredsFile1 = "Scripts:\O365AdminPassword1.txt" |
This file contains 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 file was initially generated by Windows Terminal 1.0.1811.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
This file contains 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
Add-PowerAppsAccount | |
$environments = Get-PowerAppEnvironment | |
foreach($environ in $environments.EnvironmentName) | |
{ | |
$apps = Get-AdminPowerApp -EnvironmentName $environ | |
$apps | Add-Member -MemberType ScriptProperty -Name Connections -Value {$this.internal.properties.connectionReferences.PSObject.Properties.Value.DisplayName} -Force | |
$apps | Select-Object AppName, DisplayName, Connections | |
} |
This file contains 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
var graphResult = graphClient.Users.Request().GetAsync().Result; | |
Console.WriteLine(graphResult[0].DisplayName); |
This file contains 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
public class MsalAuthenticationProvider : IAuthenticationProvider | |
{ | |
private IConfidentialClientApplication _clientApplication; | |
private string[] _scopes; | |
public MsalAuthenticationProvider(IConfidentialClientApplication clientApplication, string[] scopes) { | |
_clientApplication = clientApplication; | |
_scopes = scopes; | |
} |
This file contains 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
var clientId = "<AzureADAppClientId>"; | |
var clientSecret = "<AzureADAppClientSecret>"; | |
var redirectUri = "<AzureADAppRedirectUri>"; | |
var authority = "https://login.microsoftonline.com/<AzureADAppTenantId>/v2.0"; | |
var cca = ConfidentialClientApplicationBuilder.Create(clientId) | |
.WithAuthority(authority) | |
.WithRedirectUri(redirectUri) | |
.WithClientSecret(clientSecret) | |
.Build(); |
This file contains 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-SPOService -Url '<tenantAdminUrl>' | |
Get-SPOSite -Limit all -IncludePersonalSite $true |
This file contains 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
List <SiteProperties> list = new List <SiteProperties>(); | |
SPOSitePropertiesEnumerable ssp = null; | |
SPOSitePropertiesEnumerableFilter sspFilter = new SPOSitePropertiesEnumerableFilter(); | |
SharePointOnlineCredentials creds = new SharePointOnlineCredentials("myUsernameGoesHere", securePassword); | |
using (ClientContext cc = new ClientContext("myURLGoesHere")) | |
{ | |
cc.Credentials = creds; |