Novell Home

Selecting Between Admin Passwords

Novell Cool Solutions: Tip
By Christian Roth

Digg This - Slashdot This

Posted: 29 Oct 2004
 

We have two different Admin passwords. One for laptops, which have a hostname starting with "id", and one for all desktops. The problem is, when I change the password with the DOS command "net user administrator <password>", it will change both passwords!

I wrote a little VBS script, which checks the hostname and decides which password to set. It is executed every time the user logs on.

Set wshnetwork=wscript.createobject("wscript.network")
Dim usr, computer
computer=wshnetwork.computername
Set usr = GetObject("WinNT://" & computer &"/administrator,user")

If LCase(Left(computer, 2)) = "id" Then
		usr.SetPassword "password"
Else
		usr.SetPassword "other_password"

End If
wscript.quit ()

If you have any questions you may contact Christian at christian.roth@gkndriveline.com


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell