PasswordSolution icon indicating copy to clipboard operation
PasswordSolution copied to clipboard

ms graph specifics?

Open neztach opened this issue 1 year ago • 2 comments

I've desperately been trying to implement this module and use it, but am persistently rebuffed by msgraph authentication.

I created an Azure App, gave permissions of graph/delegated/mail.readwrite, mail.send, user.read. I'm not sure what else I'm missing - do you have a write-up on what settings are used on your azure app for use with this module for authentication?

Is there any chance to be able to script the creation of the azure app at some point in the future?

neztach avatar Apr 02 '24 23:04 neztach

Are you taking about Password Expiry notifications with sending emails using Graph?

PrzemyslawKlys avatar Apr 03 '24 13:04 PrzemyslawKlys

yes indeed. I'm trying to use your example from here

https://github.com/EvotecIT/PasswordSolution/blob/master/Examples/Example-PasswordSolution-LegacyConfiguration01.ps1

I've made the azure app and applied all the permissions I thought I needed, but it just doesn't work

neztach avatar Apr 03 '24 19:04 neztach

MSGraph takes parameters as Mailozaurr, whole EmailParameters are basically configuration of Mailozaurr - if you figure it, it will work.

I would advise to you new modern configuration tho

    $GraphCredentials = @{
        ClientID     = '0fb383f1-8bfe-e'
        DirectoryID  = 'ceb371f6-87'
        ClientSecret = Get-Content -Raw -LiteralPath "C:\Support\Important\O365-GraphEmailTestingKey.txt"
    }
    # (full support for Mailozaurr parameters)
    $EmailParameters = @{
        Credential = ConvertTo-GraphCredential -ClientID $GraphCredentials.ClientID -ClientSecret $GraphCredentials.ClientSecret -DirectoryID $GraphCredentials.DirectoryID
        Graph      = $true
        Priority   = 'Normal'
        From       = '[email protected]'
        WhatIf     = $true
        ReplyTo    = '[email protected]'
    }
    New-PasswordConfigurationEmail @EmailParameters

PrzemyslawKlys avatar Oct 01 '24 08:10 PrzemyslawKlys