Using PowerShell - Identify the computer name using SID

Sdílet
Vložit
  • čas přidán 11. 09. 2024
  • Using PowerShell - Identify the computer name using SID
    1. Prepare
    - DC21 : Domain Controller (pns.vn)
    - A SID : S-1-5-21-1107119419-255464333-473694811-1117
    - Syntax : Get-ADComputer
    Get-ADComputer -Filter string [-AuthType {Negotiate | Basic}] [-Credential pscredential] [-Properties string[]]
    [-ResultPageSize int] [-ResultSetSize int] [-SearchBase string]
    [-SearchScope {Base | OneLevel |Subtree}] [-Server string] [CommonParameters]
    2. Step by step
    - DC21 : Identify the computer name using SID S-1-5-21-1107119419-255464333-473694811-1117
    + Start - Windows PowerShell :
    + Get-ADComputer -Filter * | FT Name,DNSHostName,ObjectClass,SID
    Show all computers with parameters
    + Get-ADComputer -Filter{SID -eq 'S-1-5-21-1107119419-255464333-473694811-1117'} | FT Name,DNSHostName,ObjectClass,SID
    Finds computer name has SID === Is DC24

Komentáře • 1

  • @megt1364
    @megt1364 Před 5 lety

    I am told Get-ADComputer is not recognized as the name of a cmdlet. Useless. My screen looks exactly as above. All I need is to get a SID. Cannot believe this is so difficult. I am on server 2016 and the registry keys are not as any of these articles say either.