Link to home
Start Free TrialLog in
Avatar of Michael Leonard
Michael LeonardFlag for United States of America

asked on

need assistance with a powershell script

hello, can someone provide a way that I can add logic to this script to add in a list of room mailboxes from an input txt file.


here is the current script that works against a single room, we would like to add logic so that this runs against the list on an input txt file:

$internalmessage = get-content internalmessage.txt
$externalmessage = get-content externalmessage.txt

Set-MailboxAutoReplyConfiguration test-roombooking -AutoReplyState enabled -ExternalAudience all -InternalMessage "$internalmessage" -ExternalMessage "$externalmessage"

Open in new window


thx in advance.
ASKER CERTIFIED SOLUTION
Avatar of nashiooka
nashiooka

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 Michael Leonard

ASKER

hi nashiooka, thanks for the code suggestion, I tried the code you provided but the room mailboxes are not being updated. can you let me know if the variables need to be adjusted?  thx
Avatar of nashiooka
nashiooka

Are you getting an error?  How did you format the rooms.txt file?  You should have one room per line.  Also make sure your Internal & External message files are one long like, otherwise the vars will be array and the replace method won't be available.

Let me know.
hi Nashiooka,  its working now, the script was perfect, It was a mistake on my end.  thx again!
excellent, just what I was looking for.  thx