Jump to content

Recommended Posts

Posted (edited)

Morning all,

 

I'm using the "Get-Teams" in powershell to try and find out which teams people are in. Two questions;

 

  1. Is there an easier way of finding out which teams someone is in?
  2. 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 by ZeroHour
Improved title a bit - ZH
Posted

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

  • Thanks 1
Posted

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....)

Posted

Want want want! :p

 

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

  • Thanks 1
Posted
Want want want! :p

 

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.

Posted

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

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...