Monday, January 7, 2019

SID to UserID, UserID to SID


This blog
https://community.spiceworks.com/how_to/2776-powershell-sid-to-user-and-user-to-sid

by SpoonerTech at Spiceworks was very helpful at going back and forth using powershell to and from a User Id or a SID #

Thanks,

Step 1: Domain User to SID

This will give you a Domain User's SID
$objUser = New-Object System.Security.Principal.NTAccount("DOMAIN_NAME", "USER_NAME")
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
$strSID.Value

Step 2: SID to Domain User

This will allow you to enter a SID and find the Domain User
$objSID = New-Object System.Security.Principal.SecurityIdentifier `
("ENTER-SID-HERE")
$objUser = $objSID.Translate( [System.Security.Principal.NTAccount])
$objUser.Value

2 comments:

  1. The most common problems which you may face with your refrigerator are when it does not cool appropriately, is slow in making ice or does not make ice at all, building up of frost, does not dispense water or ice, noisy or making clicking sounds, water leakage and so on. Top Rated Washer Repair Service in Riverside

    ReplyDelete
  2. Asphalt is very strong, durable and weather resistant in addition to being resistant to damaging effects from chemicals concrete floor sealer

    ReplyDelete