Get-Command -Module MicrosoftTeams does not include Get-TeamChannelUser cmdlet - powershell

So, I'm looking to do some powershell automation now that my company is clamoring for Microsoft Teams. I installed the module version 1.0.5 (currently the latest) and I'm seeing documentation on how to add users to team channels.
I get cmdlet not found errors when using those commandlets
Get-TeamChannelUser : The term 'get-teamchanneluser' is not recognized as the name of a cmdlet, function, script file...
Low and behold, get-command -module MicrosoftTeams returns no cmdlets with TeamChannelUser (Get, Remove or Set).
I've tried older versions of the module but I'm still seeing the same symptom. Is anyone else able to reproduce this? Any workarounds?

I haven't tested this specifically, but have you looked into the new (pre-release) Microsoft Graph PowerShell module? It includes a lot of "Teams" functions, but also of course more broad "Graph" capabilities, which is important (recall that Teams relies on SharePoint, Groups, etc.).

I had to manually install a test version 1.0.21, but now when I run the Get-Command, I see the ChannelUser cmdlets.
Thanks to Hilton Giesenow, I'm going to try his suggestion as well and will mark it as the answer if it works better and post an update.

I struggled to get this working. I ended up installing 1.1.3.
This is what worked for me:
PS C:\WINDOWS\system32> Install-Module -Name MicrosoftTeams -RequiredVersion 1.1.3-preview -AllowPrerelease -force -AllowClobber
PS C:\WINDOWS\system32> Import-Module microsoftteams
PS C:\WINDOWS\system32> get-command -Module microsoftteams

Related

Import Powerhsell DNS server module

I am deploying some virtual machines by script, and I would like to check if the FQNA that I adding to my script is already created in the DNS records.
I found the commands to do this, but I can't find what Powershell module I need to use these commands.
Found DNSserver and others, but this doesn't work and I am a bit confused which module should I import/install to be able to use Powershell DNS commands to use like get-dnsserverresourcerecord or Add-DnsServerResourceRecordA etc.
Thank You
I had this issue as well. This module is part of RSAT. If you only want the get-dnsserverresourcerecord or Add-DnsServerResourceRecordA, that is in the feature Rsat.Dns.Tools~~~~0.0.1.0.
From an elevated prompt in PowerShell:
Add-WindowsCapability -Online -Name Rsat.Dns.Tools~~~~0.0.1.0
If you want all of the RSAT features:
Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online
Verified in PowerShell 7.2.5
Found this information here:
https://mikefrobbins.com/2018/10/03/use-powershell-to-install-the-remote-server-administration-tools-rsat-on-windows-10-version-1809/
The cmdlets are in the DNSServer module.
https://learn.microsoft.com/en-us/powershell/module/dnsserver/?view=windowsserver2022-ps
get-dnsserverresourcerecord
https://learn.microsoft.com/en-us/powershell/module/dnsserver/get-dnsserverresourcerecord?view=windowsserver2022-ps
add-dnsserverresourcerecorda
https://learn.microsoft.com/en-us/powershell/module/dnsserver/add-dnsserverresourcerecorda?view=windowsserver2022-ps

Get-PnPProvisioningTemplate is not recognized as the name of a cmdlet

