Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Bob Tanner
packer-windows
Commits
a2b9d6fd
Commit
a2b9d6fd
authored
Jul 30, 2015
by
Stefan Scherer
Browse files
use fixnetwork.ps1 from misheska
parent
be97a14a
Changes
3
Show whitespace changes
Inline
Side-by-side
answer_files/10/Autounattend.xml
View file @
a2b9d6fd
...
...
@@ -130,117 +130,129 @@
<Order>
2
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c reg add "HKLM\System\CurrentControlSet\Control\Network\NewNetworkWindowOff"
</CommandLine>
<Description>
Network prompt
</Description>
<Order>
3
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\fixnetwork.ps1
</CommandLine>
<Description>
Fix public network
</Description>
<Order>
4
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm quickconfig -q
</CommandLine>
<Description>
winrm quickconfig -q
</Description>
<Order>
3
</Order>
<Order>
5
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm quickconfig -transport:http
</CommandLine>
<Description>
winrm quickconfig -transport:http
</Description>
<Order>
4
</Order>
<Order>
6
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}
</CommandLine>
<Description>
Win RM MaxTimoutms
</Description>
<Order>
5
</Order>
<Order>
7
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
</CommandLine>
<Description>
Win RM MaxMemoryPerShellMB
</Description>
<Order>
6
</Order>
<Order>
8
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}
</CommandLine>
<Description>
Win RM AllowUnencrypted
</Description>
<Order>
7
</Order>
<Order>
9
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}
</CommandLine>
<Description>
Win RM auth Basic
</Description>
<Order>
8
</Order>
<Order>
10
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}
</CommandLine>
<Description>
Win RM client auth Basic
</Description>
<Order>
9
</Order>
<Order>
11
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
</CommandLine>
<Description>
Win RM listener Address/Port
</Description>
<Order>
1
0
</Order>
<Order>
1
2
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
</CommandLine>
<Description>
Win RM adv firewall enable
</Description>
<Order>
1
1
</Order>
<Order>
1
3
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985"
</CommandLine>
<Description>
Win RM port open
</Description>
<Order>
1
2
</Order>
<Order>
1
4
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c net stop winrm
</CommandLine>
<Description>
Stop Win RM Service
</Description>
<Order>
1
3
</Order>
<Order>
1
5
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c sc config winrm start= auto
</CommandLine>
<Description>
Win RM Autostart
</Description>
<Order>
1
4
</Order>
<Order>
1
6
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c net start winrm
</CommandLine>
<Description>
Start Win RM Service
</Description>
<Order>
1
5
</Order>
<Order>
1
7
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f
</CommandLine>
<Order>
1
6
</Order>
<Order>
1
8
</Order>
<Description>
Show file extensions in Explorer
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f
</CommandLine>
<Order>
1
7
</Order>
<Order>
1
9
</Order>
<Description>
Enable QuickEdit mode
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f
</CommandLine>
<Order>
18
</Order>
<Order>
20
</Order>
<Description>
Show Run command in Start Menu
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f
</CommandLine>
<Order>
1
9
</Order>
<Order>
2
1
</Order>
<Description>
Show Administrative Tools in Start Menu
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f
</CommandLine>
<Order>
2
0
</Order>
<Order>
2
2
</Order>
<Description>
Zero Hibernation File
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f
</CommandLine>
<Order>
2
1
</Order>
<Order>
2
3
</Order>
<Description>
Disable Hibernation Mode
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
</CommandLine>
<Order>
2
2
</Order>
<Order>
2
4
</Order>
<Description>
Disable password expiration for vagrant user
</Description>
</SynchronousCommand>
<!-- WITHOUT WINDOWS UPDATES -->
...
...
scripts/fixnetwork.ps1
0 → 100644
View file @
a2b9d6fd
# You cannot enable Windows PowerShell Remoting on network connections that are set to Public
# Spin through all the network locations and if they are set to Public, set them to Private
# using the INetwork interface:
# http://msdn.microsoft.com/en-us/library/windows/desktop/aa370750(v=vs.85).aspx
# For more info, see:
# http://blogs.msdn.com/b/powershell/archive/2009/04/03/setting-network-location-to-private.aspx
# Network location feature was only introduced in Windows Vista - no need to bother with this
# if the operating system is older than Vista
if
([
environment
]::
OSVersion.version.Major
-lt
6
)
{
return
}
# You cannot change the network location if you are joined to a domain, so abort
if
(
1
,
3
,
4
,
5
-contains
(
Get-WmiObject
win32_computersystem
)
.
DomainRole
)
{
return
}
# Get network connections
$networkListManager
=
[
Activator
]::
CreateInstance
([
Type
]::
GetTypeFromCLSID
([
Guid
]
"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"
))
$connections
=
$networkListManager
.
GetNetworkConnections
()
$connections
|
foreach
{
Write-Host
$_
.
GetNetwork
()
.
GetName
()
"category was previously set to"
$_
.
GetNetwork
()
.
GetCategory
()
$_
.
GetNetwork
()
.
SetCategory
(
1
)
Write-Host
$_
.
GetNetwork
()
.
GetName
()
"changed to category"
$_
.
GetNetwork
()
.
GetCategory
()
}
windows_10.json
View file @
a2b9d6fd
...
...
@@ -18,6 +18,7 @@
"vnc_port_max"
:
5980
,
"floppy_files"
:
[
"./answer_files/10/Autounattend.xml"
,
"./scripts/fixnetwork.ps1"
,
"./scripts/microsoft-updates.bat"
,
"./scripts/win-updates.ps1"
,
"./scripts/openssh.ps1"
...
...
@@ -45,6 +46,7 @@
"disk_size"
:
61440
,
"floppy_files"
:
[
"./answer_files/10/Autounattend.xml"
,
"./scripts/fixnetwork.ps1"
,
"./scripts/microsoft-updates.bat"
,
"./scripts/win-updates.ps1"
,
"./scripts/openssh.ps1"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment