Page 1 of 1 1
Topic Options
#199746 - 2010-09-03 11:59 AM Check if a local user has a password (Not Domain)
Mockillo Offline
Fresh Scripter

Registered: 2010-09-03
Posts: 5
Loc: NORWAY
Hello.

I am using a KIX script to do some maintenance on our clients computers.
These computers are not in any domain, as they usually just have 1-3 computers around.

I would like to setup automatic logon on these, and most of them don't have any password but still show the logon screen when they boot. Is there a way I can check if they have a password set? So I know which I can add automatic logon for and not.

Oh, and these are mostly XP clients, but also a few W7.

Thanks \:\)


Edited by Mockillo (2010-09-03 12:00 PM)
Edit Reason: Added OS info

Top
#199747 - 2010-09-03 12:48 PM Re: Check if a local user has a password (Not Domain) [Re: Mockillo]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Not sure, but will this help? Windows XP Automatic Login
Top
#199748 - 2010-09-03 12:51 PM Re: Check if a local user has a password (Not Domain) [Re: BradV]
Mockillo Offline
Fresh Scripter

Registered: 2010-09-03
Posts: 5
Loc: NORWAY
That's what I'm going to do yes, but I need to know if the current user has a password set first. If I set up automatic logon for a user with no password it wont work if that user has a password set on his account.
Top
#199749 - 2010-09-03 01:09 PM Re: Check if a local user has a password (Not Domain) [Re: Mockillo]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Sorry. How about: Microsoft baseline security analyzer ?
 Quote:
Local Account Passwords

This check identifies any local user accounts that are using blank or simple passwords. This check is not performed on domain controllers. As a security measure, Windows Server 2003, Windows XP and Windows 2000 operating systems all require user authentication through passwords. However, the security of any system depends on both technology and policy - the manner in which systems are set up and managed. This check enumerates all user accounts and checks for the following passwords:

* Password is blank
* Password is the same as the user account name
* Password is the same as the machine name
* Password uses the word "password"
* Password uses the word "admin" or "administrator"

This check also notifies you of any accounts that have been disabled, or are currently locked out.


I'll keep thinking. \:\)

Top
#199751 - 2010-09-03 01:26 PM Re: Check if a local user has a password (Not Domain) [Re: BradV]
Mockillo Offline
Fresh Scripter

Registered: 2010-09-03
Posts: 5
Loc: NORWAY
Good find, but I was hoping for something I can use within Kix, as I want to do different things based on what I find out about the password.
Top
#199752 - 2010-09-03 01:35 PM Re: Check if a local user has a password (Not Domain) [Re: Mockillo]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Here is another one. It should be easy to re-write in kix. I think one of the "password" values should tell you if there is a password or not. List Loca User Accounts with WMI
Top
#199753 - 2010-09-03 01:44 PM Re: Check if a local user has a password (Not Domain) [Re: BradV]
Mockillo Offline
Fresh Scripter

Registered: 2010-09-03
Posts: 5
Loc: NORWAY
The "Password Required" column returned there sounds like the thing I need. And this is also an excellent oppertunity to learn more advanced kix.

Thank you very much for finding that, I must've missed since all my searches were kix related. \:\)

Top
#199757 - 2010-09-03 02:26 PM Re: Check if a local user has a password (Not Domain) [Re: Mockillo]
Mockillo Offline
Fresh Scripter

Registered: 2010-09-03
Posts: 5
Loc: NORWAY
 Code:
	$oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"+@WKSTA+"\root\cimv2")
	If @ERROR Exit @ERROR EndIf
	$oWMIOutput = $oWMI.ExecQuery("Select * from Win32_UserAccount Where LocalAccount = True")
	If @ERROR Exit @ERROR EndIf
	for each $account in $oWMIOutput
		if $account.Name = @USERID
			$passwordreq = $account.PasswordRequired
		endif
	next 


This did the trick, thank you \:\)

Top
#199763 - 2010-09-03 04:26 PM Re: Check if a local user has a password (Not Domain) [Re: Mockillo]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Great!
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 320 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.058 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org