Solved

Remote Powershell - Microsoft.Exchange.Management.PowerShell.E2010?

Posted on 2012-03-27
2
1,427 Views
Last Modified: 2012-06-27
Hey

When connecting remote to our Exchange server using Powershell - I get the following error: (New-Mailbox)


New-PSSession myex01

 Id Name            ComputerName    State    ConfigurationName     Availability
 -- ----            ------------    -----    -----------------     ------------
  1 Session1        myex01          Opened   Microsoft.PowerShell     Available

Enter-PSSession 1
[myex01]: PS C:\> Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010

[myex01]: PS C:\> New-Mailbox xxx4 -shared -UserPrincipalName xxx4@mydomain.local

Value cannot be null.
Parameter name: parameters
    + CategoryInfo          :
    + FullyQualifiedErrorId : System.ArgumentNullException,Microsoft.Exchange.
   Management.RecipientTasks.NewMailbox

Why?
0
Comment
Question by:mikeydk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Assisted Solution

by:chrismerritt
chrismerritt earned 150 total points
ID: 37779095
Hmm, not sure why you are creating a remote powershell session and then importing the exchange 2010 snapin as well?

If I want to get around the stupid concurrent pipeline error I sometimes get with remote powershell I then import the snapin to windows powershell and that then works for me.

I assume you've checked the values tab in OK? If you run just New-Mailbox and don't enter anything else does it ask you for the values to be entered?

PowerShell with Exchange 2010 supports remote commands anyway, this is a fairly typical remote exchange powershell setup I use:

#Function to dynamically open sessions to E14 Servers
Function Open-Session
{
	$ServerList = "Server1.FQDN", "Server2.FQDN", "Server3.FQDN"
	
	for ($i = 0 ; $i -lt $ServerList.Count ; $i++)
	{
		$ConnectionURI = "http://" + $ServerList[$i] + "/powershell/?SerializationLevel=Full"
		
		write-host $ConnectionURI
		
		$Session = New-PSSession -ConfigurationName Microsoft.Exchange –ConnectionUri $ConnectionURI –Authentication Kerberos
		Import-PSSession $Session
		
		if ($Session)
		{
			write-host "Session Established"
			return $Session
		}
	}

}

#Connect to Exchange 2010 with Remote Powershell
$Session = Open-Session

##### Run Commands Here #####

#Cleanup Session
[string]$SessionID = $Session | % {$_.InstanceId.guid}
$SessionID = $SessionID.Trim()

Remove-PSSession -InstanceID $SessionID

Remove-Variable -Name "SessionID"

Open in new window

0
 
LVL 13

Accepted Solution

by:
lciprianionut earned 350 total points
ID: 37787098
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question