Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <identity impersonate="true" userName="domainusername" password="password" />
- <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="SetOOF._Default" AspCompat="true"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <p>
- Username
- <asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
- <asp:Button ID="btnGetUser" runat="server" Text="Select" />
- </p>
- <p>
- <asp:Label ID="lblUserName" runat="server"></asp:Label>
- </p>
- <p> <asp:CheckBox ID="chkOofEnabled" runat="server" /> Out of Office on/off
- </p>
- </div>
- <p>
- <asp:TextBox ID="txtOofText" runat="server" Height="217px" Width="479px"
- TextMode="MultiLine"></asp:TextBox>
- </p>
- <p>
- <asp:Button ID="btnUpdateUser" runat="server" Text="Update User" />
- </p>
- </form>
- </body>
- </html>
- Imports MAPI
- Partial Public Class _Default
- Inherits System.Web.UI.Page
- Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- End Sub
- Protected Sub btnGetUser_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnGetUser.Click
- Dim ses As MAPI.Session
- ses = New MAPI.Session
- ses = CreateObject("MAPI.Session")
- ses.Logon(ShowDialog:=False, NoMail:=True, ProfileInfo:="mailserver" & vbLf & txtUsername.Text)
- Dim user As MAPI.AddressEntry = ses.CurrentUser
- lblUserName.Text = user.Name
- chkOofEnabled.Checked = ses.OutOfOffice
- txtOofText.Text = ses.OutOfOfficeText
- ses.Logoff()
- End Sub
- Protected Sub btnUpdateUser_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdateUser.Click
- Dim ses As New MAPI.Session
- ses = CreateObject("MAPI.Session")
- ses.Logon(ShowDialog:=False, NoMail:=True, ProfileInfo:="mailserver" & vbLf & txtUsername.Text)
- ses.OutOfOffice = chkOofEnabled.Checked
- ses.OutOfOfficeText = txtOofText.Text
- ses.Logoff()
- End Sub
- End Class
- Set-MailboxAutoReplyConfiguration -Identity tony -AutoReplyState Enabled -InternalMessage "Internal auto-reply message."
- -ExternalMessage "External auto-reply message."
- 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"
- Set-MailboxAutoReplyConfiguration -Identity tony -AutoReplyState Disabled
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement