Function f-sid {
param ( [Parameter(Mandatory=$true)][String]$Sid)
$objSID = New-Object System.Security.Principal.SecurityIdentifier($Sid)
Try {
($objSID.Translate( [System.Security.Principal.NTAccount])).value
}
Catch {
Write-host “`nCouldn’t find any entry matching SID : $Sid” -foregroundcolor cyan
}
}
#Put all SID in text file and run:
get-content C:\Users\su-skumar\Desktop\ser.txt | % { f-sid $_ }
No comments:
Post a Comment