Skip to content

Instantly share code, notes, and snippets.

View imvishalpatel's full-sized avatar

Vishal Patel imvishalpatel

View GitHub Profile
@davidpelfree
davidpelfree / ActiveDirectoryUtils.java
Created July 17, 2017 17:12
Active Directory error code parser in Java
package util;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public final class ActiveDirectoryUtils {
private static final Pattern ERROR_CODE = Pattern.compile(".*LDAP: error code\\s([0-9]*).*data\\s([0-9a-f]{3,4}).*");
public static final int USERNAME_NOT_FOUND = 0x525;