0

I need to get the local user list of a remote computer and what group they belong to using PowerShell script.

I tried: the below bit not able to use due to legacy version on many servers

Get-LocalUser
Get-LocalGroup
Get-LocalGroupMember

Also:

gwmi win32_UserAccount
gwmi win32_group

but it is very slow and pulling the information more than requirement which consumes time.

I would like the output formatted something like below:

User     Memberof
------   --------------------
a    Administrators
b    remote desktop users
c    Administrators,Backup Operators,users
6    remote desktop users,Backup Operators

enter image description here

Dharman
  • 30,962
  • 25
  • 85
  • 135

0 Answers0