Public/ConvertFrom-SIDToDomainUser.ps1

Function ConvertFrom-SIDToDomainUser {
    <#
        .SYNOPSIS
            Convert SID to Domainusername
        .DESCRIPTION
            Convert SID to Domainusername
        .PARAMETER SID
            The user's SID
        .INPUTS
            System.String
        .EXAMPLE
            ConvertFrom-SIDToDomainUser -SID <SID>
        .LINK
            about_functions_advanced
        .LINK
            about_CommonParameters
    #>

    [CmdletBinding()]
    Param(
        [String]$SID
    )

    $objSID = New-Object System.Security.Principal.SecurityIdentifier($SID)
    $objUser = $objSID.Translate([System.Security.Principal.NTAccount])
    $objUser.Value
}