Q:

Processing ForeignSecurityPrincipal

DomainA and DomainB trust each other. Some DomainB users are members of DomainA local domain groups. How can I get ForeignSecurityPrincipal in PowerShell and get list of its groups? 

A:

That was surprisingly simple:
    Get-ADObject -Filter {ObjectClass -eq "foreignSecurityPrincipal"} -Properties msds-principalname,memberof    

where "msds-principalname" is sAMAccountName, so I can search now through FSPs by sAMAccountName and get its groups.    

