Announcement

Collapse
No announcement yet.

Permissions for Setting Out of Office

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Permissions for Setting Out of Office

    Apart from full mailbox access... are there any other permissions that could be set for allowing support users to set out of office messages (without logging in to the mailbox manually).
    I have a little HTA that allows other admins to set out of office messages on mailboxes but it appears only to work if you have domain admin/full access to the mailbox - just wondering if there's a better way around it as I don't want a lot of domain admins around the place or really to apply full mailbox access to loads of support users...

    any ideas welcome - thanks
    This is my signature.

  • #2
    Re: Permissions for Setting Out of Office

    The out of office HTA app:

    Code:
    <head>
    <title>Out of Office Interface</title>
    <!--
      -- HTA Out of Office App
      -- 29th May 2009
      -- Script to set custom Out of Office Messages on mailboxes
      -- Must have access to mailbox
      -->
    <HTA:APPLICATION 
         APPLICATIONNAME="Out of Office Interface"
         BORDER="1"
         CAPTION="YES"
         MAXIMIZEBUTTON="NO"
         MINIMIZEBUTTON="YES"
         SCROLL="YES"
         SHOWINTASKBAR="YES"
         SINGLEINSTANCE="yes"
         SYSMENU="YES"
         WINDOWSTATE="NORMAL"
    >
    </head>
    <body STYLE="font:14pt arial; color:white;
     filter:progid:DXImageTransform.Microsoft.Gradient
    (GradientType=0, StartColorStr='#305090', EndColorStr='#80A0F3')">
    
    <script language="VBScript">
      '*** When Loading HTA Run this ***
      Sub Window_onLoad 
      intWidth = 800
      intHeight = 600
      Me.ResizeTo intWidth, intHeight
      Me.MoveTo ((Screen.Width / 2) - (intWidth / 2)),((Screen.Height / 2) - (intHeight / 2))
          'Detect Current Directory of Script
       Set objShell = CreateObject("WScript.Shell") 
       strCurrentDirectory = objShell.CurrentDirectory
          'Msgbox "Running from " & strCurrentDirectory
          'Check which account HTA is running under
       Set wshNetwork = CreateObject("WScript.Network")
      strComputer = wshNetwork.ComputerName
      strCurrentDomain = wshNetwork.UserDomain
      strCurrentUser = wshNetwork.UserName
        
        txt_username.Value = strCurrentUser
        txt_domain.Value = strCurrentDomain
        txtarea_outofofficemessage.Value = "I am currently out of the office with no access to e-mails." & VBNewLine & "If your message is of an urgent nature, please resend to [email] or alternatively call [phone]." & VBNewLine & VBNewLine & "Regards, " & VBNewLine & txt_username.Value
    'Change default out of office message to display above
        span_currentdirectorydetails.InnerHTML = "HTA running from: " & strCurrentDirectory
        span_currentuserdetails.InnerHTML = "HTA run by: " & strCurrentDomain & "\" & strCurrentUser & " on " & strComputer  
              
      End Sub
      '*** ***
     
    ' ---------------------------------------------------------------
    ' Exit HTA
    ' ---------------------------------------------------------------
     Sub Exit_HTA
      Window.Close
     End Sub
    
    ' ---------------------------------------------------------------
    ' HTA Sleep
    ' ---------------------------------------------------------------
     Sub HTASleep(intSeconds)
      Set objShell = CreateObject("WScript.Shell")
      objShell.Run "ping 127.0.0.1 -n " & intSeconds + 1, 0, True
     End Sub
    ' ---------------------------------------------------------------
    ' Results Text Area
    ' ---------------------------------------------------------------
     'Sub txtarea_results
      
     'End Sub
     
    
    ' ---------------------------------------------------------------
    ' Script Subs
    ' ---------------------------------------------------------------
    Function OOOSet()
    Set objMAPISession = CreateObject("MAPI.Session")
    strExchangeSvr = "exchange" 'enter exchange server here
    strMailbox = txt_username.Value
    strMAPI = strExchangeSvr & vbLf & strMailbox
    'On error Resume Next
    objMAPISession.Logon "", "", False, True, 0, False, strMAPI
    If err <> 0 Then
    Wscript.Echo "An Error occured: " & err.description
    Err.clear
    Wscript.Sleep 7000
    Wscript.Quit
    End If
    strOOOMessage = txtarea_outofofficemessage.Value
    objMAPISession.OutOfOfficeText = strOOOMessage
    objMAPISession.OutOfOffice = 1
    strOOOMessage = objMAPISession.OutOfOfficeText
    objMAPISession.Logoff
    Set objMAPISession = Nothing
    End Function
    
    Function OOOSetOff()
    Set objMAPISession = CreateObject("MAPI.Session")
    strExchangeSvr = "exchange" 'enter exchange server here
    strMailbox = txt_username.Value
    strMAPI = strExchangeSvr & vbLf & strMailbox
    'On error Resume Next
    objMAPISession.Logon "", "", False, True, 0, False, strMAPI
    If err <> 0 Then
    Wscript.Echo "An Error occured: " & err.description
    Err.clear
    Wscript.Sleep 7000
    Wscript.Quit
    End If
    
    objMAPISession.OutOfOffice = 0
    objMAPISession.Logoff
    Set objMAPISession = Nothing
    End Function
     
    Function OOORead()
    Set objMAPISession = CreateObject("MAPI.Session")
    strExchangeSvr = "exchange" 'enter the exchange server here
    strMailbox = txt_username.Value
    strMAPI = strExchangeSvr & vbLf & strMailbox
    'On error Resume Next
    objMAPISession.Logon "", "", False, True, 0, False, strMAPI
    If err <> 0 Then
    Wscript.Echo "An Error occured: " & err.description
    Err.clear
    Wscript.Sleep 7000
    Wscript.Quit
    End If
    txtarea_outofofficemessage.Value = objMAPISession.OutOfOfficeText
    objMAPISession.Logoff
    Set objMAPISession = Nothing
    End Function
    
    ' ---------------------------------------------------------------
    ' End Script Subs
    ' ---------------------------------------------------------------
     
    </script>
    <body>
    <p align=right><font size="2">
    Domain:<input type="text" id="txt_domain" name="txt_domain" size="50"><br>
    Username:<input type="text" id="txt_username" name="txt_username" size="50"><br>
    <br>
    <br></font></p>
    <p align=center>
    Out of Office Message:<br><textarea name="txtarea_outofofficemessage" id="txtarea_outofofficemessage" rows=8 cols=64></textarea><br>
    <button name="btn_oooset" id="btn_oooset" onClick="oooset">Set Out of Office On</button><br>
    <button name="btn_ooosetoff" id="btn_ooosetoff" onClick="ooosetoff">Set Out of Office Off</button><br>
    <button name="btn_oooread" id="btn_oooread" onClick="oooread">Read Current Out of Office</button><br>
    <br>
    <br>
    <button name="btn_exit" id="btn_exit" accessKey="x" onclick="vbs:Exit_HTA">E<u>x</u>it</button><br>
    <br>
    </p>
    <p><font size="1"><span id="span_currentdirectorydetails"> </span><br>
    <span id="span_currentuserdetails"> </span><br>
    Note:  Requires CDO.dll registering from MS Office 2003 if you are running MS Office 2007+.</font>
    </p>
    </body>

    This could easily be cleaned up in some places... but it works for us
    This is my signature.

    Comment

    Working...
    X