Forum Discussion
johnjjohn
Sep 05, 2023Brass Contributor
How to programmatically authenticate to AAD when using the SPO ps module
Hello. I'm an AAD admin and a dev needs a script to authenticate to AAD in order to access/modify the contents of document libraries. The script will run multiple times per day on a daily basis. Their preference is to hard code a service account in the script, but I'm not allowing that option.
What is the preferred method?
Note: I have enabled MFA, several CA policies, Risky Sign-ins/Users, etc.
Any help is appreciated.
- Andres-BohrenSteel ContributorHi @hohnjjohn
Here is some code that uses an AzureAD/EntraID Application for Authentication
https://blog.icewolf.ch/archive/2022/01/23/upload-file-to-sharepoint-online-with-pnp-powershell/
Regards
Andres - Did that help?
- Any update?