Using Exchange GetAddressEntryFromID method with LDAP msExchMailboxGuid - outlook

Outlook COM has a method under Application.Session.GetAddressEntryFromID method to grab an address entry without having to iterate through the entire Global or All Users address book.
The issue is it is expecting the ID that an entry has under the AddressLists object.
In Active Directory, there is no equivalent that gives me the same GetAddressEntryFromId string.
I was previously making a list of all users, minus rooms and resources, by going through the entire COM object, but that takes too long; 20mins.
I figured if I use AD, which is faster, with filters to find the users, then I can grab the GUID and when looking for info on the user, not have to go through the entire COM object to grab it, but it will happen locally to the executable being run.
The issue I am having, as an example, is that I have a user with the following ID;
00000000DCA740C8C042101AB4B908002B2FE18201000000000000002F6F3D45766572657374205265696E737572616E63652F6F753D436F72702D48512F636E3D526563697069656E74732F636E3D6A6E6700
In AD the msExchMailboxGuid has a value of
{4A49BD1C-62AE-4674-B097-C06528BDBEAE}
Not sure if these are the same, but I need to learn to better save it.
What else can I use, what can I do with the current time?

GAL entry id is constructed from the EX address (which is stored in the legacyDN attribute).
The entry id you have above contains the following:

Related

Google Drive API Folder/Child ID

Does anyone knows if the google folder id changes over time? Assuming, obviously, the folder is not deleted and recreated.
I'm trying to be limit the quota usage as much as possible, by storing the ID on our side.
Thanks
UPDATE (2015/09/01) Per 'BSEs' comment below.
Sorry, I assumed it is Android (being professionally distorted).
Anyway, to make sure, look at the ID string in question and compare it with the ID you get from drive.google.com > right click > Get link. You should see something like:
https://drive.google.com/open?id=0B1mqwertyasdfghZxCvbItM0E
If the id= string matches your resource ID, you're cool. Sorry for the confusion.
ORIGINAL (incorrect for .NET, applies to GooPlaySvcs/GDAA on Android)
I believe it does.
When testing the ResourceId availability here, I remember getting DriveId in one form immediately in the 'onResult()' callback. Later, when the 'onCompletion()' event occured, the DriveId of the same object looked very different (applies to both file and folder) .
Also, look at Daniel's comment here, it suggests that you should not rely on the value of the DriveId in any moment and use 'equals()'.
The ResourceId would be more appropriate ID to store, shuttle around, etc... DriveId is useless outside the GooPlaySvcs instance. And, based on some hints from Drive-Involved-Googlers, relying on a concrete value of DriveId is dangerous. That makes existence of 'encodeToString() / decodeFromString()' somewhat questionable, right?
Good Luck

How to work with not (yet) registered devise Users

I have a User model, for login and registration, its email field is used (everything vanilla from the devise gem).
I want (other) users to be able to e.g. add Users to a team, with the email-address as the identifier.
That is fine when the User is already existing (pseudo #team.users.add(User.find_by(email: other_users_email))) but I am unsure how to handle situations where the user does not yet exist (did not [yet] register).
When a (new) User sets up a new account, for the example above after successfull registration current_user.teams should show up correctly.
I do not want to force these potentially new users to use the system (e.g. using devise_invitable) and bother them with an email.
I followed the path of creating the User when a user with the given email does not yet exist, but then when the user actually tries to setup an account, it fails (email not unique).
Alternatively, I could remodel the TeamMember-part and let it optionally either store an email-adress or the reference to an existing User. Then what I would need is to check for "open" TeamMembers directly after User-Account-creation (so, TeamMembers with the given email). I could also do this on each requst, but that looks too expensive to me. There might be race conditions, but I could live with that (and check for the every-now-in-a-millenia-gap with a cron-job).
Any pointers? I am sure this is not that unusual.
I'd do this:
When a user A adds user B to a team by email, create the object for that user B, but set a flag, something like auto_created_and_inactive: true
When user B signs up on the site, you just have to handle this in your users#create: first, try to find an auto-created record and update it (set a password or whatever; also reset the flag). Or otherwise proceed with the usual route of creating a new record.
I have to admit that I did not yet tried #sergio-tulentsevs approach (implement RegistrationController#create). But to complete what I sketched in my question:
User model can define an after_confirmation method, which is called after ... confirmation! So, if I store every information about a potential user with a reference to his/her email-adress, once he/she registered I can query this information and e.g. complete Team-Memberships.
# app/models/user.rb
def after_confirmation
# (pseudo-code, did not try)
self.teams < TeamMembership.open.where(email: self.email)
end

Suggestion with basic drools syntax

The following is a basic drools syntax:
$customer : Customer( )
Account( ) from $customer.accounts
As far as I know the first line create a new variable and assign it to the fact.
However I can't quite understand the second line especially what the "Account()" part means...
You have written class Customer, or must know it to understand what's going on here. Presumably it contains a Collection<Account> accounts (see note), which is (by the engine) retrieved one by one so that the rule fires for each Account object contained in Customer's object.
The rule will fire once for each Account object stored in any of the collections contained in all the Customer facts in working memory, with $customer being bound to the containing Customer.
You can bind another variable to Account.
Note: It could also contain a field Account accounts, but I hope the name was chosen carefully.

Get a list of Active Directory Users along with their Full Name and Email

I need to retrieve a list of Active Directory users and their attributes using Delphi 2010.
I've seen a few similar questions on SO (e.g. Delphi - Find primary email address for an Active Directory user), but they all seem to require the user name before any additional information can be retrieved.
I had written an article for [The Delphi Magazine] way back when..... if you have access to a backlog of those magazines, it's in issue no. 62 (October 2000) - unfortunately, it seems those back issues aren't available for purchase anymore :-(
It's too long of an article and a code sample to post here.... basically it's about wrapping the IDirectorySearch interface in a nicer Delphi-like shell. You pass in a base container where to search, you define an LDAP filter, and you define a set of attributes you're interested in - then you search and get back basically an enumerator for the results, which you can get one by one.
In the end, I discovered TJvObjectPickerDialog, part of JVCL. It wraps the Windows Select Object dialog and does everything I need with very little coding. Just set the required properties and call execute. The selected user objects are returned along with the attributes that you set in the 'Attributes' property.

Identify ABRecord records uniquely: Is [ABRecord uniqueId] immutable?

I need to reference ABPerson records from within an application. I use the unique ID provided by
- (NSString *)uniqueId
and attach it to my in-app contact record.
Additionally, I save ABPerson's vCardRepresentation as a fallback. In case the app isn't any longer able to locate the ABRecord using the uniqueID, the app asks the user to recover the adressbook record using the saved vCardRepresentation. All works fine.
Unfortunately, a friend told me, that uniqueId isn't immutable: During a sync, uniqueId may suddenly change.
According to him, somewhere in iOS documentation, Apple explains that no way exists to immutable identify ABPersons using uniqueId. In OS X' Cocoa documentation, I failed to find such a hint.
On a given Mac, may the uniqueId change suddenly? If that's true, what's the correct way to identify ABPerson records from within an external application?
In case the uniqueID isn't immutable, I certainly may assign a custom property with a GUID. Unfortunately, custom fields do not sync.
Certainly, I'd prefer to use uniqueId.
For whats its worth, from Apple's techdoc:
kABUIDProperty
The unique ID for this record. It’s guaranteed never to change, no matter how much the record changes. If you need to store a reference to a record, use this value. Type: kABStringProperty.
Available in Mac OS X v10.2 and later.
Declared in ABGlobals.h.
It looks like the kABUIDProperty approach might not work anymore. I came across this blog entry with more discussion in the comments at: http://blog.clickablebliss.com/2011/11/07/addressbook-record-identifiers-on-mac-and-ios/.
A case in point: If a user decides to turn on iCloud sync, the unique ids in that user's address book will change. If the users turns off iCloud sync, they'll change again.
Addendum: it might be worthwhile looking at the StackOverflow entry here.
Apple's docs do say this (quoted from the link):
"The recommended way to keep a long-term reference to a particular record is to store the
first and last name, or a hash of the first and last name, in addition to the identifier.
When you look up a record by ID, compare the record’s name to your stored name. If they don’t match, use the stored name to find the record, and store the new ID for the record."

Resources