473,544 Members | 680 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 7923

"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
5660
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...
6
2188
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
2787
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...
5
5523
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...
11
26540
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...
8
4416
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...
1
3500
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? ...
1
3531
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...
2
5326
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...
0
7429
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...
0
7368
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...
0
7614
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. ...
0
7713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5916
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...
1
5301
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...
1
1844
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
990
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
671
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...

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.