w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
How to exchange code for token for importing gmail address book
If you look in the link you posted it gives you the answer: grant_type As defined in the OAuth 2.0 specification, this field must contain a value of authorization_code. Set the value to the literal string "authorization_code" grant_type = "authorization_code",

Categories : C#

Active Directory LDAP move user to different OU - Ruby
This is how we solved it: @ldap.rename(olddn: user.dn, newrdn: "CN=#{user.cn}", delete_attributes: true, new_superior: "#{new_ou}") We also used the version of ldap-ruby on Github not the version on RubyGems.

Categories : Ruby

Storing Information in an Address Book
everytime you want to insert a name you are creating a new Object from ArrayList information = new ArrayList<String>(); initizalize this arraylist in your main method and then access it via its variable(information)

Categories : Java

How do I get address lists (NOT global) using Exchange WebServices in C#
I don't have exchange setup to test this code, so it will need modifications but it should give you a starting point to explore. The idea is that you set the ItemView to the ContactSchema to retrieve results by company. // Get the number of items in the Contacts folder. To keep the response smaller, request only the TotalCount property. ContactsFolder contactsfolder = ContactsFolder.Bind(service, WellKnownFolderName.Contacts, new PropertySet(BasePropertySet.IdOnly, FolderSchema.TotalCount)); // Set the number of items to the smaller of the number of items in the Contacts folder or 1000. int numItems = contactsfolder.TotalCount < 1000 ? contactsfolder.TotalCount : 1000; // Instanti

Categories : C#

How can I get exchange user from LegacyExchangeDN address?
If you know the EX type address, you can programmatically construct the entry id; its format is documented. abFlags[0]: 00 abFlags[1]: 00 abFlags[2]: 00 abFlags[3]: 00 muid: MUIDEMSAB ulVersion: 0x00000001 ulType: 0x00000000 (DT_MAILUSER) szAddr: /o=Swiftpage/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=0b3e51186fb04360b84f67d65c35e23a-SomeUser

Categories : C#

Is there a way to access the user's own address book data (first & last name, e-mail) in iOS?
I think you need to pre fill the values from your device's address books. If so you have to dig your head into AddressBook Framework in order to access the contact details. Below link is from iOS developer link http://developer.apple.com/library/ios/#documentation/AddressBookUI/Reference/AddressBookUI_Framework/_index.html http://developer.apple.com/library/ios/#documentation/AddressBook/Reference/AddressBook_iPhoneOS_Framework/_index.html#//apple_ref/doc/uid/TP40007212

Categories : IOS

VBS Active Directory (2003) Move users from one set of groups to another
If all you want is transfer group members from each Sync group to the correspondig Mig group, something like this should do: Set fso = CreateObject("Scripting.FileSystemObject") Set userlist = CreateObject("Scripting.Dictionary") userlist.CompareMode = vbTextCompare Set f = fso.OpenTextFile("users.txt") Do Until f.AtEndOfStream userlist.Add f.ReadLine, True Loop f.Close domain = GetObject("LDAP://rootDSE").Get("defaultNamingContext") For i = 1 To 20 n = Right("0" & i, 2) Set gSync = GetObject("LDAP://CN=Sync" & n & ",OU=Huset," & domain) Set gMig = GetObject("LDAP://CN=Mig" & n & ",OU=Huset," & domain) For Each m In gSync.Members Set user = GetObject(m.ADsPath) If userlist.Exists(user.sAMAccountName) Then gMig.Add(m.ADsPath) gS

Categories : Vbscript

Get user address information using a phone number
I'm not quite sure whether it's possible through the phone number. However there's an API that might help you to achieve something similar. A CellID is the unique number of a GSM cell for a given operator. Your phone is always connected to a Cell, and by nowing this number, you know the Cell, and by knowing the position of the cell, you know where you are. There is some accuracy issue, as the cell can cover from several hundreds of meters to several kilometers, but this could be a very good starting point to locate yourself. Links: OpenCellID and OpenCellID API Hope it helps!

Categories : PHP

Searching User In Active Directory By Full Name
Change "... name='" & var5 & "'" to either "... displayName='" & var5 & "'" or "... sn='" & lastname & "' and givenName='" & firstname & "'" For the latter you need 2 variables: one with the first and the other with the last name.

Categories : Search

How to get user Data from LDAP Active directory?
I got the solution: - I have change my filter variable and it starts working ..:) Here is my class and methods used: class LdapDataReciver: def get_access_token(self,data): user_detail = {'user_name':data} auth = HMAAuthentication(expire_duration=4*60*60) access_token = auth.create_access_token(user_detail) return access_token def get_group(self,list): groups=[] try: for entry in list: cn = entry.split(' ') cn1 = cn[0].split('=') groups.append(cn1[1]) return groups; except : raise AuthenticationException("userName does not exist") def authenticate_with_active_directory(self,username,password): try: l = ldap.initialize(settings.LDAP_URL) l.simple_bind(username, password)

Categories : Django

Using Active Directory/LDAP to Login user in ASP.NET 3.5 app
You can go over the PrincipalContext Like this: using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, myDomainTextBox.Text)) { // validate the credentials bool cIsValid = pc.ValidateCredentials(myUserNameTextBox.Text, myPasswordBox.Password); if (cIsValid) { // Do some stuff } }

Categories : C#

Using Active Directory to login using a local user
This is all that the Websecurity.Login method does: public static bool Login(string userName, string password, bool persistCookie = false) { WebSecurity.VerifyProvider(); bool flag = Membership.ValidateUser(userName, password); if (flag) { FormsAuthentication.SetAuthCookie(userName, persistCookie); } return flag; } You can write your own method that authenticates against AD and then looks up the user name and the does sets the auth cookie something like: public static bool MyLogin(string userName, string password, bool persistCookie = false) { bool flag = CheckADUser(userName, password); if (flag) { string mappedUsername = GetMappedUser(userName); if(mappedUsername != "") { FormsAuthentication.SetAuthCooki

Categories : C#

Active Directory authentication through ssl as anonymous user
I did some research and found other applications having similar issues. 1. Make sure you have imported your certificates into the keystore according to the Connect to LDAP or Other Services Via SSL instructions. 2. Make sure any certificates have been imported into the correct keystore; you may have multiple JDKs.

Categories : Java

Android - Facebook: an active access token must be used to query information about the current user
Hey you need to call facebook.authorize method if(!facebook.isSessionValid()) { facebook.authorize() } For more information you can refer this link. I think it will help you. Visit http://www.techrepublic.com/blog/app-builder/integrate-facebook-logins-in-your-android-app/296

Categories : Java

retrieve and display user image from active directory with c#
You should add an img tag with a src url to your handler you wrote (which should arguably be a HttpHandler for Web Forms) I'd imagine the url would look like <img src="http://myintranetsite/ADImageHandler alt="" />

Categories : C#

How to return user details from the Active Directory using PrincipalContext
I don't understand why you are mixing the new PrincipalContext with the old DirectoryEntry stuff. Doesn't make any sense..... Also - you're searching for all users, but in the end, you're returning only a single DirectoryEntry - why?!? If you're using the new PrincipalContext - then use the UserPrincipal - it contains nice and easy to use properties about the user - much easier to use and work with than the old DirectoryEntry stuf.... public List<UserPrincipal> GetAllUsersDetails() { using (var context = new PrincipalContext(ContextType.Domain, "WIN-SPDEV.com")) using (var searcher = new PrincipalSearcher(new UserPrincipal(context))) { var searchResults = searcher.FindAll(); List<UserPrincipal> results = new List<UserPrincipal>();

Categories : Asp Net

c# Active Directory Authentication User if Computer not in domain
I've tried this one. The computer now i'm using is not in domain. try { DirectoryContext context = new DirectoryContext(DirectoryContextType.DirectoryServer, "IP", "Username", "Password"); DirectoryEntry deDoc = Domain.GetDomain(context).GetDirectoryEntry(); } catch (Exception ex) { MessageBox.Show(ex.Message); }

Categories : C#

I need a script to detect if a computer is in an active directory user group
You could try something like this in PowerShell to check that the named computer is in the OU or not: Script: import-module activedirectory $OU = @() $CheckOU = "LaptopOU" $computerName = "Laptop12345" $user = get-adcomputer $computerName -Properties * $user.DistinguishedName -split "," | %{If($_ -match "OU="){$OU += $_ -replace "OU=",""}} If($OU -match $CheckOU){ "Computer:$computerName is in the OU:$CheckOU" # Do something... } Else{ "Computer:$computerName is not in the OU:$CheckOU" # Do something else.. } This will take a $computerName and get all the OU's that it's in from Active Directory and stores them in an $OU array. Then you can use that array to simply check if the computer is in the given OU ($CheckOU) or not by using the -match operator. Note: You

Categories : Powershell

To retrieve logged in user's Active directory data from Websphere
Logged on user is represented as a set of principals within JAAS subject. Information like user name or email is not present there and is not supposed to. You have no other option other than query LDAP (Active Directory in your case). The statement like "i have already connected to active directory" does not make much sense. Yes, the user is authenticated by WAS through AD, but this does not mean that any sort of persistent connection exists.

Categories : Java

Query Active Directory in Java using a logged on user on windows
I'm going off of this guy's post. You can go with the commercial Jespa library, which uses NTLMv2. Or you can go with the open source com4j project that uses ADSI, created by Kohsuke Kawaguchi.

Categories : Java

Get active directory user group property in asp.net website - web.config
'I don't know if you can get this information by a web.config setting, but you can get this information from the System.DirectoryServices.AccountManagement namespace. (if you're looking per user) You could store the domain name in the appsettings of the web.config and do something like... private static PrincipalContext _ctx = new PrincipalContext(ContextType.Domain, System.Configuration.ConfigurationManager.AppSettings["DomainName"]); public List<string> UserGroups(string userName) { List<string> ret = new List<string>(); using (UserPrincipal user = UserPrincipal.FindByIdentity(_ctx, userName)) { if (user != null) { foreach (Principal p in user.GetAuthorizationGroups()) { ret.Add(p.Name); } } }

Categories : C#

Determine User Active Directory Groups from Local Machine off Network
From the top: My current project requires that I validate a user against Active Directory groups. The catch is, the computer may not always be connected to the domain but users may still need to run the tool. At this point, you must therefore accept that any enforced security is able to be bypassed by an attacker since it is entirely enforced on the client. Not exactly part of the solution, but keep it in mind. I understand that I can't query Active Directory while I'm not connected, instead I'm trying to query the Machine SAM (MSAM). The Security Accounts Manager only stores the local accounts (MACHINENAMEAdministrator and others). It will not have domain user credentials. You are thinking of the LSA cache, which remembers the last N domain logins's credentials (where

Categories : C#

I want to add a random generated password to my newly created Active Directory User
This is written so that $sourceData can be a string like the following. If you really want to pass $sourcedata as an array of char remove the [char[]] cast from the function. $sourcedata="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-$" Function GET-Temppassword() { Param( [int]$length=10, [string[]]$sourcedata ) -join ([char[]] $sourcedata | GET-RANDOM -count $length) } get-temppassword $sourceData 20 GVTXxF13ibnBK5AQOu-P

Categories : Powershell

How do I create a batch script that creates a task for a specific user in the Active Directory?
For it to run as that user you need to specify both username and password. schtasks.exe /create /? [snip] /U username Specifies the user context under which the command should execute. /P password Specifies the password for the given user context. [snip] So, for user 'jsmith', with password 'password1', your command will end up looking something like: schtasks.exe /create /u jsmith /p password1 /sc once /tn defrag /tr "\compnameC$Windowssystem32defrag.exe c:" /st 14:33:00

Categories : Windows

Authenticate user against active directory using MVC4 forms with optional input domainusername or just username
You could try to use double authentication solution using both Membership and PrincipalContext public bool ActiveDirectoryAuthentication(string username, string password) { var splittedCredentials = username.Split(new[] { "\" }, StringSplitOptions.None); switch (splittedCredentials.Length) { case 1: { var authenticated = Membership.ValidateUser(username, password); if (authenticated) { FormsAuthentication.SetAuthCookie(username, false); } return authenticated; } case 2: { var principalContext = new PrincipalContext(ContextType.Domain, splittedCreden

Categories : C#

IOS - Get Contact phone use to Address Book
The biggest problem in your code is that you need to pass reference "addressBookRef" to your "loadContact" method. "ABAddressBookCreate" won't work for iOS6 - you need to use the one created by ABAddressBookRequestAccessWithCompletion. Btw. Instead of checking for iOS version better use that to determinate if you need to ask for permissions. Here is a code I'm using - feel free to use it: -(BOOL)isABAddressBookCreateWithOptionsAvailable { return &ABAddressBookCreateWithOptions != NULL; } - (void) importContactsFromAddressBook { ABAddressBookRef addressBook; if ([self isABAddressBookCreateWithOptionsAvailable]) { CFErrorRef error = nil; addressBook = ABAddressBookCreateWithOptions(NULL,&error); ABAddressBookRequestAccessWithCompletion(addressBo

Categories : IOS

Address book data persistence?
Instead of having an array with 3 elements of text in it and using NSKeyedArchiver, have an array with dictionaries in it and save it with writeToFile:atomically:. This will use the array as a list of 'entries' rather than a list of fields and will save the data in a plist instead of a binary file. Now, when you read in the array you can display a table view of the entries (just showing the name for example) and then when you show the archive view you would pass the controller the a appropriate dictionary. For saving, it would be good to use delegation to pass the edit back to the master controller. But it could also be done directly (requires more knowledge in the detail controller) or by notification.

Categories : IOS

Crash on second address book (contacts) lookup
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person { [self displayPerson:person]; [self dismissViewControllerAnimated:YES completion:nil]; return NO; } you returning NO ? Try checking to see if the value exists maybe ie - (void)displayPerson:(ABRecordRef)person { NSString* companyName = (__bridge_transfer NSString*)ABRecordCopyValue(person, kABPersonOrganizationProperty); NSString* name = (__bridge_transfer NSString*)ABRecordCopyValue(person, kABPersonFirstNameProperty); NSString* display = @""; if (companyName) { display = companyName; } else if (name) { display = name; } else { UIAlertView *alertView = [[UIAlertView alloc

Categories : Objective C

Linked List Array – Address Book
When you modify an entry first you remove the existing entry and then you insert a new node, rather than actually modifying the old entry itself. Once you do that you call InsertNewNode but you don't check to see if the list is empty Thus, void InsertNewNode(Node* pNewNode) { if (pNewNode->name < pHeadNode->name) // <-- If pHeadNode is NULL you crash { ... } ... } Change that line to: if (!pHeadNode || (pNewNode->name < pHeadNode->name))

Categories : C++

How to fetch contact images from Address Book in iOS 6
you can get image using this line of code:- if (ABPersonHasImageData(ref)) { NSData *imgData = (__bridge NSData *) ABPersonCopyImageDataWithFormat(ref, kABPersonImageFormatThumbnail); image = [UIImage imageWithData:imgData]; } else { image = [UIImage imageNamed:@"default.png"]; } Check as Martin R says's your self.reterivedImagesArray is Allocated or not like self.reterivedImagesArray=[[NSMutableArray alloc]init]

Categories : IOS

how to add facebook's friends into iphone's address book
You need to read Adress book programing from here And for inserting contact: idea is - You need make object of address book ABAddressBookRef addressBook = ABAddressBookCreate(); then create a record like this ABRecordRef person = ABPersonCreate(); then set some property like this ABRecordSetValue(person, kABPersonFirstNameProperty, CFSTR(fbUserName), &anError); fbUserName is the name of your friend getting by fbGraph api. then you need to insert this record in address book ABAddressBookAddRecord(); then save the changes. ABAddressBookSave(); at last CFRelease(addressBook);

Categories : Iphone

How to sync data from address book to server?
Use ABPeoplePickerNavigationControllerDelegate to retrive Email from contact list using kABPersonEmailProperty. - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person { CFStringRef emailName = nil; ABMultiValueRef emails = ABRecordCopyValue(person, kABPersonEmailProperty); emailName = ABMultiValueCopyValueAtIndex(emails, 0); /* Here make code for DB 1) Make email Field of DB unique. 2) select query like: select * from tblContact where email = emailName; get count of Record set. 3) if record set count == 0 then insert emailName in tblContact using insert Query. else Do nothing

Categories : Iphone

How to retrieve Mobile number from Address book iOS
Use this code for fetching the specific contact mobile number based on the first name and email id.... NSMutableString *contactNumber = [[NSMutableString alloc] init]; ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook); CFIndex nPeople = ABAddressBookGetPersonCount(addressBook); for(int i=0; i<nPeople; i++) { ABRecordRef person=CFArrayGetValueAtIndex(people, i); NSMutableString *contacName = [[NSMutableString alloc] init]; [contacName stringByAppendingString:@""]; [contacName appendFormat:@"%@", (NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty)]; ABMultiValueRef emailInfo = ABRecordCopyValue(person, kABPersonEmailProperty); CFIndex emailCount = ABMultiValueGetCount(emailInfo)

Categories : IOS

Verify address book contacts iOS from PHP server
If you think of performance the first thing you need to check is how many db calls are there because they are slow. So all you need to do in your case is to perform a single mysql request with all the emails you got from ios call: SELECT email, picture FROM User WHERE email IN ('email1', 'email2', ...) Then you need to iterate through the results of sql call, so that you know which of passed emails exist in your database. And you should consider switching to PDO for sure.

Categories : PHP

Pattern for swing information exchange between two JFrames
Start by having a read through The Use of Multiple JFrames, Good/Bad Practice? Then have a read of How to make dialogs. JFileChooser is a component that has a method that also displays a dialog. Your needs might be different, but it's not a bad pattern as it doesn't look your component into begin need to be always displayed on a dialog Updated You could use a JOptionPane import java.awt.EventQueue; import javax.swing.JOptionPane; import javax.swing.JTextField; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; public class TestOptionPane12 { public static void main(String[] args) { new TestOptionPane12(); } public TestOptionPane12() { EventQueue.invokeLater(new Runnable() { @Override public void r

Categories : Java

How to write a Validation inside my model class to check if the user is Inside Active Directory or not
Please try this code: var searchResults = searcher.FindAll(); foreach (Principal p in searchResults) { if(p.SamAccountName == User.Identity.Name) { //your in! } }

Categories : C#

Trying to update label phone number in Address Book
I Found a solution: The code below is working fine: - (void)displayPerson:(ABRecordRef)person { ABAddressBookRef ab = ABAddressBookCreate(); ABRecordRef record = ABAddressBookGetPersonWithRecordID(ab, ABRecordGetRecordID(person)); CFErrorRef *error = NULL; ABMultiValueRef phoneNumbers = ABRecordCopyValue(record,kABPersonPhoneProperty); ABMutableMultiValueRef phoneNumberMV = ABMultiValueCreateMutableCopy(phoneNumbers); for(CFIndex i=0; i < ABMultiValueGetCount(phoneNumberMV); i++){ NSString *phoneNumber = (__bridge NSString *)ABMultiValueCopyValueAtIndex(phoneNumberMV,i); //NSSlog(@"phoneNumber = %@", phoneNumber); if ([@"1128558994" isEqualToString:phoneNumber]) { //now delete it!!! ;-) /* NSSlog(@"phoneNumbers = %@",phoneNumbers); N

Categories : IOS

Adding contact image to address book iPhone
You are creating the data wrong - you should be doing it like this. UIImage *img = [UIImage imageWithContentsOfFile:path1]; NSData *dataRef = UIImagePNGRepresentation(img); CFDataRef cfDataRef = CFDataCreate(NULL, [dataRef bytes], [dataRef length]); Also try setting a break point somewhere in the beginning and check if something isn't nil or doesn't have wrong value. UPDATE I have tried it in actual Xcode, just to test. The reason why your code tells you that address book has no unsaved changes is because you haven't added the record inside it yet - otherwise you are setting an image on a contact that hasn't been added to address book yet (that is not a problem, you can do that without any problems, but the contact itself is not in the address book until you save it). So the magical l

Categories : Iphone

Get the ABRecordID from newly added Address Book Object ios
Simply call ABRecordGetRecordID(newPerson) after you've saved the address book (before that, there won't be a valid ID). //... ABRecordID recordID = ABRecordGetRecordID(newPerson); An ABRecordID is the same as an int_32 (a 32-bit integer).

Categories : IOS

Using Exchange EWS SOAP, how can I get the email address for a given usename
Have never came across a direct method that gives email-address of logged in user, but you can do simple hack by creating a PostItem and then getting email-address by its PostItem.getFrom() method, something like : PostItem postItem = new PostItem( service ); postItem.setBody( MessageBody.getMessageBodyFromText("Test for email-address " ) ); postItem.save(); postItem = PostItem.bind( service , postItem.getId() ); System.out.println( postItem.getFrom() ); postItem.delete( DeleteMode.HardDelete );

Categories : Node Js



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.