Comments (6)
You can search for an entry in active directory with the usual ldap way using wildcards to specify all attributes and you will get all the attributes for that entry.
Microsoft should also have some docs with all the attributes - this one looks potentially ok - https://msdn.microsoft.com/en-us/library/ms675085(v=vs.85).aspx
from novell.directory.ldap.netstandard.
I am sorry I think I am not clear with my question. In the below code I am hard coding the attributes for adding a new entry:
LdapAttributeSet attributeSet = new LdapAttributeSet();
attributeSet.Add(new LdapAttribute("givenname",
"Anilsnew1"));
attributeSet.Add(new LdapAttribute("sn", "Anilsnew1"));
attributeSet.Add(new LdapAttribute("telephonenumber", "1 801 555 1212"));
attributeSet.Add(new LdapAttribute("mail", "[email protected]"));
attributeSet.Add(new LdapAttribute("userpassword", "Anilsnew"))
string dn = "cn=" + user.UserName + "," + _containerName;
sstring dn = Guid.NewGuid().ToString();
newEntry = new LdapEntry(dn, attributeSet);
LdapConnection conn = new LdapConnection();
conn.Connect(_ldapHost, _ldapPort);
conn.Bind(_loginDN, _password);
LdapEntry ldapEntry = new LdapEntry();
conn.Add(newEntry);
I dont want to hardcode the attribute name. How would I do it?
Thanks
from novell.directory.ldap.netstandard.
I found this code but its giving me 1000+ entries. I need only user attributes which are only 32 I believe.
string schemaDN = "CN=Aggregate,CN=Schema,CN=Configuration,DC=wwt-cnd,DC=local";
LdapSchema schema = _ldapConnection.FetchSchema(schemaDN);
IEnumerator attributeSchemas = schema.LDAPSchema.AttributeSchemas
from novell.directory.ldap.netstandard.
Not really clear for me what do you want to achieve. Ok, you could read the schema dynamically, but you still need a place where to specify what is the attribute name for "first name" or "last name" e.g.
{ "firstname", "givenname"},
{"lastname", "sn"} ...
The standard object classes "person", "organizationalPerson", "inetOrgPerson" and others are supposed to be the same for all the ldap servers and you can find their schema in the RFCs.
from novell.directory.ldap.netstandard.
Ok. While adding a new ldap entry in Active directory we add attributes like the below code in .NET:
LdapAttributeSet attributeSet = new LdapAttributeSet();
attributeSet.Add(new LdapAttribute("givenname", "Anil Kumar"));
attributeSet.Add(new LdapAttribute("sn", "Anil Kumar"));
attributeSet.Add(new LdapAttribute("telephonenumber", "1 801 555 1212"));
attributeSet.Add(new LdapAttribute("mail", "[email protected]"));
attributeSet.Add(new LdapAttribute("userpassword", "Anilkumar"))
I dont want to hardcode the attribute names like "givenname", "mail", "userPrincipalName" etc. There are 32 user level attributes I believe.
In other words I want to retrieve the following attribute names list
objectSid
sAMAccountName
accountExpires
whenChanged
countryCode
memberOf
uSNCreated
cn
sAMAccountType
sn
primaryGroupID
userAccountCont
whenCreated
lastLogoff
pwdLastSet
objectGUID
givenName
dSCorePropagati
objectClass
uSNChanged
name
displayName
lastLogon
logonCount
mail
distinguishedNa
badPasswordTime
badPwdCount
userPrincipalName
codePage
instanceType
objectCategory
The user would send these attributes and its values in key value pair as input.
I will validate the attribute names sent by the user and add the values to the attribute set.
Thanks
from novell.directory.ldap.netstandard.
maybe this will help - it looks that this is what you want
https://serverfault.com/questions/598853/view-all-possible-attributes-of-an-objectclass-for-ldap
you will need to translate the command lines to api calls.
from novell.directory.ldap.netstandard.
Related Issues (20)
- Error:Connect Error
- SearchAsync runs forever if user not found HOT 3
- Low performance (in 100 times more) Connect/Bind methods in Docker on Win11 with Linux containers
- Paging not working HOT 2
- Query to Deleted Objects container
- change password?
- LDAPConnection.Search doesn't get repeated attribute names HOT 1
- UserDefinedServerCertValidationDelegate is obsolete, what to use instead? HOT 1
- Empty password in BindAsync does not throw exception HOT 1
- Bind() with exclamation mark in the password HOT 1
- Bind operation with empty password doesn't throw exception HOT 1
- Unable to connect AD (TLS) server on Linux machine HOT 1
- Groups with more than 1500 members
- olcAccess modifications
- Referral filter is not decoded. Space character (%20) breaks the following LDAP search (3.6.0)
- local error during search in container?
- Can we have a full release on nuget please?
- Possible bug on paging HOT 1
- Can no longer access IAsyncEnumerable extension metods in 4.0.0-beta5 HOT 1
- Release Versioning Causes Confusion HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from novell.directory.ldap.netstandard.