• Home
  • About
    • Disclaimer
  • Archives
  • Tools

Powershell: How to set “Out of the office” to a list of users.

Sep05
2015
Written by david

Here is a script for setting an Out of the office (OOO) message to a list of users.
Tested on Exchange 2010.

First, careat a CSV file (OOOUsers.csv) with all the users in one column and put it in c:\ooo\.
Than, create a *.ps1 file and copy the script into it.
Save it in C:\ooo\.

# Location of the users CSV file
$OOOUserList = get-content -Path c:\ooo\OOOUsers.csv
# Set OOO start time
$OOOStart = '08/20/2015 00:00:01'
# Set OOO end time
$OOOEnd = '08/25/2015 23:59:59'

# Set the OOO InternalMessage
$InternalMsg = "I'm OOO for now.....<BR> Thanks."
# Set the OOO ExternalMessage
$ExternalMsg =  "I'm OOO for now....<BR> Thanks."

foreach ($item in $OOOUserList){
	write-host Creating OOO for: $item
	Set-MailboxAutoReplyConfiguration -Identity $item -AutoReplyState Scheduled -StartTime $OOOStart -EndTime $OOOEnd  -InternalMessage $InternalMsg -ExternalMessage $ExternalMsg
}

Now run the script…

VN:F [1.9.20_1166]
please wait...
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: +1 (from 1 vote)
Posted in 2010, Exchange, PowerShell - Tagged exchange, Powershell, Script
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail
Similar posts
  • How to create e-mail address policy b... — I use this command to create a e-mail address policy base...
  • Export to CSV all your Exchange 2010-... — This Powershell command will export all SMTP Email addres...
  • Exchange 2010: View free (White) spac... — If you like to see the available space on you’r dat...
  • Renew/Install SSL certificate on Exc... — I found a great step by step guide written by Randy Chapm...
  • Exchange Server and Update Rollups Bu... — The following link is the Microsoft Wiki page that lists ...
« HmailServer – Basic SPAM Settings
» Fast way to enable Syslog server on fortigate

Categories

  • Command Line (11)
  • Exchange (8)
    • 2007 (4)
    • 2010 (5)
  • Fortigate (10)
  • FreeNAS (2)
  • HmailServer (1)
  • How To: (8)
  • MS SQL 2008 (4)
  • Networking (4)
  • Open Source (1)
  • PowerShell (2)
  • Recovery (1)
  • SBS (8)
    • SBS 2008 (6)
    • SBS 2011 (3)
  • Terminal Server (2)
  • Veeam (2)
  • VMware (6)
  • Windows (18)

Links

  • חי הדפסות – דפוס משי, חולון
  • שלישיה – זה לא מה שחשבתם

Archives

  • March 2018
  • January 2018
  • September 2015
  • January 2015
  • August 2014
  • May 2014
  • December 2013
  • January 2013
  • October 2012
  • September 2012
  • July 2012
  • June 2012
  • May 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
Site Meter

EvoLve theme by Theme4Press  •  Powered by WordPress How to do.....IT