473,725 Members | 2,271 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change Local administrator PSWD code needed

We have a request from Auditing to modify the password an a local
workstation administrative account every 90 days. We are developing two
programs - a VB6 GUI program that will allow the administrative support
person to enter a new password into an App and have that encrypted password
saved in a text file. The second part is a VB6 program that only is a
command line program that will open the password text file, read the
encrypted password, de-encript it using the same logic that created it, and
then resets a specific local administrors account to the new password.

We already have the program that will encrypt a clear text password and save
that encrypted password to a file. We also have enough of the command line
program written that will read the password file, de-encrypt the password
stored in the file and then (for now only) will display the de-encrpted
password on the screen.

What I need to know is the remaining portion of code that will allow me to
actually reset a specific local administrator's account to the new password.
Note the code will be run using the machine's system account.

Does anyone have the code they can share with me that will perform the
password change? If so, please post the code in the reply.

Thanks,
Jan 29 '07 #1
3 7938

"W C Hull" <su************ *************** ***********@hot maill.comwrote in
message news:bNcvh.546$ Xf4.270@trndny0 9...
We have a request from Auditing to modify the password an a local
workstation administrative account every 90 days. We are developing two
programs - a VB6 GUI program that will allow the administrative support
person to enter a new password into an App and have that encrypted
password saved in a text file. The second part is a VB6 program that only
is a command line program that will open the password text file, read the
encrypted password, de-encript it using the same logic that created it,
and then resets a specific local administrors account to the new password.

We already have the program that will encrypt a clear text password and
save that encrypted password to a file. We also have enough of the
command line program written that will read the password file, de-encrypt
the password stored in the file and then (for now only) will display the
de-encrpted password on the screen.

What I need to know is the remaining portion of code that will allow me to
actually reset a specific local administrator's account to the new
password. Note the code will be run using the machine's system account.

Does anyone have the code they can share with me that will perform the
password change? If so, please post the code in the reply.

Thanks,
I would recommend strongly against using a file. What happens if a user
deletes the file?
Does the password revert back to the default? Any outcome would be a
security hole.

Use the registry and simply encrypt and decrypt appropriately. You can even
include
a time hash in which case a password of let's say "DOG" would be encoded
differently from
one PC to another.
Jan 30 '07 #2
Raoul,

Thanks for the reply. Well, here are some more details......

We have about 4000 workstations on several different domains that all have 1
local workstation administrator account that has the same account name and
same password. We have it setup that way specifically so that IT support
personal can perform maintenance on the machine locally without having to
authenticate to the domain and be logged on with a domain account. Yes, I
agree that putting the information into a file is bad business but it may be
difficult for us to get the encrypted password into the registry without
something being able to push the encrypted key to the registry somehow. Our
thought was to put the encrypted text file and the program to set reset the
password on the domain controllers in and run the application as a machine
script each time the machine is restarted. By putting the code up on the
DC's where write acccess is VERY limited we get around the issue of someone
that is unauthorized from deleting the file. Since we were going to run
the script as a group policy machine script all we need is the actual
command line command or better yet, a native VB6 function that would
arbitrarily set the password to the new password without knowing the
existing password to perform the password reset. This program would contain
a de-encrypt function with the same hash that was used to create the key.
This program would read the encrypted password, deencrypt the password and
then set the password of the local administror's account to the new
password.

So.....Do you know the command to execute the password change either through
a command line program or though a VB6 subroutine or function.

"Raoul Watson" <Wa*****@Intell igenCIA.comwrot e in message
news:%wEvh.4849 $yB5.1299@trndn y03...
>
"W C Hull" <su************ *************** ***********@hot maill.comwrote
in message news:bNcvh.546$ Xf4.270@trndny0 9...
>We have a request from Auditing to modify the password an a local
workstation administrative account every 90 days. We are developing two
programs - a VB6 GUI program that will allow the administrative support
person to enter a new password into an App and have that encrypted
password saved in a text file. The second part is a VB6 program that
only is a command line program that will open the password text file,
read the encrypted password, de-encript it using the same logic that
created it, and then resets a specific local administrors account to the
new password.

We already have the program that will encrypt a clear text password and
save that encrypted password to a file. We also have enough of the
command line program written that will read the password file, de-encrypt
the password stored in the file and then (for now only) will display the
de-encrpted password on the screen.

