Jawloms Posted May 20, 2020 Posted May 20, 2020 (edited) Morning all, I'm using the "Get-Teams" in powershell to try and find out which teams people are in. Two questions; Is there an easier way of finding out which teams someone is in? When it outputs the results, it truncates the team name to 15 characters. We have a few Teams where the "Set" bit is after character 15. Is there a way around this? Thank you Stuart Edited May 20, 2020 by ZeroHour Improved title a bit - ZH
Steve21 Posted May 20, 2020 Posted May 20, 2020 In answer to your second one, normally just using something like | fl On the end of any powershell will return a better formatted list, but might be worth trying Steve 1
Jawloms Posted May 20, 2020 Author Posted May 20, 2020 Not wishing to sound like someone who's never happy, but that's too much information! Sorry. You're input is appreciated, I promise. I like the layout of the first attempt as it is copy/pastable in to Excel to then manipulate. adding the " | fl" does indeed give the complete name which is what I was after, but the layout changes and is not so easy to play with. Any ideas on a middle ground? Thank you Regards, Stuart (whom apparently can't be pleased....)
Steve21 Posted May 20, 2020 Posted May 20, 2020 Want want want! Is it just the username and teams you're after? Or is there any other info you need from it? It might work just doing it as an auto-size if it's already in a table view? e.g. | Format-Table -AutoSize Steve 1
Jawloms Posted May 20, 2020 Author Posted May 20, 2020 Want want want! Is it just the username and teams you're after? Or is there any other info you need from it? It might work just doing it as an auto-size if it's already in a table view? e.g. | Format-Table -AutoSize Steve Thank you, perfect! Everyone can stand down again now. Toys are back in the pram.
psydii Posted May 21, 2020 Posted May 21, 2020 1) I find that I need to use several powershell modules to get things done. ExchangeOnline, MicrosoftTeams, AzureAD, and SkypleOnlineConnector. For this problem I'd start with the AzureAD module and run something like this: Get-AzureADUser -SearchString [email][email protected][/email] | Get-AzureADUserMembership | ? {$_.ObjectType -ne "Role"} | % {Get-AzureADGroup -ObjectId $_.ObjectId | select DisplayName,ObjectType,MailEnabled,SecurityEnabled,ObjectId} | ft Which gives you all groups of which a user is a member. Then pass the groupid to get-team and if you get a result its a Team. https://www.michev.info/Blog/Post/1655/quickly-list-all-groups-a-user-is-member-of-or-owner-of-in-office-365 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now