Một số điều cần biết về quá trình Sysprep
trên Windows 7 – P.1
Trong bài viết dưới đây, chúng tôi sẽ gii thiu những thao tác cơ bản v quá trình to
Sysprep trong Windows 7. Trên thc tế đã có rt nhiều bài hướng dn v cách thc này
trên h điều hành Microsoft Windows XP, nhưng để áp dụng được vi Windows 7 thì
không phải là điều đơn giản.
Nhng công c cn thiết trong bài th nghim này:
- WAIK (Windows Automated Installation Kit) được cài trên máy tính không dùng để tạo file
image. Nếu muốn to file unattend.xml trong toàn b quá trình sysprep này, chúng ta sẽ phải
cần ti file image.wim trên đĩa cài đặt của Windows 7.
- Công cMysysprep2
Về cơ bản, quá trình thực hiện của chúng ta sẽ dựa theo trình tự sau: sau khi cài đặt Windows 7
trên máy tính, đăng nhập vào bằng account domain đã được gán quyền Administrator (và đã
được gán vào nhóm Administrators). Tài khoản này không được phép sử dụng bất kỳ script hoặc
policy nào, trong bài thnghiệm này, chúng tôi sử dụng account domain (với tên là imageprep),
các phần mm cần cài đặt sẽ được lưu trữ trên thư mục DFS chia sẻ. Khi thực hiện hệ thống
theo cách này thì tất cả các ứng dụng khi muốn repair sẽ dễ dàng tìm được file cài đặt gốc. Sau
đó, chúng ta sẽ cài tất cả các chương trình cần thiết, cập nhật Windows, tạo các tài khoản local,
thiết lập chế độ profile... theo ý muốn. Toàn b profile này sẽ trở thành profile mặc định của máy
tính sau này trong file image.
Khi mi thứ đã được chuẩn bị kỹ càng, chúng ta sẽ phải tạo file answer unattend.xml bằng công
cWindows System Image Manager (Windows SIM) trên 1 máy tính khác có cài đặt WAIK.
Sau khii thành công, các bạn hãy chạy Windows SIM từ Start Menu và thực hiện tiếp các
bước sau:
- Cho đĩa cài đặt Windows 7 vào ổ DVD
- Khi động Windows SIM, từ menu các bạn chọn Tools > Create Catalog, hệ thống sẽ yêu cầu
file install.wim trên đĩa cài gốc, chúng ta chỉ việc trỏ tới thư mục sources. Khi quá trình tạo
catalog này hoàn tất, hệ thống sẽ sẵn sàng với việc thiết lập và cấu hình file answer.
1 trong những yêu cầu của chúng ta là sysprep sẽ yêu cầu người dùng khởi tạo tên máy tính trước
khi n vào domain chung trong hệ thống. Tuy nhiên, quá trình này lại nảy sinh thêm 1 vn đề
khác, đó là khi sử dụng file answer unattend.xml Windows sysprep, nếu người sử dụng
không khai báo cụ thể tên máy tính trong file, t hệ thống sẽ tự động gán máy tính đó vào
domain bằng 1 chuỗi tên ngu nhiên – random. Cthể, nếu bạn xóa bỏ phần
<ComputerName></ComputerName> tfile answer, thì người dùng sẽ được hệ thống yêu cầu
nhp đúng tham số này khi file answer được duyệt trong quá trình sysprep, nhưng nếu như vậy
t li quá muộn, vì tại thời điểm đó, máy tính đã được gán vào domain bằng tên random, và do
vậy sẽ có thể gây ra nhiều vấn đề sau này. Nhưng với Mysysprep2, người dùng có thể đặt tên
cho máy tính và gán vào domain sau quá trình x file unattend.xml hoàn tất. Bên cạnh đó,
Mysysprep nên được đặt trong thư mục C:\Windows\System32\Sysprep, bên cnh sysprep.exe
(không được xóa hoặc đổi tên sysprep.exe).
Dưới đây là file unattend.xml được sử dụng trong bài thử nghiệm này:
1 <?xml version="1.0" encoding="utf-8"?>
2 <unattend xmlns="urn:schemas-microsoft-
com:unattend">
3 <settings pass="generalize">
4 <component name="Microsoft-Windows-
PnpSysprep" processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMI
Config/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema
-instance">
5
<PersistAllDeviceInstalls>true</PersistAllD
eviceInstalls>
6 </component>
7 <component name="Microsoft-Windows-
Security-SPP" processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMI
Config/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema
-instance">
8 <SkipRearm>0</SkipRearm>
9 </component>
10 </settings>
11 <settings pass="specialize">
12 <component name="Microsoft-Windows-IE-
InternetExplorer"
processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMI
Config/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema
-instance">
13 <BlockPopups>no</BlockPopups>
14 <CompanyName>Your Company</CompanyName>
15 <CompatibilityViewDomains>Your
Domain</CompatibilityViewDomains>
16
<DisableDataExecutionPrevention>true</Disab
leDataExecutionPrevention>
17
<DisableAccelerators>true</DisableAccelerat
ors>
18 <DisableDevTools>false</DisableDevTools>
19
<DisableFirstRunWizard>true</DisableFirstRu
nWizard>
20
<DisableOOBAccelerators>false</DisableOOBAc
celerators>
21 <EnableLinksBar>true</EnableLinksBar>
22 <FavoritesDelete>false</FavoritesDelete>
23 <FilterLevel>Low</FilterLevel>
24 <GroupTabs>false</GroupTabs>
25 <Home_Page>about:blank</Home_Page>
26 <LockToolbars>true</LockToolbars>
27 <PlaySound>true</PlaySound>
28
<PrivacyAdvisorMode>0</PrivacyAdvisorMode>
29
<ShowInformationBar>true</ShowInformationBa
r>
30 <ShowMenuBar>true</ShowMenuBar>
31
<SuggestedSitesEnabled>false</SuggestedSite
sEnabled>
32
<ShowLeftAddressToolbar>false</ShowLeftAddr
essToolbar>
33
<TabProcessGrowth>Medium</TabProcessGrowth>
34 </component>
35 <component name="Microsoft-Windows-
powercpl" processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMI
Config/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema
-instance">
36 <PreferredPlan>0d81a790-d84a-407f-a5e0-
92464dcf560c</PreferredPlan>
37 </component>
38 <component name="Microsoft-Windows-
Security-SPP-UX"
processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMI
Config/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema
-instance">
39
<SkipAutoActivation>false</SkipAutoActivati
on>
40 </component>
41 <component name="Microsoft-Windows-
Shell-Setup" processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMI
Config/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema
-instance">
42 <Display>
43 <ColorDepth>32</ColorDepth>
44 <DPI>96</DPI>
45
<HorizontalResolution>1366</HorizontalResol
ution>
46 <RefreshRate>60</RefreshRate>
47
<VerticalResolution>768</VerticalResolution
>
48 </Display>
49
<BluetoothTaskbarIconEnabled>false</Bluetoo
thTaskbarIconEnabled>
50 <CopyProfile>true</CopyProfile>
51
<DisableAutoDaylightTimeSet>false</DisableA
utoDaylightTimeSet>
52
<DoNotCleanTaskBar>false</DoNotCleanTaskBar
>
53 <RegisteredOrganization>Organization
Name</RegisteredOrganization>
54 <RegisteredOwner>Registered
Owner</RegisteredOwner>
55 <ShowWindowsLive>false</ShowWindowsLive>
56 <TimeZone>Eastern Standard
Time</TimeZone>
57 <ComputerName>%Please input a computer
name(0,15)%</ComputerName>
58 </component>
59 <component name="Microsoft-Windows-
SystemRestore-Main"
processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMI
Config/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema
-instance">
60 <DisableSR>1</DisableSR>
61 </component>
62 <component name="Microsoft-Windows-
UnattendedJoin" processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMI
Config/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema
-instance">
63 <Identification>
64 <Credentials>
65 <Domain>Your Domain</Domain>
66 <Password>Some Password</Password>
67 <Username>Some User</Username>
68 </Credentials>
69 <MachineObjectOU>OU=Re-
Imaged,OU=YourComputers,DC=YourCompany,DC=C
om</MachineObjectOU>
70 <JoinDomain>%Please select a domain to
join{Your Domain}%</JoinDomain>
71 </Identification>
72 </component>
73 </settings>
74 <settings pass="oobeSystem">
75 <component name="Microsoft-Windows-
International-Core"
processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"