25 September,2019 by Tom Collins
Question: How can I use Powershell to list out Windows users? Are there Powershell cmdlets which can report on Windows users ?
Answer: There are "out of the box" Powershell cmdlets which will support the requirement . How you apply the powershell cmdlets will depend on how much detail is required.
Here are some examples:
--return local groups
Get-localgroup
--return all members of a group - in this example the Administrator group
Get-LocalGroupMember -Group "Administrators"
--Get the local users
Get-Local User
--SID of a local group
(Get-Localgroup Administrators).SID
These are some basic examples to extract Windows users information with Powershell. To get other examples of any of the powershell cmdlets use the Examples filter on the powershell cmdlet Get-Help. Here is an example:
Get-Help Get-LocalGroupMember -Examples
To integrate these cmdlets with other aspects of managing servers with Powershell use of these Powershell Scripts
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |