Powershell Teams Module

Hello and Good Day-

I’m still learning the basics of Powershell and its associated modules. I’ve been tasked with archiving Teams that have not been used. Using the Microsoft teams module is it possible to Set-TeamArchivedState by Group ID using more than just one Group ID in a single command?

One of the first things you should learn is how to read the help.

   -GroupId <String>
   -Archived <Boolean>
   [-SetSpoSiteReadOnlyForMembers <Boolean>]

The type <String> tells you that the parameter -GroupID expects one string at a time. If you could provide more than one at a time it would be <String[]> :wink:

Here you can read more about the help system of PowerShell

Yeah I thought so. I wasn’t sure if there was a way around that. Thanks for the input. :slight_smile:

There is a way around. You have to use a loop. :man_shrugging:t3: :wink:

Thanks. Whatever that means LOL

Here’s the link to Foreach-Object which is what you’d use in a loop.
ForEach-Object (Microsoft.PowerShell.Core) - PowerShell | Microsoft Learn

Thank so much Kevin!! Can you tell that I’m really green here? LOL

You don’t have to use a loop, GroupId also accepts pipeline input

GroupId of the team

Type:	String
Position:	Named
Default value:	None
Accept pipeline input:	True
Accept wildcard characters:	False

Agree with Olaf, you should learn the basics of powershell including how to use the help system. If you’re familiar with Linux, it’s similar to man pages. Tons of info right at your fingertips.

Yep. I am learning the basics. I’ve been watching a 6 hour course headed by Jeffery Snover. It has helped a lot.

1 Like

I find when watching Snover or Jason Helmick it’s best to do 1.5 to 2.0 speed. :slight_smile: