when I run the above mentioned script in server 2008 (powershell v1.0), I am not getting output with the local user name…pls let me know if you can assist me in that…
But its working fine in 2008R2 and also in 2012.
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME" $adsi.Children | where {$_.SchemaClassName -eq 'user'} | Foreach-Object {$_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null)} $_ | Select-Object @{n='UserName';e={$_.Name}},@{n='Groups';e={[string]::Join(';',$groups)}}