Federation Script

I need a script to show me all the users that have federation enabled and what policy they currenty have (Public, Outside Access ...ect. Can someone point me in the right direciton or help build this script?