Aşağıdaki script sisteminizdeki client bilgisayarların,domain controller ile aynı saat ayarlarını almasını sağlar.Uzantısını vbs olarak kaydedin ve gpo ile domain ortamınıza uygulayın
servername yazan yere kendi dc sunucu isminizi yazmayı unutmayınız.
Kod şöyle;
Dim wshell
Set wshell = CreateObject(”WScript.Shell”)
wshell.Run “%COMSPEC% /c net time \\servername /set /y”,0,TRUE
set wshell = Nothing
Her sistemcinin arşivinde bulunması gereken kod arşivini aşağıdaki linkten indirebilirsiniz.
Bu script sayesinde bilgisayar üzerinde yeni bir local user account yaratılmış, bu local user account’a bir password atanmış ve account ilgili gruba member edilmiş olur. Bununla birlikte account için “password never expires” ayarıda enable olur yani password süresiz olarak geçerlidir.
Script içerisinde strAccount, strPswd ve son bölümdeki Set objGroup satırında grup bilgisini düzenlemeyi unutmayın.
' specify account to create
strAccount = "Ozgur"
strPswd = "123456"
' get local computer name
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
' check if local account already exists
intExists = 0
Set colAccounts = GetObject("WinNT://" & strComputer & "")
colAccounts.Filter = Array("user")
For Each objUser In colAccounts
If objUser.Name = strAccount Then
intExists = 1
End If
Next
If intExists = 0 Then
' create local user
Set colAccounts = GetObject("WinNT://" & strComputer & "")
Set objUser = colAccounts.Create("user", strAccount)
' set pswd
objUser.SetPassword strPswd
objUser.SetInfo
' set pswd never expires
Set objUser = GetObject("WinNT://" & strComputer & "/" & strAccount & ",User")
objUserFlags = objUser.Get("UserFlags")
objPasswordExpirationFlag = objUserFlags Or ADS_UF_DONT_EXPIRE_PASSWD
objUser.Put "userFlags", objPasswordExpirationFlag
objUser.SetInfo
' add to local admins group
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
Set objUser = GetObject("WinNT://" & strComputer & "/" & strAccount & ",user")
objGroup.Add(objUser.ADsPath)
End If