I am learning SharePoint and more specifically provisioning with PowerShell. I can't use cmdlets as Get-PnPProvisioningTemplate or Apply-PnPProvisioningTemplate, when execute them PS return that are not cmdlets. I don't know if I need to install something.
#Felipe,
These cmdlets are existed in legacy PnP but replaced by a new cmdlet in the current PnP.
Upgrading from the Legacy version of PnP PowerShell | PnP PowerShell
PnP PowerShell | PnP PowerShell
And the new corresponding cmdlet is:
Invoke-PnPSiteTemplate
More reference:
https://github.com/pnp/powershell/issues/285
BR
You need to follow the PnP.Powershell Documentation (https://github.com/pnp/powershell) that links you to the installation guide (https://pnp.github.io/powershell/articles/installation.html)
Basically you need to run Install-Module -Name "PnP.PowerShell" from a powershell console

Updating SSL bindings for IIS with Powershell 7

I'm trying to update a PS5 script to PS7, mainly because the script does work that requires a PS Core module.
Part of the script involved updating IIS bindings to use a different SSL Certificate. The cert is in the store and ready to be used - I just need to change the thumbprint on the binding.
My PS5 script used Get-WebConfiguration to get the bindings and then just looped through, calling RebindSslCertificate on relevant bindings.
I've tried using Set-WebConfigurationProperty and Set-WebBinding; neither errors but neither actually updates the binding with IIS - example:
Set-WebConfigurationProperty -Name 'certificateHash' -Value $newCert.Thumbprint -PSPath "IIS:\\" `
-Filter "/system.applicationHost/sites/site/bindings/binding[#protocol='https'][#bindingInformation='*:443:hostname']" `
Could anyone help point me in the right direction for what I'm missing?
Thanks,
Mark.
P.S., Apologies if this is a repeat question but all I can find is old stuff that doesn't work or relates to "-Set-Item IIS:\SslBindings" Maybe there is someway to get the IIS drive working with remoting?
Ran into this on 9/10/2021 using Powershell 7.1.4.
As of date of writing, this is an open issue on github for PowerShell.
Link for reference: https://github.com/PowerShell/PowerShellModuleCoverage/issues/14
Issue is that PowerShell 7 is based on .NET Core and the PS module WebAdministrator is based on .NET Framework.
When you run
Import-Module WebAdministration
WARNING: Module WebAdministration is loaded in Windows PowerShell using WinPSCompatSession remoting session; please note that all input and output of commands from this module will be deserialized objects. If you want to load this module into PowerShell please use 'Import-Module -SkipEditionCheck' syntax.
Notice the mention of 'WinPSCompatSession' in the warning. If the module manifest doesn't indicate that the module is compatible with PowerShell Core, then it gets loaded via the Windows PowerShell Compatibility Feature.
It seems this module partially works in compatibility mode, however if you try to work with IIS:\ then you start getting errors.
Alternatively, if you run the parameter in the warning you get this.
Import-Module -SkipEditionCheck WebAdministration
Import-Module: Could not load type 'System.Management.Automation.PSSnapIn' from assembly 'System.Management.Automation, Version=7.1.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
A quick test in PowerShell 7.1.4 will show you that you can't access the IIS connector.
PS C:\Windows\System32> Import-Module WebAdministration
WARNING: Module WebAdministration is loaded in Windows PowerShell using WinPSCompatSession remoting session; please note that all input and output of commands from this module will be deserialized objects. If you want to load this module into PowerShell please use 'Import-Module -SkipEditionCheck' syntax.
PS C:\Windows\System32> cd IIS:\
Set-Location: Cannot find drive. A drive with the name 'IIS' does not exist.
However, if you open up PowerShell 6 you can do this no problem.
PS C:\WINDOWS\system32> Import-Module WebAdministration
PS C:\WINDOWS\system32> cd IIS:\
PS IIS:\> dir
Name
----
AppPools
Sites
SslBindings
My next step is trying to get this to work by loading the .NET assembly directly. Will update with the solution
[System.Reflection.Assembly]::LoadFrom("$env:systemroot\system32\inetsrv\Microsoft.Web.Administration.dll")

Get-Help cannot find the Help files for ServiceFabric module

I installed the Azure Service Fabric SDK and I wanted to get some help information on some of the commands:
Get-Help Connect-ServiceFabricCluster
It returns the following output under remarks:
REMARKS
Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partial help.
-- To download and install Help files for the module that includes this cmdlet, use Update-Help.
I ran Update-Help -Module ServiceFabric in an administrator window and I still get this error.
How can I get the help to work for the ServiceFabric powershell commands?
I just ran Update-Help successfully from an admin window, are you still seeing this problem? You could try running Update-Help -Module ServiceFabric -Force to force update.
Sounds like an issues with PowerShell Update-Help. This post provides a little more info and a workaround.
I had a similar issue with core commands, i.e. I couldn't get detailed help for Get-Command.
In my case it helped specifying the locale to en-US when running Update-Help as there seems to be a Problem with the fallback to en-US when no other help files can be found.
Command it worked with:
Update-Help -UICulture en-US
See also:
https://github.com/PowerShell/PowerShell/issues/6217

Problems setting up Azure in Powershell

I'm trying to follow the directions here: Azure Resource Manager Cmdlets
I do this:
PS C:\> Install-Module AzureRM
That works, then I try this:
PS C:\> Install-AzureRM
I get this message:
Install-AzureRM : The term 'Install-AzureRM' is not recognized as the name of a cmdlet, function, script file, or operable program.
What am I missing?
The Install-Module in article you came across is referring to cmdlet come with WMF5.0. In other words, only available in Powershell 5.0
There is another version of Install-Module come with PsGet, but that one won't accomplish your task (Install-Module AzureRM), so please try to avoid it.
If you don't want to install powershell 5.0, but want azure cmdlet, you can find stand-alone module installer here.
I believe you want to use Import-AzureRM instead of Install-AzureRM