Skip to content

Instantly share code, notes, and snippets.

View kevinblumenfeld's full-sized avatar
🎯
Focusing

Kevin Blumenfeld kevinblumenfeld

🎯
Focusing
View GitHub Profile
## Usage
# GUI that saves and encrypts credentials that generate Bearer Token (Run this once per app registration)
# If application-only Graph API Permision, click "Export Tenant Config" button
# If also (or only) delegate permissions click both "Export Tenant Config" and "Export Tenant Credentials" buttons
# Copy the last command output from the GUI. This is how you connect each time.
Add-GraphConfig -Tenant Contoso -workload DescribePermissions
# GUI will provide exactly what to use to connect
Connect-Graph -Tenant Contoso -Workload DescribePermissions #use -Delegated switch if needed
function Connect-GraphRefresh {
[CmdletBinding()]
param (
)
if (-not $Delegated) {
Connect-Graph -Tenant $Script:Tenant -Workload $Script:Workload -Delegated:$Script:Delegated
}
else {
function Connect-Graph {
<#
.SYNOPSIS
Connect to Graph with delegate or application only permissions
.DESCRIPTION
Connect to Graph with delegate or application only permissions
.PARAMETER Tenant
** Use NameOfTenant if the tenant domain is NameOfTenant.onmicrosoft.com **
function Add-GraphConfig {
<#
.SYNOPSIS
Create the encrypted file needed to connect to Microsoft Graph using: Connect-Graph
.DESCRIPTION
Create the encrypted file needed to connect to Microsoft Graph using: Connect-Graph
.PARAMETER Tenant
use NameOfTenant if the tenant domain is NameOfTenant.onmicrosoft.com
function Hide-PSGCalendar {
<#
.SYNOPSIS
if Owner of Calendar...
1. Remove as Owner from Calendar, if not chosen by client in PrimaryOwnerFilePath
2. Add as Editor to Calendar
3. Hide Calendar if #1 and #2 does not work
.DESCRIPTION
# BEGIN ROOT CA
# Common name used for the RootCA. example: 'Contoso Root CA'
$CACommonName = 'SE-C-ROOT'
 
# Suffix for the RootCA. Example: 'OU=PKI,O=Contoso,C=US'
$CADistinguishedNameSuffix = 'OU=PKI,O=Contoso,C=US'
 
# Local directory where Root CA stores the CA Database
$DatabaseDirectory = 'C:\CADB\CertDB'
 
#Import-Module "$PSScriptRoot\..\Module\WindowsPresentationFramework" -Force
. "$PSScriptRoot\WindowsPresentationFramework.ps1"
#Region ThreadSafe
# Bind Variables
[WindowsPresentationFrameworkThreadSafe()]
[PSObject] $Variable = "Herro World from Proxy Scope"
[WindowsPresentationFrameworkThreadSafe()]
$Sync = [hashtable]::Synchronized(@{})
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>System.Collections.Hashtable</T>
<T>System.Object</T>
</TN>
<DCT>
<En>
<S N="Key">SourceApp</S>
<Obj N="Value" RefId="1">
function Connect-OktaSecure {
param (
[Parameter(Mandatory)]
[String] $Tenant,
[Parameter()]
[switch] $DeleteCreds,
[Parameter()]
[switch] $Preview
function Get-OktaUserReport {
<#
.SYNOPSIS
Searches for specific or all Okta Users
.DESCRIPTION
Searches for specific or all Okta Users. Use no parameters to return all users. e.g Get-OktaUserReport
.PARAMETER SearchString
Queries firstName, lastName, and email for a match to the -SearchString value specified.