Solved

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

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now