locked
Command to get the users list for whom rsop is present. RRS feed

  • Question

  • As we know to get the RSOP from users, the users need to satisfy two criteria, 1) the user should have logged into the computer atleast for one time, 2) the user should have permission to read the group policy results. I am looking for a command/script, to get the users list for whom the rsop is present.
    mercredi 8 juillet 2020 06:10

Toutes les réponses

  • Hi Naren177, 

    Thanks for your question.

    You can run GPResult or the powershell cmdlet Get-GPResultantSetOfPolicy to generate the RSoP information for users, but unfortunately neither of them could directly give a list of users which has the RSoP data. GPResult could throw an error message when a user doesn't have RSoP data.

    The code could be like this. It could take some time to run as the GPResult will try to generate RSoP for all the users. 

    $users=Get-LocalUser 
    foreach($user in $users){
        if((GPResult /USER $user.name /R) -notlike "*does not have RSoP data.*"){
             $user.name | Out-File C:\userlist.txt -Append
        }  
    }
    
    

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    jeudi 9 juillet 2020 07:18
  • Is there any update? Have you got a chance to verify above script?

    Please feel free to let us know if more assistance needed.


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    mardi 14 juillet 2020 06:52
  • Hi,

    As this technet forum will become read-only this month, in order to follow up your case, we have moved this thread to Microsoft Q&A forum for you. 

    If you need further help about this case, please reply to the new thread in Microsoft Q&A 
    https://docs.microsoft.com/en-us/answers/questions/61913/command-to-get-the-users-list-for-whom-rsop-is-pre.html

    Thanks for your understanding and support.


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    vendredi 7 août 2020 10:06