GPO logon script to change password administrator on domain

You want to set this script on
Computer configuration >> Windows setting >> Scripts/start up script




'-------------------------------------------------------------------------------------
' Change Administrator and Guest accounts on Server (Windows Server 2003)
On Error Resume Next

Dim objUser
Dim newPassword
Dim CompName
Dim WshShell
Dim WshEnv

'Set the Username & Password below
'------------------------------------------------------------------------------------------
LocalAdmin = "administrator"
newPassword = "sysadmin_pass"
LocalBackup = "guest"
newPassword1 = "guest_pass"
'------------------------------------------------------------------------------------------

Set WshShell = CreateObject("WScript.Shell")
set WshEnv = WshShell.Environment("Process")
CompName = WshEnv("COMPUTERNAME")

' Connect to the computer\administrator account
Set objUser = GetObject("WinNT://" & CompName & "/" & LocalAdmin, user)
Set objUser1 = GetObject("WinNT://" & CompName & "/" & LocalBackup, user)

'Set the password for the Administrator account
objUser.SetPassword newPassword
objUser.SetInfo

'Set the password for the Guest account
objUser1.SetPassword newPassword1
objUser1.SetInfo

' Clears up the environment
Set WshShell = nothing
Set WshEnv = nothing
Set objuser = nothing

'msgbox "Local Account = " & LocalAdmin & " Password Changed Sucessfully"
'-------------------------------------------------------------------------------------





.

ความคิดเห็น

บทความที่ได้รับความนิยม