VoIP:Teams:Powershell: Difference between revisions

From VTX Public Wiki

(Move table above)
(→‎MicrosoftTeams : Install the module: Info added if installation of modul is needed without beeing a local administrator)
 
Line 73: Line 73:
</td></tr>
</td></tr>
</table>
</table>

{{Notice|1=If you are not a local administrator, Microsoft Teams PowerShell module can be installed for the user profile only by using -Scope CurrentUser}}


====MicrosoftTeams : What is the installed version of the module====
====MicrosoftTeams : What is the installed version of the module====

Latest revision as of 12:58, 22 January 2026

Powershell version[edit | edit source]

What is my Powershell version ?[edit | edit source]

  • Problematic: You would like to know which powershell version you are using
  • Solution: Start a Powershell shell and type the command "$PSVersionTable.PSVersion"
PS H:\> $PSVersionTable.PSVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  610

Install Powershell[edit | edit source]


Powershell Module Management[edit | edit source]

MicrosoftTeams Module[edit | edit source]

MicrosoftTeams : Install the module[edit | edit source]

  1. (optional) Uninstall the old SkypeOnlineConnector Powershell module in VoIP:Teams:Powershell#.28old.29_SkypeOnlineConnector_:_Uninstall_the_module
  2. Open Start menu and search "powershell" ( click the small Arrow to open it in Administrator mode ) Make sure to run the embedded version
  3. Use the powershell commands below to install the module "Install-Module MicrosoftTeams -RequiredVersion 4.5.0" (later version might work, but we validated this one)
  4. Accept to install the module from Powershell PSRepository


Install the MicrosoftTeams 4.5.0 version

PS H:\> Install-Module MicrosoftTeams -RequiredVersion 4.5.0

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y


PS H:\> Get-Module -ListAvailable MicrosoftTeams
    Directory: H:\WindowsPowerShell\Modules
ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     4.5.0      MicrosoftTeams                      {Add-TeamChannelUser, Add-TeamUser, Connect-MicrosoftTeams...


Start Powershell in Administrator mode
Powershell - Install MicrosoftTeams module

MicrosoftTeams : What is the installed version of the module[edit | edit source]


Normal output if you have install the version 4.5.0

PS H:\> Get-Module -ListAvailable MicrosoftTeams


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     4.5.0      MicrosoftTeams                      {Add-TeamChannelUser, Add-TeamUser, Connect-MicrosoftTeams...


Here is the output if you have 2 versions installed, you can use next section to delete the one you wish to remove

PS C:\WINDOWS\system32> Get-Module -ListAvailable MicrosoftTeams


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     4.5.0      MicrosoftTeams                      {Add-TeamChannelUser, Add-TeamUser, Connect-MicrosoftTeams...
Binary     2.0.0      MicrosoftTeams                      {Add-TeamUser, Connect-MicrosoftTeams, Disconnect-Microsof...

MicrosoftTeams : Update the module to last version[edit | edit source]

  1. Open Start menu and search "powershell" ( click the small Arrow to open it in Administrator mode ) Make sure to run the embedded version
  2. Use the powershell commands below to remove the module "Update-Module MicrosoftTeams"
PS C:\WINDOWS\system32> Update-Module MicrosoftTeams


MicrosoftTeams : Uninstall the module[edit | edit source]

  1. Open Start menu and search "powershell" ( click the small Arrow to open it in Administrator mode ) Make sure to run the embedded version
  2. Use the powershell commands below to remove the module "Uninstall-Module MicrosoftTeams"


Uninstall all versions of the module

PS C:\WINDOWS\system32> Uninstall-Module MicrosoftTeams


Powershell VTX Script Management[edit | edit source]

Update all VTX Powershell scripts to last version[edit | edit source]

  • Problematic: You would like to get the last version of all VTX Teams scripts
  • Solution: Simply follow the steps below
  1. Create a folder on your PC like "VTX Teams Scripts"
  2. Download https://wiki.vtx.ch/media/VTX_Teams_Update_All_Scripts.ps1 and put it in this folder ( Righ Click on the link and download the target file )
  3. Execute VTX_Teams_Update_All_Scripts.ps1 in powershell ( right click on the script and select "Run with Powershell"
  4. In case of problem, you can use the table below to download each file one by one
VTX Teams Management Powershell Scriptst
Usage Script Name Link
Download or update all scripts VTX_Teams_Update_All_Scripts.ps1 wget https://wiki.vtx.ch/media/VTX_Teams_Update_All_Scripts.ps1
Create VTX Teams Direct Routing

to be used only ones at 1st setup

VTX_Teams_Create_Routing_Rules.ps1 wget https://wiki.vtx.ch/media/VTX_Teams_Create_Routing_Rules.ps1
Assign or Remove numbers to users VTX_Teams_Assign_Numbers.ps1 wget https://wiki.vtx.ch/media/VTX_Teams_Assign_Numbers.ps1
Assign or Remove numbers to resources

not needed anymore, please use VTX_Teams_Assign_Numbers.ps1

VTX_Connect_Teams_Assign_Resource_Numbers.ps1 wget https://wiki.vtx.ch/media/VTX_Connect_Teams_Assign_Resource_Numbers.ps1
Unmap numbers for all users and resources

then, delete routing

VTX_Teams_Delete_Routing_Rules.ps1 wget https://wiki.vtx.ch/media/VTX_Teams_Delete_Routing_Rules.ps1


Teams Script - Use Updater
Teams Script - Updater Output
Teams Script - New Files downloaded