Exchange ActiveSync - how to get latest emails in inbox? - email

I have figured out how to get all items in the inbox, but I want to get them in order of newest first. For example I want to get the most recent 999 emails.
I can get the emails from the past 3 weeks (see below FilterType=3) but I want to limit it based on number of emails rather than date.
Here is the XBML command I am calling:
<AirSync:Sync>
<AirSync:Collections>
<AirSync:Collection>
<AirSync:SyncKey>
788321929
</AirSync:SyncKey>
<AirSync:CollectionId>
6
</AirSync:CollectionId>
<AirSync:GetChanges/>
<AirSync:Options>
<AirSync:FilterType>
3
</AirSync:FilterType>
</AirSync:Options>
</AirSync:Collection>
</AirSync:Collections>
</AirSync:Sync>

Related

Is there any way to export the contents of my Teams Chats for one day, by chat and time?

Is there any way to get and list out all my conversations in teams chats for one day? When I'm logging time, I lose track of what I worked on when I'm helping others, and the find function just gives me 8 messages on a big screen, which means I have to scroll through dozens of screens to get the "oh, this is what we're doing". I'd rather have a list with the chat name, time, and what was said. Powershell, CLI, KQL, don't care how. Thanks.
John Doe Chat: Doe, John [10:35] what is this about
John Doe Chat: Me, Myself [10:36] trying to come up with an example
PeopleChatOne: Joe [10:37] what are we, chopped liver?
Okay, after digging for a bit... turns out the answer is, as #sayali-msft and #anothervictimofthemouse mentioned, is the Graph API - which has a module. Note that you DO have a certain amount of access to your own stuff without needing an admins help, but you will have to explicitly grant it to each "application" that will connect to it. And there's a good amount of playing you can do with the Graph Explorer.
The below code will grab all of your chats, then grab the most recent 200 messages, filtered for the past day, and then will return the pertinent info.
Still missing at this point:
time zones seem wonky, specifically people in other time zones.
piping to OGV gives you all lines, when I really only want the first.
Fortunately, format-table DOES limit to one line per message
stripping out HTML works but is not great.
members may not be working.
Install-Module Microsoft.Graph
Import-Module Microsoft.Graph.Teams
$RequiredScopes = #("Chat.ReadBasic", "Chat.ReadWrite")
Connect-MgGraph -Scopes $RequiredScopes
#at this point a browser window should appear - allow it.
#I had to find my user id in graph explorer UI by running GET V1.0 https://graph.microsoft.com/v1.0/me
#unsure how to get it otherwise - but you don't need it with get-mgchat
get-mgchat
#take one of those IDs
#let's look at this chat:
get-mgchat -ChatId 19:deadbeefb2d949d88d4455f5279e5d8b#thread.v2
get-mgchatmessage -ChatId 19:deadbeefb2d949d88d4455f5279e5d8b#thread.v2
#this nests and walks through properly, strips HTML, but lord this will be slow. And shows more than one line per message, even when I try now to.
#By default you can get all your chats by running get-mgchat. -all and -pagesize 50 is required for the module to paginate the request and get you everything. But in my case it grabbed all 2000 chats. The -first 5 is for testing.
$tzone = Get-TimeZone # conversion from GMT to local time. https://jdhitsolutions.com/blog/powershell/7962/convert-to-local-time-with-powershell/
$mychats = get-mgchat -all -PageSize 50 |select -first 5
$all_chat_info = #() #force-setting to an array
$all_chat_info = foreach ($chat in $mychats) {
$chatinfo = get-mgchat -ChatId $chat.id #get base details about the CHAT itself
#set some details about the chat itself for the later query
$chatname = $chat.Topic
$members = $chat.Members
$chattype = $chat.chattype
#now get every message from that chat since midnight yesterday. Note LastModifiedDateTime is GMT. The jdhit page says -($tzone...), but all I had to do was .tolocaltime() ... I think.
#the -top 200 -pagesize 50 is to get the most recent 200 messages, and again you have to paginate.
$recentchatmessages = get-mgchatmessage -ChatId $chat.id -top 200 -pagesize 50 |where {$_.LastModifiedDateTime.tolocaltime() -gt (get-date).date.AddDays(-1)} # all from after midnight yesterday |select -first 5
#and now use select expression to add the above fields and parse the below fields, stripping out HTML (but I can't seem to only get the first line in OGV)
$recentchatmessages | select #{Label='LastModified';Expression={($_.LastModifiedDateTime.tolocaltime())}}, #{Label='ChatName';Expression={($chatname)}}, #{Label='members';Expression={($members)}}, #{Label='ChatType';Expression={($chattype)}},
#{Label='From';Expression={($_.from.user.displayname)}}, #{Label='Body';Expression={ ($_.Body.content -split '\n')[0] -replace '<[^>]+>',''}}
##{Label='From';Expression={($_.from.user.displayname)}}, #{Label='Body';Expression={( ($_.Body.content -replace '<[^>]+>','').split([Environment]::NewLine)|select -first 1)}}
}
$all_chat_info|format-table
#and now close/disconnect
Disconnect-MgGraph
Several problems present themselves:
All and PageSize appear broken (update: use "-all -pagesize 50")
Expanding the fields. Probably trivial for others, but a pain for me.
currently comes back like
Microsoft.Graph.PowerShell.Models.MicrosoftGraphItemBody
Microsoft.Graph.PowerShell.Models.MicrosoftGraphChatMessageFromIdentitySet
Some references I found while getting it working.
https://practical365.com/connect-microsoft-graph-powershell-sdk/ - getting the scope set
graph explorer
https://www.powershellgallery.com/packages/Microsoft.Graph/1.9.2
https://github.com/microsoftgraph/msgraph-sdk-powershell - the github for the actual modules. the readme is gold specifically https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/samples/5-Teams.ps1

