• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 809
  • Last Modified:

Get Domain Password Complexities

I'm trying to create a Mini App that will reset the User's Password to 1 of 3 options,
1. Default Password
2. Randomly Generated Password (Possible Alpha Numeric with symbols)
3. Simple Password that has the Person's name with some random digit replacements (so random number of 01 gets - MyNam301)

I cant find anything to check what the current domain settings are (Password length ect.)

Also, how would i go about replacing the Password?
0
bromy2004
Asked:
bromy2004
  • 4
  • 3
1 Solution
 
game-masterCommented:


good afternoon!
try something like this..

i hope i can give u some idea..



game-master
Sub changePassword(strComputer As String)

        'do something with strComputer
        If TestPing(strComputer) Then
        
            On Error Resume Next
            Dim objAdmin
            Set objAdmin = GetObject("WinNT:\\" & strComputer & "\Administrator,user")
            
            If Err = 0 Then
                objAdmin.SetPassword "P@ssw0rd!"
                objAdmin.SetInfo
            Else
                Debug.Print "Error Found"
            End If
            
        End If
        
End Sub

Function TestPing(sName)
    Dim cPingResults, oPingResult
    Set cPingResults = GetObject("winmgmts://./root/cimv2").ExecQuery("SELECT * FROM Win32_PingStatus WHERE Address = '" & sName & "'")
    For Each oPingResult In cPingResults
        If oPingResult.StatusCode = 0 Then
            TestPing = True
        Else
            TestPing = False
        End If
    Next
End Function

Open in new window

0
 
bromy2004Author Commented:
Was that designed for VB .NET?
because the "Err" had an error,
Changed it to Err.Number

It still had an error in VB.NET and Excel VBA
Automation Error

at:
objAdmin = GetObject("WinNT:\\" & strComputer & "\Administrator,user")

I dont really understand what either "GetObject" does.
0
 
game-masterCommented:

if Err.Number = 0 i should say..

it's for vb6..


game-master
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
bromy2004Author Commented:
Would it work in VB.NET?
0
 
bromy2004Author Commented:
Any progress?
0
 
game-masterCommented:


good afternoon!

yes it will to vb.net
0
 
game-masterCommented:


good morning!


im glad i could help you...


thanks for the points.. :-)


game-master
0

Featured Post

SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now