Forum Discussion
Trigger/Invoke MFA request for specific user via PowerShell or other tool?
Hi Chris,
Would you know if this is possible to trigger without a login from the user? Either by parsing it via an access policy or similar?
John_Kalinski -- I stumbled across this article while looking for exactly the same thing, and it does the trick (at least for now -- do note that it is manually calling an API that isn't publicly documented, so there is the possibility that it breaks in the future if MS decides to lock down/alter that entry point)
https://www.cyberdrain.com/automating-with-powershell-sending-mfa-push-messages-to-users/
I do want to revisit it and go through to clean up some of the variable names and better lay out the flow. It all works, but some of the flow is obviously done by an old-school hacker who firmly believes (as do I, for the record) in reusing code that's already proven to perform the desired function elsewhere. But some of the names, or even the flow order, is less than ideal for someone else to come along and easily track what is happening. A side effect of the copy/paste coding (or using LLMs to fill in code skeletons, though I doubt that is what happened here) that doesn't hurt the code, but makes it so only the original author can easily troubleshoot in the future.