how to block GET-ADUSER from showing result

Francois Roussel 1 Reputation point
2020-09-08T17:01:22.29+00:00

Hello. I want to block GET-ADUSER from been able to show result.

I was able to block users from opening AD users and computers but it look like the permissions doesn't apply to GET-ADUSERS

How can I set that command to not show any results?

Thank you

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,546 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Ian Xue 37,541 Reputation points Microsoft Vendor
    2020-09-09T01:42:36.71+00:00

    Hi,

    You could send the output to null with Out-Null like

    Get-ADUser ... | Out-Null  
    

    Best Regards,
    Ian

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Basti 1 Reputation point
    2020-09-09T12:01:13.247+00:00

    You can remove the ActiveDirectory packet via the PowerShell

    On Windows 10 1809 and newer:

    Remove-WindowsCapability -online -Name "Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0"
    

    Then restart your pc.


  3. TreyS 166 Reputation points
    2020-09-09T12:57:49.32+00:00

    This won't be a full answer but may get you started...
    Exchange Server has had "Role Based Access Control", RBAC, for some time, which allows granular control of Exchange cmdlets. (I know, not what you are looking for.)

    I came across this,
    https://learn.microsoft.com/en-us/microsoft-365/security/office-365-security/permissions-in-the-security-and-compliance-center?view=o365-worldwide

    Which sounds similar, but seems to be limited to O365, again, not exactly what you are looking for.

    My next best suggestion is to restrict the AD module. Do your users require access to other AD module cmdlets?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.