Solved

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

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Read this checklist to learn more about the 15 things you should never include in an email signature.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

679 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