Forum Replies Created
-
AuthorPosts
-
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?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?PowerShell123456789101112$File_Path = "C:\Temp\"$File_NotesDownload = $File_Path + "SecondaryMarketAllNotes.csv"$File_NotesEval = $File_Path + "SecNotesEval.txt"$r = [IO.File]::OpenText($File_NotesDownload)while ($r.Peek() -ge 0){$Note = $r.ReadLine()$NotesList += $Note}$NotesList | out-file $File_NotesEval$r.Dispose()Thanks Matt. Great tip
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 !!!!Thanks Sam.
Really appreciate the scriptDon, 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.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
HilHi 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
HilHi 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
HilThanks 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)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
Yes its XML.
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”:
PowerShell1$matches = Select-String -Pattern “policy_name” -Path C:\Temp\input.txtI 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
HilarioHere 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_memberMarch 9, 2017 at 3:30 pm in reply to: Exchange mail database on server not allowing connections #65992Yes 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 aboveThanks Daniel !!!!!
That was exactly what I was looking for. -
AuthorPosts