-SearchQuery not deleting all items

According to my powershell code shown, it should delete all items between 90 days ago and yesterday. For example if I ran this now the date range would be 1/29/2014 - 4/28/2014.
$x = ((get-date).addDays(-90)).ToShortDateString()
$y = ((get-date).addDays(-1)).ToShortDateString()
$xy = "$($x)..$($y)"
Search-Mailbox bunnyb2 -SearchQuery "Received:$xy" -DeleteContent -Force
This is deleting most of the mail it is supposed to. However the mailbox still retains all deleted email up until ((get-date).addDays(-1)) at 7pm. The last 5 hours of email that should be deleted are not.
At first I thought it could be a time conversion issue however the machine I am running the command on is in Central Time USA, and the mailbox server is also Central Time USA.
Also, please do not tell me to do "Search-Mailbox whismj-SearchQuery "Received:<$y" -DeleteContent -Force". This is a whole other can of worms for me. While the code execute absolutely nothing is returned or deleted. However when I take off the < all email that was received yesterday is deleted.
I realize this is an older post, but maybe this will help someone searching.
In order to hit the whole date range, you need to provide multiple options to the -SearchQuery parameter (which is expecting a full AQS query). I've never had luck using the syntax you're using, even though it's listed in the documentation; adding the explicit time seems work when using two Received blocks instead of trying to combine them.
To get all mail in January 2015, try using the following:
-SearchQuery "Received: > $('01/01/2015 00:00:00') AND Received: < $('01/31/2015 23:59:59')

Android-AppWarp Unity SDK: BAD_REQUEST/CONNECTION_ERROR when calling WarpClient.GetInstance().Connect()

I'm running into the issues since today. The way I was keeping the user name unique was creating it as ${FACEBOOK_FIRST_NAME}_${FACEBOOK_ID} and WarpClient.GetInstance().Connect(${FACEBOOK_FIRST_NAME}_${FACEBOOK_ID}) worked just fine till now.
Today it stopped working, and after trial and error it seems that the username length is limited to 21 characters now. 22 characters user name causes CONNECTION_ERROR, 23 and more - BAD_REQUEST.
Is it a new restriction introduced, and if it is, what is the best way to maintain unique but readable user names based on users FB credentials?
10x
There are restrictions on the username string.
The length should be less than 25 and the following characters are not allowed
, ; \ /
See the API reference.
http://appwarp.shephertz.com/game-development-center/csharp-api-reference/#connect
Hope it helps.

joomla chronoform saving data

I have a problem with chronoform.
I created my form and everything. but when people input data, sometimes it doesn't get saved, sometimes the data look strange (encrypted?), but when it's me trying the form, it always works!
here an example of the strange data:
REGISTRATION DATE 2011-02-24 - 08:24:14
NAME xjvcZiqVZOf
SURNAME mbYCUldaGCfE
CHARGE CDOWWXMGA
CARD FdaYQzKjvJRjDdHiN
PHONE fUCjEIKBOQgBdtRUcdS
EMAIL qwrelb#gzblvr.com
HOW DID YOU GET TO KNOW THE LABMOND? w2yCfW iuykmqzzrasu,[url=http://stxpmgksgwqu.com/]stxpmgksgwqu[/url], [link=http://qdchzokvtmyk.com/]qdchzokvtmyk[/link], http://fxbqxghstmyn.com/
LABMOND LEVEL 2° Livello
LOCAL OFFICE Campobasso
Any idea?
Turn on the built in captch or ReCaptcha, I bet these submissions are bots.

Cakephp Account Activation Email - Address Not Found On Server

For our website, we set up the account activation email with the following tutorial (in cakephp):
http://www.jonnyreeves.co.uk/2008/06/cakephp-activating-user-account-via-email/
On our live site, it seems that the activation works for the most part, however some people are receiving the following error when clicking on the activation email link to activate their account:
Error: The requested address '/users/activate/36/10a1a794' was not found on this server.
This is odd to me because the link looks fine: "users" controller, "activate" action, user_id = 36, and hash code = 0a1a794. Not sure why this error is happening. One thing I read is to clear the files in the cache folder and that didn't seem to change anything. Please help thanks!
The activation hash has limited validity(same day).
So if send the activation email on 1st of any month, it will be valid till 11:59pm of 1st. The link wont work after 12:00am(technically 2nd of the month).
Hope that helps.
Yes, that's what Josh R said, the hash is computed for the same day and this is a VERY bad idea.
You should either stop hashing the date or validate against two values: one for today's date, one for yesterday's date.
Also, a recommendation: don't just go there and copy the files, try to learn something from it and please, do it your way. You'll learn a lot more.