2.3.Environment Setting
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -command "Set-ExecutionPolicy unrestricted -force"netsh advfirewall set allprofiles state off$NLMType = [Type]::GetTypeFromCLSID('DCB00C01-570F-4A9B-8D69-199FDBA5723B') $INetworkListManager = [Activator]::CreateInstance($NLMType) $NLM_ENUM_NETWORK_CONNECTED = 3 $NLM_NETWORK_CATEGORY_PUBLIC = 0x00 $NLM_NETWORK_CATEGORY_PRIVATE = 0x01 $UNIDENTIFIED = "Unidentified network" $INetworks = $INetworkListManager.GetNetworks($NLM_ENUM_NETWORK_CONNECTED) foreach ($INetwork in $INetworks) { $Name = $INetwork.GetName() $Category = $INetwork.GetCategory() if (($Category -eq $NLM_NETWORK_CATEGORY_PUBLIC) ) { $INetwork.SetCategory($NLM_NETWORK_CATEGORY_PRIVATE) } }
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -command "Enable-PSRemoting -Force"cd wsman::localhost\client Set-Item TrustedHosts * -force Restart-Service WinRm cd c:\windows\system32 Set-PSSessionConfiguration -Name Microsoft.PowerShell -force winrm quickconfig -quiet Enable-PSRemoting -Force set-executionpolicy unrestricted -force set-executionpolicy allsigned -force set-executionpolicy remotesigned -forceREG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /t REG_SZ /d %1 /f REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d %2 /f REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d %3 /f
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -command "Enable-PSRemoting -Force"
REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /t REG_SZ /d %1 /f REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d %2 /f REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d %3 /f
Last updated


