Dmccann110 on Fri, 05 Feb 2016 20:54:41
I am trying to use Powershell cmdlets to automate the creation of distribution groups in Office 365. I have successfully created all the users, but when it comes to any cmdlets regarding distribution groups, I get the error: The term 'xyz' is not recognized as the name of a cmdlet, funtion, script file, or operable program. The execution policy is set to RemoteSigned, the active modules are Microsoft.PowerShell.Management, Microsoft.PowerShell.Security, and MSOnline. My O365 account has Global Admin permissions as well as Organization Management and Recipient Management. Specific examples of the cmdlets that are not found/erroring out: New-DistributionGroup, Add-DistributionGroupMember, Get-DistributionGroup. How do I get the module that contains the necessary cmdlets?
Girish Prajwal on Sat, 06 Feb 2016 16:56:35
Thanks for posting here.
I suggest you to refer the below article for O365 cmdlets on azure AD.
Hope this helps.
Dmccann110 on Sat, 06 Feb 2016 18:38:08
Thanks for your reply,
I have gone through those steps and searched somewhat extensively and tried everything I have found so far. This particular post suggests setting the execution policy to Unrestricted, though others suggest RemoteSigned; regardless, I am getting the same result. Considering commands like New-MsolUser work as expected, the connection must be established properly and I seem to have the proper permissions. There must be something I'm missing.
The only thing that comes to mind is that the domain has not been completely configured "Setup in progress (domain verified)" because we have not transferred the MX records, but I can't imagine we are unable to prep the O365 environment prior to switching over officially.
New-MsolGroup works, but it creates a security group as opposed to a distribution group. Is there a flag that I can switch on a security group to convert it into a distribution group?