Forum Discussion
Mitch Crump
Feb 11, 2020Copper Contributor
Get SharePoint Site URL of an individual Microsoft Team
I found the below code online. I want to use the same concept but only return one SP site URL so I can use the URL to create a folder in that Team. $Teams = (Get-Team |Select GroupId, DisplayNa...
VasilMichev
Feb 11, 2020MVP
Might help if you give us the exact samples you are running, I don't see any problem with the above.
- Mitch CrumpFeb 11, 2020Copper Contributor
VasilMichev I am trying to do something like the two examples below
Get-Team -DisplayName $Team | Select GroupId $SPOURL = (Get-Team -Identity $Team.GroupId | Select -ExpandProperty SharePointSiteURL)
Get-Team -DisplayName $Team | Select GroupId $SPOURL = (Get-PnpSite -Identity $Team.GroupId | Select -ExpandProperty SharePointSiteURL)
- Mitch CrumpFeb 11, 2020Copper Contributor
Mitch Crump I don't want to use UnifiedGroup because I only want a singular URL but now Get-UnifiedGroup is not working for me and I can't find the required module to install for it.
PS C:\WINDOWS\system32> Find-Module -Includes Cmdlet Get-UnifiedGroup PackageManagement\Find-Package : No match was found for the specified search criteria and module name 'Get-UnifiedGroup'. Try Get-PSRepository to see all available registered module repositories. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1397 char:3 + PackageManagement\Find-Package @PSBoundParameters | Microsoft ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
- VasilMichevFeb 11, 2020MVP
Well you cannot just expect every cmdlet to return the SharePointSiteUrl value, Get-Team most certainly does not do it.
To use the Get-UnifiedGroup cmdlet, you need to connect to Exchange Online PowerShell: https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps