Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. <identity impersonate="true" userName="domainusername" password="password" />
  2.  
  3. <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="SetOOF._Default" AspCompat="true"%>
  4.  
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6.  
  7. <html xmlns="http://www.w3.org/1999/xhtml" >
  8. <head runat="server">
  9. <title></title>
  10. </head>
  11. <body>
  12. <form id="form1" runat="server">
  13. <div>
  14. <p>
  15. Username
  16. <asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
  17. &nbsp;<asp:Button ID="btnGetUser" runat="server" Text="Select" />
  18. </p>
  19. <p>
  20. <asp:Label ID="lblUserName" runat="server"></asp:Label>
  21. </p>
  22. <p> <asp:CheckBox ID="chkOofEnabled" runat="server" /> Out of Office on/off
  23. </p>
  24.  
  25. </div>
  26. <p>
  27. <asp:TextBox ID="txtOofText" runat="server" Height="217px" Width="479px"
  28. TextMode="MultiLine"></asp:TextBox>
  29. </p>
  30. <p>
  31. <asp:Button ID="btnUpdateUser" runat="server" Text="Update User" />
  32. </p>
  33. </form>
  34. </body>
  35. </html>
  36.  
  37. Imports MAPI
  38. Partial Public Class _Default
  39. Inherits System.Web.UI.Page
  40.  
  41. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  42.  
  43. End Sub
  44.  
  45. Protected Sub btnGetUser_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnGetUser.Click
  46.  
  47. Dim ses As MAPI.Session
  48. ses = New MAPI.Session
  49. ses = CreateObject("MAPI.Session")
  50. ses.Logon(ShowDialog:=False, NoMail:=True, ProfileInfo:="mailserver" & vbLf & txtUsername.Text)
  51. Dim user As MAPI.AddressEntry = ses.CurrentUser
  52. lblUserName.Text = user.Name
  53. chkOofEnabled.Checked = ses.OutOfOffice
  54. txtOofText.Text = ses.OutOfOfficeText
  55. ses.Logoff()
  56. End Sub
  57.  
  58. Protected Sub btnUpdateUser_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdateUser.Click
  59. Dim ses As New MAPI.Session
  60. ses = CreateObject("MAPI.Session")
  61. ses.Logon(ShowDialog:=False, NoMail:=True, ProfileInfo:="mailserver" & vbLf & txtUsername.Text)
  62. ses.OutOfOffice = chkOofEnabled.Checked
  63. ses.OutOfOfficeText = txtOofText.Text
  64. ses.Logoff()
  65. End Sub
  66. End Class
  67.  
  68. Set-MailboxAutoReplyConfiguration -Identity tony -AutoReplyState Enabled -InternalMessage "Internal auto-reply message."
  69. -ExternalMessage "External auto-reply message."
  70.  
  71. Set-MailboxAutoReplyConfiguration -Identity tony -AutoReplyState Scheduled -StartTime "7/10/2015 08:00:00" -EndTime "7/15/2015 17:00:00" -InternalMessage "Internal auto-reply message"
  72.  
  73. Set-MailboxAutoReplyConfiguration -Identity tony -AutoReplyState Disabled
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement