Link to home
Start Free TrialLog in
Avatar of awilderbeast
awilderbeastFlag 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
Avatar of the_endjinn
the_endjinn
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
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
Avatar of 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 :|
Can you confirm that the Management Tools are installed?
Avatar of 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

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

http://technet.microsoft.com/en-us/library/dd638134.aspx
ASKER CERTIFIED SOLUTION
Avatar of ronnypot
ronnypot
Flag of Netherlands 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
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
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
thanks