 |
|
 |
Dear All,
I don't know how to finding domino groups of logged in user by using asp.net ?
Please help.
|
|
|
|
 |
|
 |
hi all,
I am trying to display all the user's name infront of admin who are cuurently logedin. is any onethere who can do it? please help me to do it.
Thanks
Noor alam
|
|
|
|
 |
|
 |
Hi everyone
i m developing web application for intranet use in our office.now
I have 1 webform which contains usernametextbox and passwordtextbox,
Now I want that i want to check username & password in active directory, how can i check through ACTIVE DIRECTORY.
please show me some step by step script.
waiting for reply.
Regards,
ASIF
|
|
|
|
 |
|
 |
Hi Asif,
The following code should be able to help you and let u authenticate the user aganist ADS, and help u to achieve ur task.
Put this code in the button click
// Start of Code
//// Code to search the Domain Name
DirectoryEntry entryRoot = new DirectoryEntry("LDAP://RootDSE");
string domain = (string)entryRoot.Properties["defaultNamingContext"][0];
//// End of Code to search the Domain Name
if (UserDomainTextBox.Text.Length == 0)
UserDomainTextBox.Text = domain;
using (DirectoryEntry deDirEntry = new DirectoryEntry("LDAP://" + UserDomainTextBox.Text,
UserNameTextBox.Text,
UserPassTextBox.Text,
AuthenticationTypes.Secure))
try
{
string name = deDirEntry.Name.ToString();
MessageBox.Show("Welcome to '" + deDirEntry.Name + "'");
// Change the message box to Response.write
}
catch (Exception exp)
{
MessageBox.Show("Sorry, Invalid User");
// Change the message box to Response.write
}
// End of COde
Good Luck,
Regards,
Govardhan
|
|
|
|
 |
|
 |
What is the LDAPS version of this?
Is it simply changing:
DirectoryEntry entry = new DirectoryEntry(LDAP://ADservername,
"username","password");
to:
DirectoryEntry entry = new DirectoryEntry(LDAPS://ADservername,
"username","password");
As in doing so I recieve connection errors, however using the following:
DirectoryEntry entry = new DirectoryEntry(LDAP://ADservername:636,
"username","password");
Seems to work as in using Network Monitor on the server shows:
Transmission Control Protocol, Src Port: 2157 (2157), Dst Port: ldaps (636), Seq: 288, Ack: 350, Len: 203
TIA.
|
|
|
|
 |
|
 |
I'm trying to list all the members of a group through AD.
When I try to run a DirectorySearcher on "LDAP://server", I just get the DNS sub-tree, not everything from root If I do the same in a windows app it works .
I've tried "LDAP://server/DN=myDomain,DN=org" and "LDAP://server.myDomain.org/DN=myDomain,DN=org"; both do the same from ASP and WinApp as the unadorned server name .
TIA
PeteB
I wouldn't say "he's not the sharpest knife",
I'd say "he's a spoon."
-- modified at 7:18 Monday 24th April, 2006
|
|
|
|
 |
|
 |
arl = new ArrayList();
arl = GetAllADDomainUsers("LDAP://in.QUEST-SOFTWARE.com");
for (int i = 0; i < arl.Count; i++)
{
lstUsersName.Items.Add(arl[i].ToString());
}
ArrayList GetAllADDomainUsers(string domainpath)
{
//domainpath = "LDAP://in.Quest-Software.com";
ArrayList allUsers = new ArrayList();
sb = new System.Text.StringBuilder();
sbProperty = new System.Text.StringBuilder();
searchRoot = new DirectoryEntry(domainpath);
search = new DirectorySearcher(searchRoot);
search.Filter = "(&(objectClass=user)(objectCategory=person))";
search.PropertiesToLoad.Add("samaccountname");
search.PropertiesToLoad.Add("name");
search.PropertiesToLoad.Add("desacription");
search.PropertiesToLoad.Add("givenName");
// search.PropertiesToLoad.Add("userPassword");
resultCol = search.FindAll();
if (resultCol != null)
{
for (int counter = 0; counter < resultCol.Count; counter++)
{
result = resultCol[counter];
if (result.Properties.Contains("samaccountname"))
{
allUsers.Add((String)result.Properties["samaccountname"][0]);
}
}
properties = searchRoot.Properties;
foreach (string name in properties.PropertyNames)
{
foreach (object obj in properties[name])
{
sb.Append(name + "\t: " + obj.ToString());
sb.AppendLine();
}
}
}
return allUsers;
}
|
|
|
|
 |
|
 |
Hi chetan,
I'm developing LDAP application where in I need to search and List all user in the domain.
I tried your code but i get error in syntax: "properties = searchRoot.Properties;".
Please help me out as it is very urgent.
I'll be very thankful to you.
Jack
|
|
|
|
 |
|
 |
pls mail me ur code at randy_orton646@yahoo.com and i will look at it
|
|
|
|
 |
|
 |
Hello, the above code works awesome for me as long as I hard code my password into the GetGroups method call. Is there a way to grab this programatically from the NT login? I am able to grab the username by going HttpContext.Current.User.Identity.Name but I cna't seem to find something like that for the password. I have never attempted anything using AD before so I am a little lost and confused. Thanks in advance for your help.
JP011
-- modified at 16:21 Tuesday 22nd November, 2005
|
|
|
|
 |
|
 |
Could somebody help? I am able to access AD fine through a windows app, but when I port the same code over to a asp.net app, my DirectorySearcher no longer returns a result.
Thanks for any assistance
|
|
|
|
 |
|
 |
I get the same problem.
Guessing you're using Windows Authentication on you IIS server.
Turns out, if you don't provide a username and password for you DirectoryEntry root, it uses the ISS server credentials, which most likely are not an acceptable domain user.
Solutions include:
Switching authentication methods.
Providing a specific username, password.
Added the ISS users as a trusted domain user to the active directory.
We're going to try the last of the three here,
don't really recommend the other two.
Hope this helps.
|
|
|
|
 |
|
 |
hallo. I'm programming with VisualStudio.net. I want to get the Active Directory from a Virtual Machine into my programm with LDAP. How can I do this?
|
|
|
|
 |
|
 |
' Visual Basic
Dim strpath As String = "LDAP://DC=onecity,DC=corp,DC=fabrikam,DC=com"
Dim myDE As New System.DirectoryServices.DirectoryEntry(strpath)
Dim nameGUID As String
nameGUID = myDE.Name & myDE.Guid.ToString()
this is the code from msdn but i dont understand what to fill in for this string "LDAP://DC=onecity,DC=corp,DC=fabrikam,DC=com"
like "LDAP://path" means "LDAP://LDAP://ADservername, "username","password");
This is the link from msdn "ms-help://MS.MSDNQTR.2003FEB.1033/vbcon/html/vbtskCreatingADSIComponents.htm"
from where the above code is originate.
Please help me to complete that path string.
thank you
|
|
|
|
 |
|
 |
The LDAP path is the user object in Active Directory. Understanding the full realm of Active Directory is probably beyond something that can be written here. Basically the path will determine the location of the object (i.e. user, group, computer, etc) in the Active Directory Tree. For example, a user named jstrong located in the Organizational Unit beecham in the marty domain will have a path LDAP://cn=jstrong,ou=beecham,dc=marty,dc=com. I know that may not provide you with much, but it is a vast topic. Do some searches online to see if you can get a better understanding of how AD is designed.
|
|
|
|
 |
|
 |
sorry but i have to say that Active Directory programming
is not trivial... and i don't recommend it for a begginner-project, because you could get confused
|
|
|
|
 |
|
 |
Hi,
I have been trying to connect to my IMail LDAP installed locally. Would the connection string in this case be LDAP://localhost/CN=abc ?? I am really looking for a working example of connecting to a locally installed LDAP server with searching or authenticating users. I would like to know if anyone has done this and could help me out here?
Whenever i connect using the LDAP://localhost or any domain name for that matter it just gives the same error saying "Server not operational" . Any help is appriciated.
Thanks in advance for all the help!
Best regards,
Husain
|
|
|
|
 |
|
 |
Here is some code I put together to connect to an Imail LDAP server with VB.NET. Note: the Imail LDAP service must be running.
Dim entry As DirectoryEntry
entry = New DirectoryEntry("LDAP://localhost/o=email.com", "cn=username,o=email.com", "password", AuthenticationTypes.ReadonlyServer)
Dim srch As DirectorySearcher
srch = New DirectorySearcher(entry)
srch.Filter = "(o=*)"
Dim results As SearchResultCollection
results = srch.FindAll()
Dim result As SearchResult
Dim propColl As ResultPropertyCollection
Dim strKey As String
Dim obProp As Object
For Each result In results
propColl = result.Properties
For Each strKey In propColl.PropertyNames
System.Diagnostics.Debug.WriteLine(strKey)
For Each obProp In propColl(strKey)
System.Diagnostics.Debug.WriteLine(obProp)
Next
Next
Next
|
|
|
|
 |
|
 |
Hi,
i tried with that code and it works fine,but i had to provide the password for getting connected to active directory,i dont think this is secure enough
if you go through the security aspects.
So kindly tell me is there any way where i dont need to provide the password
Please help as i am really stuck with it.
Thanks,
Swarup
|
|
|
|
 |
|
 |
Does anyone know how to determine the groups of the user you are logged in with?
Any help would be greatly appreciated.
Thanks
|
|
|
|
 |
|
 |
I wrote the following to enumerate the groups the user is a member of:
// you must have an active directory object of the root directory established
// first, then the following code should work
// set up a collection to hold the groups
StringCollection groups = new StringCollection();
DirectorySearcher srch = new DirectorySearcher(RootDirectoryEntry,"(sAMAccountName=" + strUser + ")");
// set properties to retrieve
srch.PropertiesToLoad.Add("memberOf");
srch.PropertiesToLoad.Add("sAMAccountName");
// find one entry since there should be no duplicates of sam account name
// in the active directory
SearchResult res = srch.FindOne();
// clear the groups collection for safe measure
groups.Clear();
// get the number of groups that the user is a member of
int propertyCount = res.Properties["memberOf"].Count;
// create some variables for the looping through groups
String dn;
int equalsIndex, commaIndex;
// loop through groups
for( int propertyCounter = 0; propertyCounter < propertyCount; propertyCounter++)
{
dn = (String)res.Properties["memberOf"][propertyCounter];
// the following is used to remove the cn= etc...
equalsIndex = dn.IndexOf("=", 1);
commaIndex = dn.IndexOf(",", 1);
if (-1 == equalsIndex)
{
}
else
{
// add string to group collection
groups.Add(dn.Substring((equalsIndex + 1),(commaIndex - equalsIndex) - 1));
}
}
// now we have a string collection of all the groups this user is a member of
George Vigelette scjp mcse
gvigelet@rochester.rr.com
|
|
|
|
 |
|
 |
Just a thankyou. This has been a great help for me. Cheers.
-AL
|
|
|
|
 |
|
 |
AWESOME! HAH! I was searching all over online for this, and here it was as a little gem. THANKS MAN!
|
|
|
|
 |
|
 |
Dear All,
I don't know how to finding domino groups of logged in user by using asp.net ?
Please help.
|
|
|
|
 |
|
 |
WOW. This worked almost perfectly. VB doesn't seem to have any thing like a stringcollection, so i just appended each group onto one string.
Awsome code though, thanks!!!
|
|
|
|
 |