Avatar of awilderbeast
awilderbeast
Flag for United Kingdom of Great Britain and Northern Ireland asked on

ex 2010 sp1 powershell v2 Set-EWSOofSettings not recognised? setting Out of Office Via Shell

Hi all,

as the title suggests

im on exchange 2010 SP1 and am trying to set an out of office via shell (shell version 2) and the command Get-EWSOofSettings is not recognisezed and according to the blog where i found the command it should work on shell v2

http://www.mikepfeiffer.net/2010/07/manage-exchange-2007-out-of-office-oof-settings-with-powershell-and-the-ews-managed-api/
http://blogs.ezetraining.co.uk/Blog/GarethJones/Lists/Posts/Post.aspx?ID=21

anyone help me out?
Thanks
ExchangeShell ScriptingEmail Servers

Avatar of undefined
Last Comment
awilderbeast

8/22/2022 - Mon
the_endjinn

That will only work if you have the Exchange 2010 powershell snapin installed. It would probably work on your Exchange box but to run it elsewhere you need to install the Microsoft Exchange Server 2010 Management Tools.
the_endjinn

To see how to install the tools on the machine you are running PowerShell on see below.

http://technet.microsoft.com/en-us/library/bb232090.aspx
awilderbeast

ASKER
im running it on the exchange box :|

i thought i might of needed the exchange web api installed that on the exchange box and still no go :|
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
the_endjinn

Can you confirm that the Management Tools are installed?
Hamid Reza Molahadi

This code assumes the EWS Managed API assembly is located in c:\bin; update the path as needed for your machine. This function is designed to return information similar to the Get-MailboxAutoReplyConfiguration cmdlet in Exchange 2010, here is the code:

 
function Get-EWSOofSettings {
    [CmdletBinding()]
    param(
        [Parameter(Position=0, ValueFromPipelineByPropertyName=$true, Mandatory=$true)]
        [System.String]
        [Alias("Identity")]
        $PrimarySmtpAddress,
        [Parameter(Position=1, Mandatory=$false)]
        [System.String]
        $ver = "Exchange2007_SP1"
        )

Open in new window


Once you have the mailbox permissions worked out and have added the function to your PowerShell session, you can test out the code. The following example shows how you would run the function:

 
Get-EWSOofSettings -Identity David

Open in new window

the_endjinn

See the following for the correct way to get into the Exchange Management Shell

http://technet.microsoft.com/en-us/library/dd638134.aspx
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
ronnypot

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
awilderbeast

ASKER
ok i should of read that first article a bit more!
but i read the second one first and found the error in the first one but never read it, if you get me

anyway, how do i add the Get-EWSOofSettings function to my powershell session?

thanks
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
awilderbeast

ASKER
thanks