Hil

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 46 total)
  • Author
    Posts
  • in reply to: Powershell script for o365 Usuage report #100404
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Thanks Bryce.
    Yes I could use that command, although running it against 50K users would throttle my connection.
    The other option would be like using a REST API (https://msdn.microsoft.com/en-us/library/office/dn387058.aspx)
    Any experience in this area?

    in reply to: Make powershell script run faster #92323
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    I have another problem with the speed.
    As I add more lines to the $NotesList the script takes longer and longer. I believe .NET is duplicating the entire array in memory, adding the new item, and deleting the old copy in memory https://blogs.technet.microsoft.com/ashleymcglone/2017/07/12/slow-code-top-5-ways-to-make-your-powershell-scripts-run-faster/. Is there a way around it?

    in reply to: Make powershell script run faster #91892
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Thanks Matt. Great tip

    in reply to: Make powershell script run faster #91889
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Thanks Postanote,
    Your script worked great. Originally I believe I received about several minutes to maybe an hour.
    With your script I managed to get it down to 9- 12 seconds !!!!

    in reply to: Comparing Large files #89564
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Thanks Sam.
    Really appreciate the script

    in reply to: Comparing Large files #89540
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Don, Appreciate your Input, although the script above is working fine (even for the large files I am using).
    All I need is the new lines on the output file. Please see earlier post for details.

    in reply to: Global search on Exchange (Cloud Environment) #84361
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Jon, yes thanks that would work.
    Although when I tried that, it spun for a hour or so and then gave a controller failure (Throttled).
    I ended up calling up MS support and they mentioned that get-mailbox is being deprecated and for cloud usage the Compliance search needs to be used.
    They also mentioned that get-mailbox is throttled but Compliance search is not.
    Thanks
    Hil

    in reply to: Getting text content from window #81244
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Hi Postanote, Thanks for the details.
    I did try wasp but ran into problems installing it. Via powershell it says I am not running as administrator, when I actually am.. It shows in the PS window title.

    I tried importing the module , but that failed too. Is the current version of wasp working for you?
    or maybe I am doing something wrong.

    Thanks
    Hil

    in reply to: Getting text content from window #81236
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Hi Roman, Thanks for your message.
    When I run the UIAutomationSpy.exe , It is not able to get a handle to the text.

    Digressing a bit, I have seen when components of a webpage want to be hidden from being accessed directly, they place it into a frame (iframe). The way around uncovering the components of the webpage would be getting the iFrame link and then navigating to the iFrame link

    Similarly, i am thinking the components of this “Message Center” window are shielded inside some kind of frame as you will see in the screenshots. Could that be the reason why UIAutomationSpy is not able to see inside the window. Any way around it.. or accessing or calling the frame directly so that we can get a handle to the text?

    Code section:

    Script section:

    Thanks
    Hil

    in reply to: Getting text content from window #80927
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Thanks Rick. That is really great. I went though UIAutomation and did find a world of things I never knew.
    I am still going though it and no luck on my current project, but its good to know that UIAutomationSpy.exe can do the heavy lifting for you of writing the complex part of the script.
    Another cool tool is Inspect (https://msdn.microsoft.com/en-us/library/windows/desktop/dd318521(v=vs.85).aspx)

    in reply to: Getting text content from window #80606
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    postanote, Thanks for your comments.
    I am not looking for the title of the window. I already know that.
    I am looking for the TEXT in the window. With your command
    Get-Process | Where {$_.MainWindowTitle -like “*Message*”} | Format-Table MainWindowtitle -AutoSize
    ….here is what i get

    “Message Center [email protected] [build 1908.52]”
    This is only the title of the window. I need to extract the text from inside the window

    Is there a way I get powershell to do something similar to https://stackoverflow.com/questions/375117/screen-scraping-a-windows-application-in-c-sharp … maybe WM_GETTEXT

    in reply to: Search for string in a text file recursively #74563
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Yes its XML.

    in reply to: Search for string in a text file recursively #74542
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Thanks Don. I already tried $matches but it will not help in this case.
    I need to find “policy_name” and then get the corresponding “”.
    There are several “policy_names” and several “policy_member”s for the “policy_name”

    With this command it only gives me the “policy_name”:

    I could search for the string , but then I will not know the corresponding “policy_member”

    Thats the reason I need something like a while/for loop and get for the POSITION of the “policy_name” when I find it. Then use the POSITION to determine the start of the following “policy_member”

    Thanks
    Hilario

    Here is the input.txt file:

    policy_name Blacklist Senders/policy_name
    policy_member
    sender @3.org/sender>
    sender>@Atos.com/sender>
    sender>@Ms.1and1.com/sender>
    /policy_member
    policy_name Safelist Senders/policy_name
    policy_member
    sender>@engps.com/sender>
    sender>@sl.com/sender>
    sender>@cq.com/sender>
    /policy_member policy_name Blocked Recipients/policy_name
    policy_member
    receiver [email protected]/receiver
    receiver>[email protected]/receiver>
    receiver>[email protected]/receiver>
    /policy_member

    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Yes we do use SCOM and we did not get an alert.
    In any case I was looking for a alternative approach with a powershell command as referenced above

    in reply to: Getting the value of a variable #65223
    Hil
    Participant
    Topics: 34
    Replies: 46
    Points: 265
    Rank: Contributor

    Thanks Daniel !!!!!
    That was exactly what I was looking for.

Viewing 15 posts - 31 through 45 (of 46 total)