Running Exchange Powershell 2.0 Commands in VB.net app RRS feed

  • Question

  • How difficult would it be to run some Exchange Powershell commands (not scripts) to retrieve some data regarding a users mailbox. Looking at retrieving the current mailbox size, the storage limit quotas, Item Counts, Folder Counts, which data the mailbox resides.

    Is that even possible? We are running Exchange Server 2010 OnPrem but our Powershell version is 2.0. There was an issue upgrading to 3.0 but I cannot remember what it was offhand.

    My current code is using the below....

    Imports System.DirectoryServices
    Imports System.IO
    Imports System.DirectoryServices.AccountManagement
    Imports System.Text

          Using Root As New DirectoryEntry 'Establish connection to current loged on users Active Directory
                Using Searcher As New DirectorySearcher(Root) 'Start at the top



    Searcher.SearchScope = SearchScope.Subtree 'Start at the top and keep drilling down

    The app prompts for a UserId and stores it as USER

    Sunday, April 15, 2018 4:13 PM

All replies

  • Well I figure if Powershell can do that then you can run the commands in VB.Net. There is also a Windows PowerShell Forum that I don't believe is only scripts which may be able to assist you. But it may just be scripts.

    La vida loca

    Sunday, April 15, 2018 4:29 PM
  • Hi Doug,

    Since this forum is discussing and asking questions about the Visual Basic programming language, IDE, libraries, samples, and tools . And your issue is more related to Powershell. I suggest you to

    Request Script forum for professional help.


    Thank you for participating in the forum activities.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 16, 2018 7:13 AM