Last post Apr 30, 2013 06:20 PM by dehaggard
Apr 30, 2013 03:29 PM|mcnitt89|LINK
I want to have a page on my internal website written in asp.net/vb that the helpdesk can go to and do the following functions:
unlock user accounts, reset passwords, change passwords.
possible adding the ability to add and remove user accounts from groups in AD.
how hard is this to code? im not that great at coding - still learning.
Apr 30, 2013 04:40 PM|dehaggard|LINK
Just happens that I posted code that, with minor modifications, will do what you want. The AccountManagement namespace that I am using has functions to Reset and to Change Passwords.
For example, for the user to change her password-- on the UserPrincipal object, you would call:
See the code here:
Just 'cuz mine ain't workin' don't mean it won't work for you. I think there's something screwy in our Active Directory.
Apr 30, 2013 04:44 PM|mcnitt89|LINK
is this in C# ? i have my page written in vb.
Apr 30, 2013 05:33 PM|dehaggard|LINK
Yes. It's C#.
There are two web sites that I find invaluable. Copy and paste C# code in, and get VB code out. Or vice-versa.
So just copy and paste the code I directed you to, click the Coinvert button, and you're set.
By the way, since you professed up front to be relatively new, I strongly recommend to all .NET developers that they get comfortable in BOTH C# and VB. Don't let anybody tell you that one is better than the other. I personally prefer VB, but right now I'm
working in C#. Just takes me a few days to switch gears when I change projects. And every so often I still enter "Dim ...." in a C# block, or put a semicolon at the end of a VB line. Anyway, don't limit yourself to one language, or (in my opinion) you're limiting
your earnings potential.
Apr 30, 2013 05:38 PM|mcnitt89|LINK
Awesome. here is a dumb question. how on the page can i get the helpdesk guy to browse for the user that he or she needs to modify prior to making the account change. im basically buiding this from scratch.
Apr 30, 2013 05:49 PM|dehaggard|LINK
Use a PrincipalSearcher or a DirectoryEntry Searcher to "FindAll" users in the directory. You would have to connect the searcher to the place(s) where users are registered.
Then it depends on how many users you have. If there are less than 50 or so, then you could use a DropDownList to select an individual. Or more likely, you will want to use a DataGrid with paging enabled. I get all the "first letters" of a list, then build
a horizontal line of links from those letters, Click one, and I re-bind the DataGrid with users starting with that letter. Shortens the display a bunch.
Get used to this documentation:
Apr 30, 2013 05:52 PM|mcnitt89|LINK
is there anyway possible you can email me an example of the second part of that? i would love to know how to do that for other parts of this project as well. the datagrid with paging and tying it to a search and building horizontal line of links from the
letters then re-bind., that sounds awesome and i want to learn that.
Apr 30, 2013 05:58 PM|thirumaran007|LINK
pleaes have read these threads
Apr 30, 2013 06:20 PM|dehaggard|LINK
I'll send you more extensive code tomorrow morning, if you will send an e-mail address. Send it to dehaggard (at) gmail (dot) com.