1. Open the console ("START" | "run" and enter: MMC)
2. "file" menu | "Add/delete Management Unit" | "add..." | select "security template" | "close ".
3. On the "C: \ WINDOWS \ SECURITY \ templates" node, right-click "create template... ", in the pop-up dialog box, enter" new "in" Template Name ", and click OK.
4. Open the "New | Local Policy | user permission assignment" node and add the user to be granted this permission in "Log on as a server" on the right.
5. Right-click the new node and choose Save As... to save it to C: \ sec. INF ".
6. In the batch Creation Document, enter SeCEdit Configure/DB SeCEdit. sdb/CFG c: \ sec. INF.
The SQL Server database synchronization function is used in the new project in the past two days.ProgramThe Logon account of the SQLServerAgent service is automatically added during installation.
The following describesCodeFor your reference.
-- Install msde2000
If (Not registry. doeskeyexist (HKEY_LOCAL_MACHINE, " Software \ Microsoft \ MSSQLServer \ setup " ) Then
Shell. Execute (sessionvar. Expand ( " % Appfolder % \ msde2000 \ setup.exe " ), " Open " , "" , "" , Sw_shownormal, True );
End
-- Append the database after restart and automatically add synchronization jobs.
File. runonreboot (sessionvar. Expand ( " C: \ Program Files \ database \ setup. cmd " ), "" );
-- Add a Windows User
Shell. Execute ( " Net " , " Open " , " User SQLAgent 123456/Add/passwordreq: yes/passwordchg: No/expires: Never " , "" , Sw_minimize, True );
-- Add a user to the Administrator Group
Shell. Execute ( " Net " , " Open " , " Localgroup administrators SQLAgent/Add " , "" , Sw_minimize, True );
-- Set the Logon account, password, and start type of the SQLServerAgent service to automatic.
Shell. Execute ( " SC " , " Open " , " Config SQLServerAgent start = auto OBJ =. \ SQLAgent Password = 123456 " , "" , Sw_minimize, True );
-- Hide this user when Windows is started.
Shell. Execute ( " Regedit " , " Open " , " /S c: \ hidesqlagent. Reg " , "" , Sw_minimize, True );
-- Grant this user the "service-based login right" and "Deny local login"
Shell. Execute ( " SeCEdit " , " Open " , " /Configure/DB SeCEdit. sdb/CFG c: \ sec. inf " , "" , Sw_minimize, True );
-- Clear temporary files
Folder. deletetree (sessionvar. Expand ( " % Appfolder % \ msde2000 " ), Nil );
File. deleteonreboot ( " C: \ hidesqlagent. Reg " );
File. deleteonreboot ( " C: \ sec. inf " );
-- Restart the computer after installation.
_ Needsreboot = True ;