KarlGoddard Posted July 13, 2005 Posted July 13, 2005 Hi All Just wondered if anyone here has used ASP / ASP.NET pages to rerieve data from Active Directory. I'm currently looking at how to pull simple stuff from AD to create a staff look-up page for our intranet. It'd be great to hear from anyone who's done this and would be willing to pass on any pointers etc Thanks Karl
RobC Posted July 13, 2005 Posted July 13, 2005 I know it can be done, as Fujitsu have created a User Admin page for us that allows us to create/delete & edit users via a webpage. I'll try & see if I can view the source code & post some or all of it on here tomorrow.
Ric_ Posted July 13, 2005 Posted July 13, 2005 Possibly an aside, but if you just want to query and change user details, you could simply create a customised MMC. Obviously, the web page has its advantages though.
MkII Posted July 13, 2005 Posted July 13, 2005 web access would mean we could work on ad remotely. I'd love to havethat!
eejit Posted July 14, 2005 Posted July 14, 2005 web access would mean we could work on ad remotely. I'd love to havethat! If by "remotely" you mean other PCs on the domain, then deploy the "windows 2003 server adminpak.msi" to all workstations, then on any PC in the domain you can go to the Administrative Tools folder and work on Active Directory, DNS, DHCP, WINS or whatever. I also deploy the group policy management console throughout the domain too. Bloody handy.
Dos_Box Posted July 14, 2005 Posted July 14, 2005 If by "remotely" you mean other PCs on the domain, then deploy the "windows 2003 server adminpak.msi" to all workstations, then on any PC in the domain you can go to the Administrative Tools folder and work on Active Directory, DNS, DHCP, WINS or whatever. I also deploy the group policy management console throughout the domain too. Bloody handy. Handy yes. Dammed big security risk definitely!!
MkII Posted July 14, 2005 Posted July 14, 2005 I meant off site - I only have it on 3 machines - 2 for teaching staff to have access to a student account mmc to change passwords, and mine.
eejit Posted July 14, 2005 Posted July 14, 2005 If by "remotely" you mean other PCs on the domain, then deploy the "windows 2003 server adminpak.msi" to all workstations, then on any PC in the domain you can go to the Administrative Tools folder and work on Active Directory, DNS, DHCP, WINS or whatever. I also deploy the group policy management console throughout the domain too. Bloody handy. Handy yes. Dammed big security risk definitely!! How so? Only admins can access or run it.
tarquel Posted July 14, 2005 Posted July 14, 2005 hehe Depends how locked down the users are - mine would never find it or be able to run it lol The ironic thing is that the pupils are more likely to find it than the not-as-locked-down admin network with adults on it lol Nath
eejit Posted July 14, 2005 Posted July 14, 2005 Nope! Yep! When I said access it, I meant that our students have locked down desktops and mandatory profiles.
Geoff Posted July 14, 2005 Posted July 14, 2005 Ok thats great but did you remove their access to the AD objects. If not, they can still view the settings with a few lines of VB script.
spc-rocket Posted December 19, 2005 Posted December 19, 2005 Hi, From what i thought, you need to use something like LDAP (lighweight directory application protocol), which allows you to manipulate AD. This is probably the fastest was to do it and can be done using asp pages. ADSI is another option. HTH, Ashok.
webman Posted December 19, 2005 Posted December 19, 2005 Have a google round for ADSI + ASP. I've got some examples if you like for enumerating locations & computers and users for password-resetting and our fancy Intranet page ("Welcome Mr. Such and such" and give them customised links depending on staff/student group).
uk101man Posted February 22, 2006 Posted February 22, 2006 Hi, I've done a lot of work on accessing Active Directory using ASP (more vb.net web application) and this is what I have been able to do: Add, Delete, Move and update user’s accounts Pull information about users from AD You can create shares but not set any Security Permissions, if someone knows differently please PM me. Lesson1 Start a VB.NET Web Application Add a button to the form Add 5 text boxs' (txtuname,txtfname,txtsname,txtprofile,txtspath) Use this code for button 1 Dim strUsername = txtuname.Text Dim strFirstname = txtfname.Text Dim strSurname = txtsname.Text Dim strprofilepath = txtprofile.Text Dim strlogons = txtspath.Text Dim strDisplayname = strFirstname & strSurname CreateUser("LDAP://cn=Users,DC=domain,DC=local" &, txtfname.Text, txtsname.Text, txtuname.Text, txthdriveletter.Text, txtspath.Text) Add this SUB Sub CreateUser(ByVal aContainer As String, ByVal strFirstname As String, ByVal strSurname As String, ByVal username As String, ByVal strhdrive As String, ByVal strlogons As String) Dim DSESearcher As DirectoryServices.DirectorySearcher = New DirectoryServices.DirectorySearcher() Dim RootDSE As String = DSESearcher.SearchRoot.Path RootDSE = RootDSE.Insert(7, "CN=Users,") Dim myDE As DirectoryServices.DirectoryEntry = New DirectoryServices.DirectoryEntry(aContainer) Dim myEntries As DirectoryServices.DirectoryEntries = myDE.Children Dim oUserDE As DirectoryServices.DirectoryEntry = myEntries.Add("CN=" + username, "user") oUserDE.CommitChanges() oUserDE.Properties("profilePath").Value = "\\\" & username & "\profile" oUserDE.Properties("scriptPath").Value = strlogons oUserDE.Properties("samACcountName").Value = username oUserDE.Properties("scriptPath").Value = strlogons oUserDE.Properties("userPrincipalName").Value = username oUserDE.Properties("description").Value = "User" oUserDE.Properties("pwdLastSet").Value = "0" oUserDE.Properties("givenName").Value = strFirstname oUserDE.Properties("sn").Value = strSurname oUserDE.Properties("displayName").Value = strFirstname & " " & strSurname oUserDE.Properties("description").Value = "User" oUserDE.Properties("givenName").Value = strFirstname oUserDE.Properties("sn").Value = strSurname oUserDE.Properties("homeDirectory").Value = "\\" & System.Configuration.ConfigurationManager.GetSection("MyAppSettings")("server") & "\" & username & "$" & "\files" oUserDE.Properties("homeDrive").Value = strhdrive oUserDE.CommitChanges() End Sub And that should alow you to add users to your AD (finger crossed) If I have time I'll post the search and display code. Please beware that this works on my domain and servers and i have not tested it on any other servers. Be careful of the word wrapping Tom
Rozzer Posted February 22, 2006 Posted February 22, 2006 Any chance you could release something for our needs Ross
uk101man Posted February 22, 2006 Posted February 22, 2006 Well I would love too but I'm not to sure the Partnership I work for would allow it because they are paying my salary and I’m developing the application at work. I'm working on two version, an ASP version which i've scaled back to searching for Users, Displaying user information and resetting passwords. I came accross some wired errors when i rolled the fall working application to IIS so I scaled it back. I would say this is 99.2% completed!!! The windows version is kicking a@@ at the moment and i might upload a lite version to ever growing Edugeek tom
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now