If you are looking to get domain\saMAccountName in a variable, you may be able to use the Directory attribute msDS-PrincipalName.
@@attr:msDS-PrincipalName@@
The information from Microsoft on this :
http://msdn.microsoft.com/en-s/library/cc221208.aspx