$string = "LastName, FirstName ([samaccountname])"
[Regex]::Matches($string, '(?<=\[)(.*?)(?=])').Value
Uses a regex expression with find all characters that match the expression.
PS C:\> $string = "LastName, FirstName ([samaccountname])" >> [Regex]::Matches($string, '(?<=\[)(.*?)(?=])').Value samaccountname