What I need to know is the remaining portion of code that will allow me
to actually reset a specific local administrator's account to the new
password. Note the code will be run using the machine's system account.

Does anyone have the code they can share with me that will perform the
password change? If so, please post the code in the reply.

Thanks,
I would recommend strongly against using a file. What happens if a user
deletes the file?
Does the password revert back to the default? Any outcome would be a
security hole.

Use the registry and simply encrypt and decrypt appropriately. You can
even include
a time hash in which case a password of let's say "DOG" would be encoded
differently from
one PC to another.


Jan 31 '07 #3

"W C Hull" <su************ *************** ***********@hot maill.comwrote in
message news:%ySvh.6075 $yB5.4652@trndn y03...
<SNIPSo.....D o you know the command to execute the password change
either through a command line program or though a VB6 subroutine or
function.
<SNIP>

If you have admin or can emulate admin access and know the previous password
(or previous is blank) then you probably can use "NetUserChangeP assword"
from Netapi32.dll to do this.

If you want, email me and I'll send you a sample code.
Feb 1 '07 #4

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

Similar topics

1
5670
by: Tony Girgenti | last post by:
Hello. I'm trying to write a simple VS.NET 2003 VB program to delete files and directories on my hard drive. If the directory is read only, how do i change it's attribute so that i can delete it ? Here is some of my code. It does not error out, it just does not delete the directories. Any help would be gratefully appreciated even ideas on another way to do this.
6
2200
by: a_hartmann_andersen | last post by:
Hi Guys Here is the problem: Im bored changing the local administrator password for a set of servers in a domain. So I though that I would write myself a little tool in C# to do that. I found bits and pices but the subject, but not anything solid. Ofcause its out there :-) can anybody help me out on this. Thanks!
29
2820
by: Tony Girgenti | last post by:
Hello. I'm developing and testing a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2 computer. I'm using a web form. How do I move this project/solution from a local development xp pro computer which uses IIS/localhost, to another xp pro computer that is on a Windows 2003 server domain. I want to be able to use the Windows 2003 server IIS instead of localhost.
5
5539
by: TravisTurman | last post by:
I'm a C# newbie and have inherited a program that runs at login. Part of the program looks at a text file to see which version is installed and then installs the latest greatest version if needed. In order for this to work, the person logging into the Windows XP desktop needs to have local admin rights on the machine. Is there a way using C# to give the current user the necessary rights, or put them in the local administrators group,...
11
26611
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package and PEAR is in c:\wamp\php\pear I modified php.ini in the c:\wamp\php directory to reflect the actual path, but even stopping and restarting my server shows the c: \php5\pear path. I can't change it no matter what I do I also tried the...
8
4452
by: Michael Howes | last post by:
I have some code that manages local user logins. When I create a new user I want to set the password to expire every x days and the number of failed login attempts before the account is disable/locked out. I can't seem to figure out how. I saw two properties in MSDN BadPasswordAttempts and MaxPasswordAge but I can't seem to set them on the new user. my code looks like this DirectoryEntry newUser = null; ;
1
3509
by: Michael Howes | last post by:
I would think this would be very, very easy but in the 50 searches I've done I haven't found anything. If our application requires login and that user/password be a local windows account or more detailed, a user that has been added to the Power Users group that is either a local account or a active directory account how do I authenticate? I've found code that seems to do this against Active Directory
1
3555
by: lonewolfbw | last post by:
I have the following VBScript which I can execute from my workstation (I am a domain admin), in order to change the local computer's administrator password. However, I am noticing an oddity. First, the script: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set objOU = GetObject("LDAP://OU=test, DC=mycompany, DC=com") objOU.Filter = Array("Computer") For Each objItem in objOU strComputer = objItem.CN
2
5337
by: =?Utf-8?B?bXVyYWRqYW1lcw==?= | last post by:
Yes, sorry I tried to make it clear in the original question that I want to get the user token of the service - ie. the account the service is running under. I know services don't have user tokens - I suspect users do have tokens, hence "user token", otherwise we might call them "service tokens" or somesuch :-) If you read the question again, you migh see that the fundamental question is, *assuming there is no other approach*: The...
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
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
9179
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,...
1
6702
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
4519
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...
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
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.