Bu kodlama yazımız Windows xp'de Kullanıcı Hesabı oluşturup ve Kullanıcı Grubunu Belirliyor.Az sonra aşağıda verilecek kodları bir metin belgesinin içine kayıt ediniz.Dosya>Farklı Kaydet komutunu veriniz ve ardında bir iletişim kutu belirlerecek burada önce dosya türü olarak TÜM DOSYALAR isim olarak yerel_kullanici_yarat_ve_gruba_ekle ve yerel_kullanici_yarat_ve_gruba_ekle_2.vbs olarak atayınız saklayınız.
yerel_kullanici_yarat_ve_gruba_ekle
Kod: Tümünü seç
' specify account to create
strAccount = "BURYA KULLANICI ADI YAZILACAK"
strPswd = "BURAYA ŞİFRE YAZILACAK"
' 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
Kod: Tümünü seç
' name of user to be created
sNewUser = "BURAYA KULLANICI ADI YAZILACAK"
strPswd = "BURAYA ŞİFRE YAZILACAK"
' name of the group the user is to be added to
sGroupname = "Administrators"
' get computer name
Set oWshNet = CreateObject("WScript.Network")
sComputerName = oWshNet.ComputerName
' connect to the Winnt provider
Set oComputer = GetObject("WinNT://" & sComputerName)
' create the user
Set oUser = oComputer.Create("user", sNewUser)
oUser.SetPassword ""
On Error Resume Next
' save the user
oUser.Setinfo
' If user exists already or password restrictions
' are not fulfilled, we get an error
If Err.Number = 0 Then
' configure the user
On Error Goto 0
' Enable "User Must Change Password at Next Logon"
oUser.Put "PasswordExpired", 1
oUser.Setinfo
End If
On Error Goto 0
Herkese İyi Günler
TRWE_2012
Düzce/Akçakoca
:oops: :oops: :oops: :) :) :)