A simple powershell module for PSGraph using only built in powershell capabilities.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Release/MyAAD
docs
src
test
LICENSE
README.md
ReleaseNotes.md
ScriptAnalyzerSettings.psd1
build.ps1
build.psake.ps1
build.settings.ps1
buildhelpindex.ps1
install.md

README.md

MyAAD Module

Description

A pretty simple and straight forward Powershell Module for Microsoft Graph primarily created for managing groups and templates.

Installation

Either copy the Release/MyAAD to a directory of your choice or see install.

How to

Create app in Azure AD

First of you need to register an application in Azure AD and create secrets for it: instructions.

Fetch access token

# Enter Application ID as username and secret as password
$Credential = Get-Credential

# Get Access token
$AccessTokenResponse = Get-MyAADAccessToken -ClientCredential $Credential -TenantName contoso.onmicrosoft.com
$AccessToken = $AccessTokenResponse.access_token

Perform commands

# Fetch all unified groups
Get-MyAADUnifiedGroups -AccessToken $AccessToken

Functions

Get-MyAADAccessToken

Description:

Gets a graph access token

Example:

PS C:\> Get-MyAADAccessToken -ClientCredential $Credential -TenantName contoso.onmicrosoft.com

Get-MyAADDirectorySetting

Description:

Fetches all settings from templates etc from you AAD

Example:

PS C:\> Get-MyAADDirectorySettings -AccessToken $AccessToken

Get-MyAADDirectorySettingTemplate

Description:

Fetches all AAD directory settings templates

Example:

PS C:\> Get-MyAADDirectorySettingTemplates -AccessToken $AccessToken

Get-MyAADGroupSetting

Description:

Fetches all settings applied for a specific group

Example:

PS C:\> Get-MyAADGroupSetting

Get-MyAADSecurityAlerts

Description:

Fetches all security alerts with the graph API

Example:

PS C:\> Get-MyAADSecurityAlerts

Get-MyAADUnifiedGroups

Description:

Fetches all unified groups from your AAD tenant

Example:

PS C:\> Get-MyAADUnifiedGroups -AccessToken $AccessToken

New-MyAADDirectorySetting

Description:

Creates a new Directory Settings object

Example:

PS C:\> $UnifiedGroupTemplate = Get-MyAADDirectorySettingTemplates -AccessToken $AccessToken | ? {$_.DisplayName -eq 'Group.Unified'}

New-MyAADGroupSetting

Description:

Sets new group setting on group from a template.

Example:

PS C:\> $Settings = [PSCustomObject]@{

Remove-MyAADGroupSetting

Description:

Removes specific settings object froup group

Example:

PS C:\> Remove-MyAADGroupSetting -Id $GroupId -SettingsId $SettingsIDGuid
PS C:\> $GroupSettings = Get-MyAADGroupSetting -AccessToken $AccessToken -Id $GroupId

Set-MyAADGroupGuestAccess

Description:

Enables or disables guest access on specific group

Example:

PS C:\> Set-MyAADGroupGuestAccess -AllowAddGuests $False -AccessToken $AccessToken
PS C:\> Set-MyAADGroupGuestAccess -AllowAddGuests $True -AccessToken $AccessToken
PS C:\> $Groups | Set-MyAADGroupGuestAccess -AllowAddGuests $False -AccessToken $AccessToken

Update-MyAADSecurityAlert

Description:

Updates a security alert

Example:

PS C:\> Update-MyAADSecurityAlert -AccessToken $AccessToken -Id $AlertId -AssignedTo Someone
PS C:\> $FilteredAlerts | Update-MyAADSecurityAlert -AccessToken $AccessToken -Id $AlertId -AssignedTo Someone