You can configure user restrictions directly on the service principal as detailed for example in this article: https://practical365.com/secure-internet-access-microsoft-graph-powershell-sdk/
Protect Microsoft 365 tenant for connections using PowerShell to Microsoft Graph
Sergio Londono
671
Reputation points
Hello Team,
Microsoft Graph is the main application to reach resources in Microsoft365 tenant.
We need to be able to protect the connection from Powershell to Microsoft graph.
I setup a conditional access policy without success to specify the users who can connect from PowerShell to Microsoft graph, however, it is not working.
How can we protect the cloud app Microsoft Graph to block access to not authorized users?