From: SavindraSingh on
Hi all,

I need a VB script code to verify whether a specific Local user ID on
a remote machine, in workgroup, is having a specific password. For
instance I need to check whether target machine consists a local user
"DSADMIN" 's password set to "Pa55word". If the target machine
consists this user account and the password is also correct then it
should return TRUE else it should return FALSE (or something similar).

Below code tries to reset the password on target machine by providing
same old and new password, if it fails that means the password set on
target machine is not standard password ("Pa55word") and if it is
successful that means the userID on target PC is using a different
password. But due to Password history group policy its failing.

• oUser = "DSADMIN"
• oPassword = "Pa55word"
• oDomain = strComputer
•
• On Error Resume Next
•
• Set objUser = GetObject("WinNT://" & oDomain & "/" & oUser & ",
user")
•
• objUser.ChangePassword oPassword, oPassword
•
• Select Case Err.Number
• Case 0
• objFile.Write strComputer & ", Standalone," & " YES," & " Correct
Password" & vbCrLf
• Case Else
• objFile.Write strComputer & ", " & err.Number & ", NO," &
err.description & vbCrLf
• End Select
•

I am sure there can be some other way to achive this because this is a
very common requirement to verify the user credentials on a remote PC
and return with the results.

Please HELP!!! I need this code urgently to save on efforts required
to do some urgent bulky tasks.
From: Pegasus [MVP] on


"SavindraSingh" <savindrasingh(a)gmail.com>
news:fb3db9ab-37af-4499-af5e-102282ae80d9(a)u8g2000prd.googlegroups.com...
> Hi all,
>
> I need a VB script code to verify whether a specific Local user ID on
> a remote machine, in workgroup, is having a specific password. For
> instance I need to check whether target machine consists a local user
> "DSADMIN" 's password set to "Pa55word". If the target machine
> consists this user account and the password is also correct then it
> should return TRUE else it should return FALSE (or something similar).
>
> Below code tries to reset the password on target machine by providing
> same old and new password, if it fails that means the password set on
> target machine is not standard password ("Pa55word") and if it is
> successful that means the userID on target PC is using a different
> password. But due to Password history group policy its failing.

Every attempt at validating an account name/password is subject to your
current password policy. If some script allowed you to get around this
policy then this would allow a hacker to keep on trying with an automatied
script until successful. In other words, a huge security hole.

From: Pegasus [MVP] on


"SavindraSingh" <savindrasingh(a)gmail.com> schrieb im Newsbeitrag
news:fb3db9ab-37af-4499-af5e-102282ae80d9(a)u8g2000prd.googlegroups.com...
> Hi all,
>
> I need a VB script code to verify whether a specific Local user ID on
> a remote machine, in workgroup, is having a specific password. For
> instance I need to check whether target machine consists a local user
> "DSADMIN" 's password set to "Pa55word". If the target machine
> consists this user account and the password is also correct then it
> should return TRUE else it should return FALSE (or something similar).
>
> Below code tries to reset the password on target machine by providing
> same old and new password, if it fails that means the password set on
> target machine is not standard password ("Pa55word") and if it is
> successful that means the userID on target PC is using a different
> password. But due to Password history group policy its failing.
>
> � oUser = "DSADMIN"
> � oPassword = "Pa55word"
> � oDomain = strComputer
> �
> � On Error Resume Next
> �
> � Set objUser = GetObject("WinNT://" & oDomain & "/" & oUser & ",
> user")
> �
> � objUser.ChangePassword oPassword, oPassword
> �
> � Select Case Err.Number
> � Case 0
> � objFile.Write strComputer & ", Standalone," & " YES," & " Correct
> Password" & vbCrLf
> � Case Else
> � objFile.Write strComputer & ", " & err.Number & ", NO," &
> err.description & vbCrLf
> � End Select
> �
>
> I am sure there can be some other way to achive this because this is a
> very common requirement to verify the user credentials on a remote PC
> and return with the results.
>
> Please HELP!!! I need this code urgently to save on efforts required
> to do some urgent bulky tasks.

It seems there is a function in Excel to detect a non-blank cell. Here is a
working script sample, this time without errors:

Function sBlankCell
Const xlCellTypeBlanks = 2
oSheet.UsedRange.SpecialCells(xlCellTypeblanks).Activate
sBlankCell = oExcel.ActiveCell.Address
End Function

You may have to experiment a little to find out what number to use for your
special cells. 2 stands for the first cell to contain some value (but not a
formula). 11 stands for the last non-blank cell. Other numbers have meanings
that I do not currently know.

From: Pegasus [MVP] on


"mr_unreliable" <kindlyReplyToNewsgroup(a)notmail.com> schrieb im Newsbeitrag
news:#SmRZ9NfKHA.656(a)TK2MSFTNGP04.phx.gbl...
> Pegasus [MVP] wrote:
>> It seems there is a function in Excel to detect a non-blank cell.
>
> hi Pegasus [MVP],
>
> I think you may have intended to post this in
> another thread.
>
> cheers, jw

I did too. Thanks for pointing it out.