Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

each run of Export-GCECalendar calls out user-prompt window, thus, can't run for multiple rooms automatically. #18

Open
SergioPotemkin opened this issue Jun 14, 2022 · 3 comments

Comments

@SergioPotemkin
Copy link

Hi.
I've got familiar with this your module last year and all tests made - were successfull.
Now, i've got another task, where Export-GCECalendar would be very helpful, but i'm facing a problem..
Environment: WindowsServer2016 / Powershell version 5.1
Installed Module: MSGraph-ExportCalendar 1.4.2.0
If i run "Export-GCECalendar -MailboxName -StartTime (Get-Date).AddDays(-7) -EndTime (Get-Date) | select Starttime,subject", there is appearing MFA prompt for selecting user for connecting to EXO, where i process sign-in with my admin account with providing the SMS-code and in result - i can see info from target room's Calendar about events.. Good.
But if i try to run the same for any other room, there is same MFA prompt appearing.. And if session is alive - it's enough to just select my admin account in order to see results..
I'd love to collect events' statistics from multiple rooms by placing the CMD into ForEach ($room in $rooms) {Export-GCECalendar ...},
but this is not possible due to MFA prompt described above appearing on each cycle-run.
Could you kindly suggest some workaround for overriding this?

@gscales
Copy link
Owner

gscales commented Jun 16, 2022

I'll take a look when i have some time the issue is the MSAL session isn't persistent which at one level isn't hard to change but I need to look into how it affect other things.

@jneilliii
Copy link

I too would appreciate this feature in Export-EXCContacts. We use the utility to export all our active user's contacts to a spreadsheet for sending out Holiday cards and as it stands I'll have to click my login prompt 300 times to process all the active users.

@gscales
Copy link
Owner

gscales commented Nov 3, 2022

I've rewritten the export to use Graph PowerShell SDK at https://github.com/gscales/Powershell-Scripts/blob/master/Graph101/GraphSDK/Export-MGPCalendar.ps1 so it will use the connection context from Connect-MGGraph which will solve any token refersh, prompts and also let you use any flow like the client credentials flow etc. To Export to CSV you just need something like Export-MGPCalendar MailboxName [email protected] -StartTime (Get-Date).AddYears(-1) -EndTime (Get-Date) | export-csv -NoTypeInformation -Path c:\temp\lastyear.csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants