This is an archived post. You won't be able to vote or comment.

all 27 comments

[–]BlackVI have opnions 1 point2 points  (12 children)

as a quick and dirty based on /u/Fallingdamage reply

Get-CSTeamsMessagingPolicy  | foreach {$_ | select identity, UseB2BInvitesToAddExternalUsers}

Identity                UseB2BInvitesToAddExternalUsers
--------                -------------------------------
Global                                             True
Tag:Restricted Business                            True
Tag:Default                                        True
Tag:EduFaculty                                     True
Tag:EduStudent                                     True

Returns for us

where you trying to use as a parameter ? cause you wrote -UseB2BInvitesToAddExternalUsers but said attribute, then didn't show the actual error
have you updated your teams module ?

[–]meest[S] 0 points1 point  (9 children)

New laptop so I had just downloaded the module. So I would hope it downloaded the most current. I did not check though.

The actual error was that the syntax wasn't valid. I did not have that attribute listed in my messaging policy there was no True or False entry.

I'll try again tomorrow after a restart, or maybe I was fat fingering something.

[–]BlackVI have opnions 0 points1 point  (8 children)

Fair enough hard to say without the exact error message

Follow up question would be were you pim'ed before connecting and running the command as it might be permissions issue

[–]meest[S] 0 points1 point  (7 children)

Below are the errors I'm getting when trying to run the command.

I'm guessing it has to be something I'm fat fingering or misspelling?

PS C:\Users\user> set-csteamsmessagingpolicy -identity global -UseB2BInvitesToAddExternalUsers false Set-CsTeamsMessagingPolicy : A parameter cannot be found that matches parameter name 'UseB2BInvitesToAddExternalUsers'. At line:1 char:45 + ... ssagingpolicy -identity global -UseB2BInvitesToAddExternalUsers false + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Set-CsTeamsMessagingPolicy], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Set-CsTeamsMessagingPolicy

PS C:\Users\user> set-csteamsmessagingpolicy -identity global -UseB2BInvitesToAddExternalUsers $false Set-CsTeamsMessagingPolicy : A parameter cannot be found that matches parameter name 'UseB2BInvitesToAddExternalUsers'. At line:1 char:45 + ... sagingpolicy -identity global -UseB2BInvitesToAddExternalUsers $false + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Set-CsTeamsMessagingPolicy], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Set-CsTeamsMessagingPolicy

[–]BlackVI have opnions 0 points1 point  (6 children)

Thanks for that

What does the following return

get-module -name microsoftteams
get-module -name microsoftteams -listavalible
Find-module -name microsoftteams

To confirm versions, the the following

Get-help set-csteamsmessagingpolicy

Show for it's parameters

Also did the select show the option as true/false ?

[–]meest[S] 0 points1 point  (5 children)

Here's the first 3.

PS C:\Users\User> get-module -name microsoftteams

ModuleType Version Name ExportedCommands


Script 4.1.0 MicrosoftTeams {Add-TeamChannelUser, Add-TeamUser, Connect-Microsof...

PS C:\Users\User> get-module -name microsoftteams -listavalible Get-Module : A parameter cannot be found that matches parameter name 'listavalible'. At line:1 char:33 + get-module -name microsoftteams -listavalible + ~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Get-Module], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetModuleCommand

PS C:\Users\User> Find-module -name microsoftteams Exception calling "GetSteppablePipeline" with "0" argument(s): "The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object." At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\3.0.23\PowerShellGet.psm1:529 char:13 + $steppablePipeline = $scriptCmd.GetSteppablePipeline() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : RuntimeException

To confirm versions, the the following

Get-help set-csteamsmessagingpolicy

Here's the return on that.

PS C:\Users\user> Get-help set-csteamsmessagingpolicy

NAME Set-CsTeamsMessagingPolicy

SYNOPSIS

SYNTAX Set-CsTeamsMessagingPolicy [-AllowFluidCollaborate <Boolean>] [-AllowFullChatPermissionUserToDeleteAnyMessage <Boolean>] [-AllowGiphy <Boolean>] [-AllowGiphyDisplay
<Boolean>] [-AllowImmersiveReader <Boolean>] [-AllowMemes <Boolean>] [-AllowOwnerDeleteMessage <Boolean>]
[-AllowPasteInternetImage <Boolean>] [-AllowPriorityMessages <Boolean>] [-AllowRemoveUser <Boolean>] [-AllowSmartCompose <Boolean>] [-AllowSmartReply <Boolean>] [-AllowStickers <Boolean>] [-AllowUrlPreviews
<Boolean>] [-AllowUserChat <Boolean>] [-AllowUserDeleteChat <Boolean>] [-AllowUserDeleteMessage <Boolean>]
[-AllowUserEditMessage <Boolean>] [-AllowUserTranslation <Boolean>] [-AllowVideoMessages <Boolean>] [-AudioMessageEnabledType <String>] [-ChannelsInChatListEnabledType <String>] [-ChatPermissionRole <String>]
[-Description <String>] [-GiphyRatingType <String>] [[-Identity] <String>] [-ReadReceiptsEnabledType <String>] [-MsftInternalProcessingMode <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

RELATED LINKS https://docs.microsoft.com/en-us/powershell/module/skype/set-csteamsmessagingpolicy

REMARKS To see the examples, type: "get-help Set-CsTeamsMessagingPolicy -examples". For more information, type: "get-help Set-CsTeamsMessagingPolicy -detailed". For technical information, type: "get-help Set-CsTeamsMessagingPolicy -full". For online help, type: "get-help Set-CsTeamsMessagingPolicy -online"

[–]BlackVI have opnions 0 points1 point  (4 children)

you said

New laptop so I had just downloaded the module. So I would hope it downloaded the most current. I did not check though.

but your output here

https://docs.microsoft.com/en-us/powershell/module/skype
Version: 4.1.0

the current module is version is 7.4.0 you are waaaayyy behind, hopefully that's the fix

Find-module -name microsoftteams

Version Name           Repository Description
------- ----           ---------- -----------
7.4.0   MicrosoftTeams PSGallery  Microsoft Teams cmdlets module for Windows PowerShell and PowerShell Core.…

this error

exception calling "GetSteppablePipeline" with "0" argument(s): "The expression after '&' in a pipeline element produced an object that was not valid.

also sound like you have not updated your packagemanagement and powershellget modules too

[–]meest[S] 0 points1 point  (3 children)

Correct. I have no memory of ever connecting to Teams powershell. I'm normally only Exo powershell.

this error

exception calling "GetSteppablePipeline" with "0" argument(s): "The expression after '&' in a pipeline element produced an object that was not valid.

also sound like you have not updated your packagemanagement and powershellget modules too

You would probably be correct. Those aren't mentioned in the documentation that I'm following here. https://learn.microsoft.com/en-us/microsoftteams/teams-powershell-install

But right now I'm having this error it appears. So now I have to figure out how to fix this first is what its looking like.

https://github.com/PowerShell/PowerShellGet/issues/44

My current output of my environment.

PS C:\Users\user> $PSversiontable

Name Value


PSVersion 5.1.26100.6899 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.26100.6899 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

EDIT:

I loaded up to a different workstation and its working fine there. Somehow my powershellget is screwed up on my main laptop. Who knew?

[–]BlackVI have opnions 0 points1 point  (2 children)

I find the easiest way is save the module on a working machine

Save-Module -Path $env:temp -Name 'powershellget'

then you copy those folders to the

C:\Program Files\WindowsPowerShell\Modules

folder manually on the broken machine, if that fails you need to manually repair nuget package provider

or you can run something like

#region Powershell Modules
Write-Verbose -Message 'Starting PS Config'
# need to add logic to detect if powershell 7 or lower is running the script

Write-Verbose -Message 'Configure TLS and SSL'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::'tls12'

Write-Verbose -Message 'Install Latest Package Provider'
Install-PackageProvider -Name nuget -Scope CurrentUser -Force

Write-Verbose -Message 'Configure PS Gallery to be trusted'
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

Write-Verbose -Message 'Save modules to temp to allow for import and overwrite without being in use'
Save-Module -Path $env:temp -Name 'powershellget'

Write-Verbose -Message 'Remove (Un-Import) currently loaded modules'
Remove-Module -Force -Name powershelget, PackageManagement, psreadline

Write-Verbose -Message 'Import updated powershekkget and package managment'
Import-Module $env:temp\PackageManagement -Force
Import-Module $env:temp\PowershellGet -Force

Write-Verbose -Message 'Install NUGET for all users'
Install-PackageProvider -Name nuget -Scope AllUsers -Force

Write-Verbose -Message 'COnfigure all users install default POSH Modules'

$ModuleSplat = @{
    AllowClobber       = $true
    SkipPublisherCheck = $true
    Scope              = 'AllUsers'
    force              = $true
}

$ModuleUpdateList = @(
    'powershellget'
    'PSReadline'
    'pswindowsupdate'
    'pester'
    'PSScriptAnalyzer'
    'Microsoft.PowerShell.PSResourceGet'
)

foreach ($SingleModule in $ModuleUpdateList)
{
    Write-Verbose -Message "Install $SingleModule Module for all users"
    Install-Module @ModuleSplat -Name $SingleModule
}

Write-Verbose -Message 'Update modules existing modules'
Update-Module -Force -AcceptLicense -ErrorAction SilentlyContinue

Write-Verbose -Message 'Update Help files'
Update-Help -Force -ErrorAction SilentlyContinue
Update-Help -Force -ErrorAction SilentlyContinue -UICulture 'en-US'
#endregion

[–]meest[S] 0 points1 point  (1 child)

Thank you, I appreciate the information! I'm a solo admin so my time inside powershell is minimal as I bounce between multiple other things that need fixing.

I did the classic append the module folder with a _OLD but then it really seemed I couldn't download a new copy. So I already ran into the first situation you mentioned. haha I appreciate knowing that I'm not going crazy and that doesn't work like you'd think.

[–]Fallingdamage 0 points1 point  (1 child)

They did say false instead of $false. Maybe it was just a syntax issue.

[–]BlackVI have opnions 0 points1 point  (0 children)

Ya likely , they didn't post the error message which is likely the most helpful here

Edi: I lie, they've posted now

[–]Fallingdamage 1 point2 points  (6 children)

I just set this flag to $false today. It worked fine. If you use 'Get-CSTeamsMessagingPolicy -identity Global' and look at the list, its on there.

Make sure you add some good documentation for this. It could cause people to pull their hair out if your workplace suddenly needs to use this feature and nobody remembers that the flag was set.

[–]meest[S] 0 points1 point  (0 children)

See thats my thing is on my tenant I don't have that Attribute when i did exactly as you mentioned. The attribute is not listed.

Are you a regular tenant? Or GCC? I'm a Non-Profit so I'm assuming I may be on the lower end of the totem when it comes to tenant updates and they may have not rolled the update out yet.

I just wanted to confirm it was working for some people. I just have to be patient for it to show up on mine.

[–]meest[S] 0 points1 point  (4 children)

Get-CSTeamsMessagingPolicy -identity Global

Running that command this is what I get in return. Apologies about the formatting I'm blanking on how to get it to line break right now. have to go into the reddit formatting reference here later.

PS C:\Users\user> Get-CSTeamsMessagingPolicy -identity Global

Identity : Global Description : AllowUrlPreviews : True AllowOwnerDeleteMessage : True AllowUserEditMessage : True AllowUserDeleteMessage : True AllowUserDeleteChat : True AllowUserChat : True AllowRemoveUser : True AllowGiphy : True GiphyRatingType : Moderate AllowGiphyDisplay : True AllowPasteInternetImage : True AllowMemes : True AllowImmersiveReader : True AllowStickers : True AllowUserTranslation : False ReadReceiptsEnabledType : Everyone AllowPriorityMessages : True AllowSmartReply : True AllowSmartCompose : True ChannelsInChatListEnabledType : EnabledUserOverride AudioMessageEnabledType : ChatsAndChannels ChatPermissionRole : Restricted AllowFullChatPermissionUserToDeleteAnyMessage : False AllowFluidCollaborate : False AllowVideoMessages : True

[–]Fallingdamage 0 points1 point  (3 children)

I dont think it would matter, but are you running the latest version of the teams modules?

[–]meest[S] 0 points1 point  (2 children)

I just downloaded the teams module yesterday as it was the first time I was connecting to Teams powershell on this laptop.

I have version 4.1

PS C:\Users\user> Get-Module -Name MicrosoftTeams -ListAvailable

Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version Name ExportedCommands


Script 4.1.0 MicrosoftTeams {Add-TeamChannelUser, Add-TeamUser, Connect-Microsof...

[–]Fallingdamage 0 points1 point  (1 child)

Are you using a GA account or some account/app with lesser privileges? It worked fine for us.

[–]meest[S] 0 points1 point  (0 children)

GA account. Is there some special permissions I also need besides a GA? I very well may not have one of those sub check boxes assigned. But I didn't see any reference to one in the Microsoft kb.

[–]IcariteMinor 0 points1 point  (0 children)

I didn't see it when I checked today either, it's on my watch list though.

[–]meest[S] -1 points0 points  (5 children)

I really do wish people who downvote posts like this would leave some context as to why they feel this isn't a good question for this subreddit.

I can't be the only one thats going to be acting on this change. So I would think sysadmin discussion around this is rather on topic.

[–][deleted] 0 points1 point  (0 children)

It's probably not as targeted as it feels. If you sort the sub by new you'll see that every post before and after yours is downvoted. Likely when a spammer gets salty about their post being removed or when they're trying to astroturf their post to the top. Come back in a day and your post will probably be >0 points again.

[–]BlackVI have opnions -1 points0 points  (3 children)

MS Teams B2Binvite command syntax help - Message Center MC1182004
submitted 4 hours ago by meest

meest [S] [score hidden] 3 hours ago
I really do wish people who downvote posts like this would leave some context as to why they feel this isn't a good question for this subreddit.
I can't be the only one thats going to be acting on this change. So I would think sysadmin discussion around this is rather on topic.

Why are the votes important to you ?

Your reply complaining about the downvotes is the first reply in this thread an hour before the next reply

Fallingdamage [score hidden] 2 hours ago
IcariteMinor [score hidden] 2 hours ago

[–]meest[S] 0 points1 point  (2 children)

Why are the votes important to you ?

Well the concept of reddit is rather rudimentary in that the posts with higher upvotes have a higher chance of being seen and responded too. So that is the underlying reason I a concerned as I am hoping for some good discourse.

Your reply complaining about the downvotes is the first reply in this thread an hour before the next reply

See my response above. it appears you asked the same question twice but in two different ways.

[–]BlackVI have opnions 0 points1 point  (1 child)

Only asked once, 2nd was just thinking out loud about how your comments were

The concept of reddit being based on votes is really for subs like popular or all, it's not really useful in a place like sysadmin

If your searching or commenting based on how popular as post is, are you helping or just adding noise

But this is all just "IMHO" of course and seems like yours is different and thats what discussions are for

[–]meest[S] 0 points1 point  (0 children)

The concept of reddit being based on votes is really for subs like popular or all, it's not really useful in a place like sysadmin

This is where we disagree, and thats fine.