Showing posts with label module. Show all posts
Showing posts with label module. Show all posts

Tuesday, 17 August 2021

Install Active Directory Powershell Module in Windows 10

For whatever reason, Microsoft has now changed the way the powershell module for Active Directory Domain Services and Lightweight Directory Services tools.

Most documentation suggests you install this from the "Turn Windows features on or off" menu located under Programs and Features within Control Panel - but in later Windows 10 releases, the feature is no longer available. It was previously called "Role Administration Tools".

Role Administration Tools is no longer visible under Turn Windows Features on or off

Likewise, the previously used powershell command is no longer recognised

Enable-WindowsOptionalFeature -Online -FeatureName RSATClient-Roles-AD-Powershell

You now get an error when running this command

Enable-WindowsOptionalFeature : Feature name RSATClient-Roles-AD-Powershell is unknown.

So, how do you do it? Follow the steps below
  1. Click the Start button then select Settings
  2. Select Apps
  3. Select Optional Features
  4. Click Add a Feature
  5. Search for "RSAT" and select the option for RSAT: Active Directory Domain Services and Lightweight Directory Services Tools



    Select the option for RSAT: Active Directory Domain Services and Lightweight Directory Services

  6. Click Install
If you get an error saying the install failed, make sure you aren't using a WSUS server as windows will try and install it from there by default if you are.

To check, open regedit and go to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU and set the UseWUServer key to 0


Sunday, 8 August 2021

Microsoft Teams - Install Preview/Prerelease Powershell Module

Microsoft Teams has a preview/prerelease version of their powershell module available which has some commands that aren't contained in the general/public release.

If you wish to install the prerelease module, you can use the command below to do so

Install-Module -Name MicrosoftTeams -AllowPrerelease -force

You may need to restart your powershell session and import the module again to get the required cmdlets.

If you get an error saying the 'allowprerelease' argument isn't recognized, then run the below commands ot update the PackageManagement and PowershellGet modules

Install-Module -Name PackageManagement -Repository PSGallery -Force
Install-Module -Name PowerShellGet -Repository PSGallery -Force

Restart your powershell session then run the install-module command again and it should complete successfully.

Saturday, 7 August 2021

Powershell - a parameter cannot be found that matches parameter name 'AllowPrerelease'

Sometimes when installing powershell modules, you may wish to utilise pre-release or preview versions of packages. Depending on what version of powershell you have installed, you may get an error message like the one below when attempting to install preview/prerelease packages;

Install-Module : A parameter cannot be found that matches parameter name 'AllowPrerelease'.

At line:1 char:37

To fix the problem you need to force an update of a couple of Powershell modules - namely PowershellGet and PackageManagement. 

Run the commands below from an elevated powershell command prompt;

Install-Module -Name PowerShellGet -Repository PSGallery -Force
Install-Module -Name PackageManagement -Repository PSGallery -Force

Exit/close your Powershell window/session then re-open and run the install-module command again - it should now complete successfully

Friday, 6 August 2021

Microsoft Teams - teamchanneluser cmdlet is not recognized

Microsoft Teams features some commands (cmdlets) that are not readily available in the public/general release version of the Microsoft Teams powershell module. Some of these commands are;

get-teamchanneluser

add-teamchanneluser

If you attempt to run these commands, you'll get an error message like the one below;

get-teamchanneluser : The term 'get-teamchanneluser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:1

To fix the problem you will need to install the preview release of the Microsoft Teams powershell module. You can check the release version numbers from the website below

https://www.powershellgallery.com/packages/MicrosoftTeams/2.0.0

To install the preview release version, make note of the version number then run the command below

Install-Module -Name MicrosoftTeams -AllowPrerelease

To fix the problem you need to force an update of a couple of Powershell modules - namely PowershellGet and PackageManagement. 

Install-Module : A parameter cannot be found that matches parameter name 'AllowPrerelease'.

At line:1 char:37

Run the commands below from an elevanted powershell command prompt;

Install-Module -Name PowerShellGet -Repository PSGallery -Force
Install-Module -Name PackageManagement -Repository PSGallery -Force

Exit/close your Powershell window/session then re-open and run the install-module command again - it should now complete successfully

You can confirm what version is installed by running the commands

import-module "MicrosoftTeams"

get-module

Look for the version number for the "MicrosoftTeams" module