Acceso de shell PS-Remote a un usuario

Acceso de shell PS-Remote a un usuario

Actualmente estoy agregando control total a un usuario manualmente. Consulte la siguiente captura de pantalla. Pero esto debe hacerse mediante un script de PS. Seguíhttps://blogs.technet.microsoft.com/heyscriptingguy/2010/11/18/use-powershell-to-set-security-permissions-for-remoting/enlace pero recibo un error al ejecutar esto uno por uno. Por favor recomiende.

Error-

PS C:\Windows\system32> $user = "bsg\sisyphus"
PS C:\Windows\system32> $accval = New-Object Security.Principal.NTAccount $user
PS C:\Windows\system32> $accval

Value
-----
bsg\sisyphus


PS C:\Windows\system32> $sid = $accval.Translate([Security.Principal.SecurityIdentifier]).Value
Exception calling "Translate" with "1" argument(s): "Some or all identity references could not be translated."
At line:1 char:1
+ $sid = $accval.Translate([Security.Principal.SecurityIdentifier]).Val ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : IdentityNotMappedException

ingrese la descripción de la imagen aquí

Respuesta1

Intente cambiar el nombre de Security.Principal.NTAccount a System.Security.Principal.NTAccount y vea si obtiene un error diferente.

información relacionada