Solved

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

Posted on 2012-03-27
2
1,432 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

615 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