Link to home
Start Free TrialLog in
Avatar of Ron Shorts
Ron ShortsFlag for United States of America

asked on

Powershell pass parameter help

Powershell Script to pass parameter, accept input.

I'm trying to build a script that I can pass a parameter to make a remote mailbox.

Using the below take "testuser1" to pass the parameter outside of this script.

Enable-RemoteMailbox "testuser1@microsoft.com" -RemoteRoutingAddress testuser1@company.mail.onmicrosoft.com

Then after this, have something that will validate the smtp address.

Can any help with this?

Thanks!
SOLUTION
Avatar of Vasil Michev (MVP)
Vasil Michev (MVP)
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ron Shorts

ASKER

Thanks Vasil, much appreciated.  What I have below is working in creating the mb, are you saying in the same code check the "@" sign or use what you listed above?  Can you list an example please?

Also, when provisioning a mailbox, I have a hybrid env. so I need to license after the remote mailbox is created, which takes up to 30 minutes sometimes by adding to a group... is there anyway to include this in one code, or how do you get around this in a hybrid environment, any suggestions?

param
(
  $mailbox
)
Enable-RemoteMailbox $mailbox@microsoft.com -RemoteRoutingAddress "$mailbox@company.mail.onmicrosoft.com"

Open in new window

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial