How to: Get a list of mail users by using the Exchange Management Shell

Hello every one, quick question: When I run this code below for VB, how will I see the results of the program? Is there anyway I can make the results appear in a message box?
Function GetUsersUsingBasicAuth( _
    ByVal LiveIDConnectionUri
As String, ByVal ScehmaUri
As String, _
    ByVal Credentials
As PSCredential, ByVal
Count As Integer)
As Collection(Of PSObject)
    Dim ConnectionInfo
As WSManConnectionInfo = _
        New WSManConnectionInfo(New Uri(LiveIDConnectionUri), ScehmaUri, Credentials)
    ConnectionInfo.AuthenticationMechanism = AuthenticationMechanism.Basic
    Dim RemoteRunspace
As Runspace
    RemoteRunspace = RunspaceFactory.CreateRunspace(ConnectionInfo)
    Return GetUserInformation(Count, RemoteRunspace)
  End Function
Function GetUserInformation(ByVal
Count As
Integer, ByVal RemoteRunspace
As Runspace) As Collection(Of PSObject)
    Dim RemotePowerShell
As PowerShell = PowerShell.Create
    RemotePowerShell.AddCommand("Get-Users")
    RemotePowerShell.AddParameter("ResultSize",
Count)
    ' Open the remote runspace on the server.
    RemoteRunspace.Open()
    ' Associate the runspace with the Exchange Management Shell.
    RemotePowerShell.Runspace = RemoteRunspace
    ' Invoke the Exchange Management Shell to run the command.
    Return RemotePowerShell.Invoke
End Function

All you need to do is enumerate through the Collection returned eg
Dim commandResults As Collection(Of PSObject)
commandResults = RemotePowerShell.Invoke()
For Each obj As PSObject In commandResults
MessageBox.Show(obj.Properties("DisplayName").Value.ToString())
Next
Cheers
Glen

Similar Messages

  • I have lost sound on my iPad in apps unless I use headphones ,does anyone know how to get sound back without them .I have used the mute volume on the bar at bottom of screen and the slider volume control there only shows when headphones are plugged in !

    I have lost sound on my iPad in apps unless I use headphones ,does anyone know how to get sound back without them .I have used the mute volume on the bar at bottom of screen and the slider volume control there only shows when headphones are plugged in !
    I also tried resetting settings all to no avail ...I looked up some advice and watched utube video advice on how to fix without success..
    The volume control button on side does not work ,I got the iPad last August and wonder if it is a fault that means I must return it for replacement from where it was purchased ?

    The Retrospect you used way back when is no longer around. The company was sold and that company produced a new version of Retrospect - Retrospect 8.x
    So, as you've been told, you would have to be running a Tiger system with an old version of Retrospect software (5.x or 6.x - you would need to know) assuming you can find the software.
    As best I can remember you cannot extract files from a Retrospect backup except using the software since Retrospect did not normally make a file by file backup rather it created an archive of the files in the backup. I'm assuming that the EMC/Retrospect people have told you that old Retrospect backups are not accessible by Retrospect 8.x?

  • How do I force Acrobat 11 Professional users to use the "save as" verses "save"?

    How do I force Acrobat 11 Professional users to use the "save as" verses "save"?  I want the users to type in a fillable form, but not save their edits on the original form.  I want them to be able to save with a different file name.

    You can't really force it, but you can encourage it... For example, you can set the file as read-only and add an instruction to do so before the file is saved using a script.

  • How to get a list of Local Users who has not logged in for 3 months or around 90 days

    hi
    i found this thread to pull out a list of local users
    Retrieve all local user accounts information on remote computers (PowerShell)
    however, i need to filter out users who has not logged in for 3 months or around 90 days, how can i do further filtering?
    i understand dsquery has an -inactive <xweeks> , however i am doing it for local accounts

    $ErrorActionPreference = "silentlycontinue"
    $([ADSI]"WinNT://$env:COMPUTERNAME").Children | where {$_.SchemaClassName -eq 'user' -and $_.lastLogin -gt (Get-Date).AddDays(-90)} | ft name,lastlogin
    using the sample from the link extendend with the 90 days criteria, the erroraction preference surpresses the errors you get for accounts with no lastlogon value (guest being a typical one)

  • How to get a list of current users and their transactions code?

    SM04 and AL08 give the list, but its not comprehensive.  in sm04, we have to click the username and select sessions and then a
    new popup comes giving all transactions for the user. 
    I want a list such that each and every transaction corresponding to the user is listed at same time.

    Hi,
    Use the FM TH_LONG_USR_INFO.
    Just give parameter user as * (it means all users, other wise current user)
    It will give ALL transactions for ALL users.
    Regards,
    Amit Mittal.
    Edited by: Amit Mittal on Dec 30, 2009 1:00 PM
    Edited by: Amit Mittal on Dec 30, 2009 1:03 PM

  • Instant Messaging: How to get a list of online users?

    Hi,
    Is there any way to get presence information of any users? I don't want to subscribe to all users presence. In the documentation I found that presence information is public in default. Using the Shell example client I got null for 'fp uid', it works on users in my contact list.
    I tried an other way using com.sun.im.provider.* interfaces but sample programs doesn't works well on server.
    Regards,
    Szocskekutya

    SzocskeKutya wrote:
    Is there any way to get presence information of any users? I don't want to subscribe to all users presence.There is no way to get presence information without subscribing.
    I've created a new enhancement request to add this functionality in a future release:
    RFE#6966768 - "Provide utility to list active user connections and presence information"
    If this is essential functionality for your deployment then you need to escalate this RFE with your Sun/Oracle account manager so the feature can be prioritised as appropriate.
    Regards,
    Shane.

  • How to get a list of online users?

    hi,
    I don't what to do,every user has a session,
    so if I can check every session to see if the user is online?

    Since you cannot access other sessions besides the current one, you will need to store the current users somewhere other than the session. Here is an option.
    public class User implements HttpSessionBindingListener
       private String userid ;
       private MyServlet servlet ;
       public User(Stirng userid, MyServlet servlet)
            this.userid = userid;
            this.servlet = servlet ;
       //assume standard accessor methods.
       public void valueBound(HttpSessionBindingEvent ev)
         getServlet().currentUsers.addElement( getUserID() );
       public void valueUnBound(HttpSessionBindingEvent ev)
         for(int i = 0; i < getServlet().currentUsers.size(); i++)
             if( ((User)getServlet().currentUsers.elementAti)).getUserID().equals( getUserID() ) )
                  getServlet().currentUsers.remove(i);
                  break ;
    public class MyServlet extends HttpServlet
        public Vector currentUsers ;
    }Then, you can access the servlets currentUsers vector for a list of current users. Readup on HttpSessions and the HttpSessionBindingListener classes.
    You will put the person's information in a Bean and then store it in the session when they logon/return/etc. The Listener handles the rest.

  • How to get a Sum of rows, when i use the property max. rows p. page ?

    Hi all.
    I've got a query and get a lot of rows (amounts) back.
    Now i want to have max. 21 rows per page.
    So, first i used the property "max. rows p. page"=21.
    But i want a have Sum-Field p.page too, which shows the sum of the amount p. page at a >fixed place (bottom, left) at the page.
    this didnt work well....
    Because when i have 30 rows, then the sum will shown at the second page (because the sum-field its after the repeating frame).
    ...Now i forgot the property and placed a function and two placeholder in the query like this:
    Function:
    :cp_row:=:cp_row +1;
    if (mod (:cp_row,21)=0)) then :CP_pagenr:=:CP_pagenr+1;
    Placeholders: cp_row, cp_pagenr
    Now i want to use :CP_pagenr to change the group - but Report Builder says: I cant... because placeholder are not allowed to change a group.
    So.. perhaps anyone can give me a hint how i can do this ?
    Thanks a lot...

    hello.
    that sound to me as you wanted a running total. check out the metalink knwoledge base and search for running total and you will find a note on how to do that.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need to get a listing of all users and their corresponding Exchange 2013 Mailbox Quotas using Powershell

    I will be changing the default quota on mailboxes soon, but there are a number of others who have "customized" quotas and I will need to identify them also.
    Charlie

    The following powershell command can get you the mailboxes that are using "custum "quota:
    Get-Mailbox -Resultsize unlimited | where-object {$_.UseDatabaseQuotaDefaults -eq $false}

  • Using Mail Transport Rules and the Exchange AWS API

    I am looking to programmatically Enable and Disable hub transport rules from VS.NET and was hoping these functions would be available via the REST API. However, I can't find any references, which indicates that perhaps they don't exist. 
    The rules I want to access can be used from PowerShell "Enable-TransportRule" and "Disable-TransportRule" and I can use them fine from Powershell.
    So, my first question is, are these rules available from the Exchange EWS API? They need to be triggered when users perform certain events within the application.
    If not, I am guessing I will be able to automate these cmdlets into a C# application or ASP.NET/C# application. Is this a correct assumption?
    Thanks.
    Jonathan.

    No you can't set Transport rules from EWS, EWS is a mailbox access API and setting Transport Rule would be considered an Administrative Task so you need to use and Admin API which for Exchange is still the Exchange Management Shell. You can automate
    the EMS cmdlet with Managed code (eg you could front end them with your own rest service) using Remote Powershell the best place to start would be
    http://msdn.microsoft.com/en-us/library/office/jj943721(v=exchg.150).aspx
    Cheers
    Glen

  • How can I get a list of active users on an AS Java platform on a cluster?

    Hello Experts,
    I have an AS Java NetWeaver CE v7.1 EhP1 SP3 system and it's running in a cluster.  Do you know how I can get a list of all users that are currently logged in or whom have active sessions on each application server instance?
    Thanks,
    Sam

    > I don't know how to get classes used by VA for this tab.
    I wouldn't make any development investments based on classes for the VA anymore...
    Considering that not only Salvatore himself, but also the JControl might decide for itself that the system needs a hard shutdown and restart.. a possibly better solution would be to use a redirect. If the message server does does not respond or does not find any DIs or not the one which your previous session state was for, then redirect to a page with a meaningfulll message (and apology on it.
    Just a thought,
    Cheers,
    Julius

  • How can i get the list of all users present in the LDAP

    Hi Experts,
    How can i get the list of all users present in the LDAP ?
    Is there any API or function Code to get all user list??
    Please help me out!!!
    Help will be rewarded

    Well it will depend on exactly where your UME configuration points to in the LDAP tree but yes, it is possible to get all users.  Something like the following should do it:
    import com.sap.security.api.*;
    import com.sapportals.portal.prt.component.*;
    IUserFactory iuf;
    ISearchResult isr;
    IUser user
    String userid;
    iuf = UMFactory.getUserFactory();
    isr = iuf.getUniqueIDs();
    you will need to iterate the ISearchResult object but you can get IUser objects by
    userid = (String)isr.next();
    user = iuf.getUser(userid);
    then you can imanipulate / identify / or whatever you need with the user object
    Haydn

  • How can i get the list of all users present in the UME ?

    Hi Experts,
    How can i get the list of all users present in the UME ?
    Is there any API or function Code to get all user list??
    Please help me out!!!
    Help will be rewarded
    -pankaj chouhan

    Hi Pankaj,
    find the official NetWeaver security javadocs (including access to UME) <a href="http://help.sap.com/javadocs/NW04S/current/se/index.html">here</a>. Look for classs UMFactory and proceed from there.
    Best regards,
    Martin

  • How to get a List of Users Currently Logged into the portal

    Hi,
    Im trying to get the list of all users logged into the portal to do a web service, but I can't find the way to do this, is there any way to find this info thrugh a java class or some object in the RCU/schema/WCP database?
    Greetings
    Mike

    Try the analytics tables. Before you can use them, you need to setup the analytics server and configure it for your application:
    http://docs.oracle.com/cd/E23943_01/webcenter.1111/e12405/wcadm_analytics.htm#BEIDBHHG
    This gives an overview for building reports: http://docs.oracle.com/cd/E23943_01/webcenter.1111/e10148/jpsdg_analytics.htm#BABFDGEG
    Login metrics: http://docs.oracle.com/cd/E23943_01/webcenter.1111/e10148/jpsdg_analytics.htm#BABFFHGD
    You can use these queries to get the info you want.
    Edited by: Yannick Ongena on Oct 8, 2012 8:00 AM

  • How to get a list of every application on my computer?

    I'm trying to figure out how to get a list of every application on my computer using applescript. I know it is possible for the system to do this, as evidenced by the dialog you get when you use the "choose application" function. Other examples are doing a spotlight search for "kind:app" or programs like Namely or QuickSilver.
    Is there a way to do this in applescript? The only solution I've come up with so far is to use the command:
    <pre>set everyapplicationaliases to choose application as alias with multiple selections allowed</pre>
    and manually select all on the resulting dialog. I can then take the results and go from there, however there are a few significant problems with this approach.
    1. It requires user interaction. (I have an idea for some future applications that could use this functionality if it can be done without user input.)
    2. It's horribly slow. As a test run I choose all the applications from the dialog, extracted some basic info and put the result on the clipboard. It took a couple of minutes to complete this relatively basic task. In comparison, running the aforementioned spotlight search took maybe ten seconds.
    Thanks in advance!
    best,
    peter

    For these specific queries my results are...
    set appList to paragraphs of (do shell script "mdfind \"(kMDItemKind = 'application'c) || (kMDItemKind = 'widget'c)\"")
    3082
    set appList to paragraphs of (do shell script "mdfind \"(kMDItemKind = 'Application'c) || (kMDItemKind = 'Widget'c) ||
    ((kMDItemContentTypeTree = 'com.apple.application') && (kMDItemContentType != com.apple.mail.emlx) && (kMDItemContentType != public.vcard))\"")
    3115
    I think I finally found some numbers that make sense!
    When I search for Kind:Application by the Command+F method in the Finder, I get a total of 2521 items, of which 2477 are "Applications" and 44 are "Other".
    (Just by eyeballing it, "Other" seems to include some Classic Apps and some .bundle files.)
    The total # found by this method (2521) plus the number of Widgets found using mdfind (318) equals the number of total number of items found by spotlight (2839).
    I also noticed that these numbers almost equal the spotlight number:
    mdfind results for kMDItemKind:
    Widgets: 318
    Applications: 1684
    Classic*: 795
    and
    Command+F "Other" items: 44
    3181684+79544 = 2841
    It may be a fluke that this is so close to the 2839 spotlight gives, or maybe there's an overlap somewhere...
    Tying this back into my initial question, it seems like the original mdfind command for Applications is probably the best answer for what I was looking for,
    since I wasn't really thinking about Classic apps and Widgets anyway.

Maybe you are looking for

  • UNION ALL slow (cost goes from 75 and 173 to 450,789!)

    Hi, I have two Selects (lots of joins - big tables) Select A) has an explain plan cost of 75 Select B) has an explain plan cost of 173 If I union (or union all) the cost goes up to 450,789! I can paste in the queries, plans etc - but if anyone has an

  • Adobe Aftereffects crashing at random intervals

    Hi, My colleuges Adobe CS4 Aftereffects is crashing at random intervals while using the program. I need to end multiple instances of aftereffect.exe and also the cs4 application before I can reload the program and carry on working with it. Any sugges

  • Getting trace file names for a conc program

    Hi All, We are using Oracle EBS 11i with Oracle 9i database. The Apps version is 11.5.9 and database version is Release 9.2.0.6.0. I am trying to trace a custom program which runs the pl/sql procedure. I have enabled the tracing in the custom program

  • Refreshing Word Reports after changes made in Publisher.

    I am runing the word to publisher to bi answers chain. I made a change to the reports in bi answers by adding a column. The new column does not show up as a selection in Word Insert>Field Menu. When I view the publisher Xml of the report the columns

  • How do I stop Photoshop CS6 from asking to save changes to a file when closing the file, after "savi

    I save a lot of files to "save for web". After saving PS asks if I want to save changes to the original file. I never want to save the changes to the original. Since the default is to change the file I am afraid I will accidentally OK the change with