473,698 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

changing admin password

BP
Can anyone point me to some C# code/info that would allow me to change the
Administrator password on a remote machine in a workgroup? Not a domain, no
Active Directory present. I realize I need to know the current password.
I've written code to extractall kinds of WMI info from these machines
remotely, so am familiar with the need to connect and authenticate. I've
even been successful importing the Netapi32.dll and using the
NetUserChangePa ssword call, however this seems to take 30 to 45 seconds per
machine to complete. I've seen VBScript to do the same, but would like to
control this within my C# pgm. Thanks
Nov 16 '05 #1
1 5883

"BP" <vz******@veriz on.net> wrote in message
news:eB******** ******@TK2MSFTN GP09.phx.gbl...
Can anyone point me to some C# code/info that would allow me to change the
Administrator password on a remote machine in a workgroup? Not a domain,
no Active Directory present. I realize I need to know the current
password. I've written code to extractall kinds of WMI info from these
machines remotely, so am familiar with the need to connect and
authenticate. I've even been successful importing the Netapi32.dll and
using the NetUserChangePa ssword call, however this seems to take 30 to 45
seconds per machine to complete. I've seen VBScript to do the same, but
would like to control this within my C# pgm. Thanks


Not sure why NetUserChangePa ssword takes 30-45 seconds, but it looks like
you have a network problem.
You can use DirectoryServic es (ADSI wrappers) namespace classes to manage
user accounts on remote system, note however that ADSI is using
NetUserChangePa ssword under the covers, so you will probably have the same
issue as calling NetUserChangePa ssword.

using System.Director yServices;
....

// bind to remote system using WinNT provider using user credentials with
sufficient privileges to execute a changepassword!
string userPath = "WinNT://machineName/administrator";
DirectoryEntry userEntry = new DirectoryEntry( userPath, "remoteadmi n",
"pwd", AuthenticationT ypes.Secure);
object[] password = new object[] {"oldpwd", "newpwd"};
object ret = userEntry.Invok e("ChangePasswo rd", password );

userEntry.Commi tChanges();

Willy.
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2795
by: Candice | last post by:
Please somebody help! I've deleted my admin username and password which was initially set at test. Now I can't log into my website as the administrator. How do I put Username and Password back so that I can set my own password and username again, log in to my website and edit it. Which file do I have to edit, and where do I re-set the Username and Password? --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system...
5
37995
by: D E | last post by:
When using my web application manager (http://localhost:8080/admin) I forgot my password. Is there an XML file i can look at to remember/obtain (possibly even set). Thanks
4
3842
by: ecPunk | last post by:
Hi, We have a web application where we want a user to be able to change his/her password if the password has expired but we are unable to do this with ASP (at the moment) because we can't log the user into the database without a valid password. We do not want to store any "admin" user info to connect to the database to change the users password for security issues. Does anyone have any ideas of how we could go about doing this? Any...
1
3142
by: Kristen | last post by:
Hi, I'm not sure if this can be done or not but here goes... I write an application that uses Access and an MDW file to control who can open the database. Right now I have a bunch of different customers and we distribute the same MDW file to each customer. This MDW file has one username/password in it that gives access to an Administrator to open the database and make changes. None of the customers have this username/password, just me. ...
2
410
by: - Steve - | last post by:
I'm trying to change a user's password using objUser.Invoke("setPassword", "newpassword") It works fine as a console application if I'm logged in with someone with the correct permissions. If I'm logged in as a normal user it doesn't work, even though call before that, objUser.Username = "admin@domain.com" objUser.Password = "adminpassword"
7
1402
by: Luis Mendes | last post by:
Hello, I've a application in VB.NET that uses a connection to a Access data base stored in my Hard Drive. How can I change the location of the database (To a network) and change the conection string? In VB6 this was very easy, but under VB.NET I'm not able to do it.
1
2173
by: VB Programmer | last post by:
Using ASP.NET 2.0 Web Site Admin Tool. Under Security tab it says this: Click a row to select a user and then click Edit user to view or change the user's password or other properties. When I click "Edit user" I do NOT see ANYWHERE to change the users password. Am I missing something?
3
2460
by: bmoore | last post by:
I am just beginning to implement user-level security in Access 2003. I created a user account and it is assigned to the users group. I would like to assign a password for this account (or for the users group), but am not given the option to do so. (I am trying under Tools > Security > User and Group Accounts > Change Logon Password.) Only the admin userid is available. Is it because there is currently no password assigned for admin that I...
2
2739
by: JOHNSHELL08 | last post by:
Dear Team, There is a problem related to change ip address there in my network a domain admin user is exist and user knows its password and by this they are able to login with this account and change ip address for working with broadband and user access personal web id etc. so i want to prevent this through applying a policy on ip changing.and i want this should be done by window default utility not any third party software .and...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7732
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.