Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Powershell Command "Get-DistributionGroup" doesn't work

The Get-DistributionGroup command is supposed to list distribution groups in a domain but I can't get it to run on my server.

After some Googling I found that Import-Module ActiveDirectory needs to be run first, but what I get when I run that is:

Import-Module : The specified module 'ActiveDirectory' was not loaded because no valid module file was found in any module directory.

My questions are

  1. How do I install this module into my PowerShell module directory? I thought it was supposed to do this automatically
  2. Once I have it installed, do I just run Import-Module ActiveDirectory and then I can run Get-DistributionGroup to list my dist groups?
like image 611
Tensigh Avatar asked Jul 29 '26 16:07

Tensigh


1 Answers

Echoing mjolinor's comment, but feel free to append with extra info.

Installing the AD tools won't help. Get-DistributionGroup is an Exchange cmdlet.

You'll need to either:

  • install the Exchange Management Tools
  • or connect to a management session on an Exchange server
like image 120
KyleMit Avatar answered Aug 01 '26 17:08

KyleMit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!