This cmdlet is part of the Vexasoft Cmdlet Library. You can download it now or click here to find out more.

Resolve-SID

Synopsis

Resolves account names to SIDs and SIDs to account names.

Syntax

  • Resolve-SID [-UserName] [-Domain] [-ComputerName] [-Credential]
  • Resolve-SID [-SID] [-ComputerName] [-Credential]

Description

Resolve-SID is used to resolve SIDs (Security Identifiers) to the corresponding account name and vice versa on local and remote computers or domains.

Parameters

  • UserName The user name to resolve. This parameter cannot be used in conjunction with the SID parameter.
  • SID The SID to resolve. This parameter cannot be used in conjunction with the UserName parameter.
  • Domain The domain on which to resolve the username or SID. By default this command will attempt to resolve the SID or user on the local computer.
  • ComputerName The computer on which to resolve the user name or SID. By default this command will attempt to resolve the SID or user on the local computer.
  • Credential The computer on which to resolve the user name or SID. By default this command will attempt to resolve the SID or user on the local computer.

Inputs

Resolve-SID accepts pipeline input any object with a username, SID, domain or ComputerName property and will assign those values to the corresponding parameters.

Outputs

Resolve-SID accepts pipeline input any object with a username, SID, domain or ComputerName property and will assign those values to the corresponding parameters.

Notes

The cmdlet requires that the Remote Registry and RPC services are started on the computer it is trying to access and that DNS services are available to resolve target host names.

Example 1

This command will return a object detailing the SID of the administrator account on the local computer:

c:\PS>Resolve-SID administrator

Example 2

Resolve-SID can also be used to resolve domain accounts. This command will return a object detailing the SID of the administrator account on the domain MyDomain:

c:\PS>Resolve-SID -UserName Administrator -Domain MyDomain

Example 3

Resolve-SID can also be used to resolve SIDs to account names. This command will an resolve SID S-1-5-21-918408938-1109995534-1109995534-1000 on remote computer PC01:

c:\PS>Resolve-SID -SID S-1-5-21-918408938-1109995534-1109995534-1000 -ComputerName PC01