header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Teminating selected Active sessions from IIS SMTP Server
Last Post 06 Jul 2010 03:43 AM by Navdeep. 7 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
NavdeepUser is Offline
New Member
New Member
Posts:57
Avatar

--
03 Jul 2010 06:23 PM
    Hi All,

    I am trying to achieve the following using powershell however so far i haven't got much success in doing what i am trying to do.

    Here is the scenario. We have a SMTP(part of IIS component) relay service running on Windows Server 2003.

    In inetmgr you can see active sessions, ServerName(LocalHost) > Default SMTP Virtual Server > Current Sessions.

    Now what i would like to do is the following.

    Teminate active sessions from all those IP address which are making more than n(5) number of connections.
        - first need to enumerate all the active sessions
        - then, need to find a way to group them, for example x.x.x.x is making 5 sessions and y.y.y.y
              making 2
            - then based on the criteria supplied for example Ip address making more than equal to 5
              sessions.
            - Terminate the sessions.

    Later I would like to make this as schedule job which will check for the active sessions and then terminate it, if citeria mets.



    Appreciate if someone can help me out here.

    Regards,
    v_2nas
    Marco Shaw (MVP)User is Offline
    Veteran Member
    Veteran Member
    Posts:1643
    Avatar

    --
    03 Jul 2010 07:20 PM
    I'm not aware of any API to work with the IIS SMTP server to be able to pull this information out and use it elsewhere like a script.
    Marco

    *Microsoft MVP - Windows PowerShell
    https://mvp.support.microsoft.com/profile/Marco.Shaw
    *Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
    *Blog - http://marcoshaw.blogspot.com
    PoSherLifeUser is Offline
    Basic Member
    Basic Member
    Posts:364
    Avatar

    --
    03 Jul 2010 08:05 PM
    IIS does have an API which allows you to pull metadata for several IIS functions, including SMTP:

    http://technet.microsoft.com/en-us/...51766.aspx

    I've never used it, so have fun learning!
    When at first you don't succeed Step-Into

    http://theposherlife.blogspot.com
    http://www.jandctravels.com

    Marco Shaw (MVP)User is Offline
    Veteran Member
    Veteran Member
    Posts:1643
    Avatar

    --
    03 Jul 2010 08:14 PM
    Yes, but I believe the API you linked to is for quasi-static configuration data, and does not provide dynamic data like what is being requested here.
    Marco

    *Microsoft MVP - Windows PowerShell
    https://mvp.support.microsoft.com/profile/Marco.Shaw
    *Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
    *Blog - http://marcoshaw.blogspot.com
    NavdeepUser is Offline
    New Member
    New Member
    Posts:57
    Avatar

    --
    03 Jul 2010 10:46 PM
    Hi All,

    Thx for responding. Is it possible to achieve using WMI.

    Regards
    v_2nas
    PoSherLifeUser is Offline
    Basic Member
    Basic Member
    Posts:364
    Avatar

    --
    04 Jul 2010 10:18 AM
    From what I can see of IIS 6.0 WMI & COM objects the SMTP classes are simple metadata and cannot be used to control sessions/users, but only the service.
    When at first you don't succeed Step-Into

    http://theposherlife.blogspot.com
    http://www.jandctravels.com

    Marco Shaw (MVP)User is Offline
    Veteran Member
    Veteran Member
    Posts:1643
    Avatar

    --
    04 Jul 2010 10:22 AM
    v_2nas,

    So we're clear... We don't think it is possible this way.

    Only way I can think of is to get lower to the TCP/IP level or even if you have a front end load balancer and/or firewalls, to implement your blocking logic there.

    (Or maybe another SMTP server app.)
    Marco

    *Microsoft MVP - Windows PowerShell
    https://mvp.support.microsoft.com/profile/Marco.Shaw
    *Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
    *Blog - http://marcoshaw.blogspot.com
    NavdeepUser is Offline
    New Member
    New Member
    Posts:57
    Avatar

    --
    06 Jul 2010 03:43 AM
    Hi All,

    Thanks a lot for your kind assistance.

    Regards,
    v_2nas
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer