Forum Discussion
Molerat
Jul 24, 2020Copper Contributor
Disable powershell for users on Microsoft 365
Hi
Is it possible to block user's access to powershell in Microsoft 365. We would like to block our students from being able to run cmdlets like Get-MSolRole, GetMSolRoleMember or retrieving a full list of users.
Regards
Andrew
4 Replies
Sort By
- MoleratCopper Contributor
DeepakRandhawa, Thanks, I already tried this but does not seem to impact the MSol module
- DeepakRandhawaIron ContributorHave you tried below already:-
Set-MsolCompanySettings -UsersPermissionToReadOtherUsersEnabled $false
It should prevent users from retrieving a full list of users, however Get-MsolRole still seem to work.
This cmdlet disable users' ability to use the Azure AD module for Windows PowerShell to access user information for their organization.
https://docs.microsoft.com/en-us/powershell/module/msonline/set-msolcompanysettings?view=azureadps-1.0