I have this code bit, I am trying to get to work in a script:
$computers = Get-ADComputer -Filter * | Select-Object -ExpandProperty Name
$results = Invoke-Command -ComputerName $computers -ScriptBlock {Get-SmbShare | Get-SmbShareAccess}
I would like it to return the AccessRights as if was run locally - but this return numbers instead of text. Like AccessRight '0', '2' etc.
Name AccountName AccessRight
---- ----------- -----------
IPC$ BUILTIN\Administrators 0
IPC$ BUILTIN\Backup Operators 0
IPC$ NT AUTHORITY\INTERACTIVE 0
How can I fix this?