Solved

multiple parameters within powershell

Posted on 2013-02-06
3
366 Views
Last Modified: 2013-02-06
Hi im looking to set 2 parameters within this function. I have $setrecieveconnector  but also want to change the IP to a param. Whats the best way to go about it. Thanks

function setrecieveconnector {
param(
    [Parameter(Mandatory=$true)]
    $setrecieveconnector
set-ReceiveConnector -Name 'Default $setrecieveconnector' -Bindings '172.31.90.101:25'
}
0
Comment
Question by:cwstad2
[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
3 Comments
 
LVL 5

Accepted Solution

by:
coraxal earned 250 total points
ID: 38858774
You can try this:
 
function setrecieveconnector {
	param
	(
	[Parameter(Mandatory=$true,Position=0)]
	[string]
	$setrecieveconnector,
	[Parameter(Mandatory=$true,Position=1)]
	[string]
	$IPAddress
	)	
	set-ReceiveConnector -Name "Default $setrecieveconnector" -Bindings "$IPAddress:25"
}

Open in new window

0
 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 250 total points
ID: 38858778
Try..
function setrecieveconnector {
param(
    [Parameter(Mandatory=$true)]
    $setrecieveconnector,
    $ip
)
set-ReceiveConnector -Name "Default $($setrecieveconnector)" -Bindings "$($ip):25"
}

Open in new window

0
 
LVL 15

Author Closing Comment

by:cwstad2
ID: 38859091
thanks
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

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

A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
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.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
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…

729 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