【免費註冊】 【會員登入】 【個人資料】 【會員列表】 【論壇幫助】 【論壇搜尋】 【登出論壇】

∮Ω奧米加空間∮
∮Ω奧米加空間∮»技術文件區»【轉貼】Server core 指令收集

訂覽該主題更新消息 | 將該主題推薦給朋友 發表新主題 發起投票  回覆
作者 主題    
dc
管理員



性別:男
來自:瓦肯星
發表總數:10716
註冊時間:2002-05-07 16:32
(第 1 篇) 【轉貼】Server core 指令收集

資料來源:Technical_Notes
修改使用者帳號名稱
wmic UserAccount where Name="Administrator" call Rename Name="new-name"

修改使用者密碼
net user [使用者名稱] [密碼]

變更電腦名稱後自動重開
netdom renamecomputer %COMPUTERNAME% /NewName:CompName /force /reboot

更多功能可以看
http://dbastas.blogspot.tw/search/label/Core



資料來源:petri
開啟 ping
Netsh firewall set icmpsetting 8



資料來源:Zackary_Loether
修改 hostname
netdom renamecomputer [hostname] /newname [new name]

重開機才會生效
shutdown /r /t 0



資料來源:xf_aj的BLOG
1.  確定網絡適配器名稱  
netsh interface ipv4 show interfaces
2.  使用DHCP網絡
netsh interface ipv4 set address name="本地連接" source=dhcp
netsh interface ipv4 set dns name="本地連接" source=dhcp
3.  使用靜態IP
netsh interface ipv4 set address name="本地連接" source=static addr=192.168.0.10
mask=255.255.255.0 gateway=192.168.0.1 gwmetric=auto
4.  配置DNS
netsh interface ipv4 set dns name="本地連接" source=static addr=218.74.122.74
register=primary
5.  重命名網絡適配器
netsh interface set interface name="oldname" newname="newname"
6.  禁用網絡適配器:
netsh interface set interface name="name" admin=DISABLED
啟用網絡適配器
netsh interface set interface name="name" admin=enable



資料來源:http://exchangeserverpro.com
新增第二個dns
Netsh interface ipv4 add dnsserver “[網路連線名稱]” 192.168.1.102
刪除 dns
Netsh interface ipv4 delete dnsserver “in” 192.168.1.102




資料來源:ithelp
設定IP位址
指令格式:netsh interface ipv4 set address “[網路連線名稱]” static [IP位址] [網路遮罩] [預設閘通道]
範例:netsh interface ipv4 set address “區域連線1” static 192.168.1.11 255.255.255.0 192.168.1.254
用 ipconfig /all 可以看網路連線名稱




新增第二個ip
Netsh interface ipv4 add address “[網路連線名稱]” 192.168.1.12
刪除ip
Netsh interface ipv4 delete address “in” 192.168.1.12




資料來源:微軟技術學習之路
windows server 2008 -- server core 加入網域的方法
確認擁有本機管理員權限。
確認擁有欲加入網域的網域管理員帳號及密碼。
netdom join 本機電腦名稱  /domain:網域名稱  /userd:administrator  /passwordd:密碼
舉例 netdom join alexpc  /domain:abc.com  /userd:administrator /passwordd:Pa$$w0rd
紅色d代表是domain的意思。
加入成功後,需重新開機,也因此shutdown -r -t 0

移除網域
netdom remove %computername% /domain:網域名稱 /userd:網域使用者 /passwordd:網域密碼 /reboot



資料來源:technet
將使用者新增至本機 Administrators 群組。
net localgroup Administrators /add <網域>\<使用者名稱>




資料來源:microsoft
利用指令開啟 Server Core MMC 管理服務

開啟遠端利用 MMC 管理 ServerCore 的功能,一樣要讓防火牆開啟相關的 PORT,所以我們要輸入下列指令:
Netsh firewall set portopening udp 137
Netsh firewall set portopening udp 138
Netsh firewall set portopening tcp 139
Netsh firewall set portopening tcp 445


資料來源:Yagami的心情旅遊日記
這幾項也要開啟 mmc 管理工具才會正常
netsh advfirewall firewall set rule group="遠端系統管理" new enable=yes
netsh advfirewall firewall set rule group="遠端磁碟區管理" new enable=yes
netsh advfirewall firewall set rule group="Windows 防火牆遠端管理" new enable =yes

遠端電腦 mmc -> 檔案 -> 新增/移除崁入式管理單元 -> 群組原則物件編輯器 -> 新增 -> 瀏覽 -> 另一台電腦 -> 輸入被控端 ip -> 確定 -> 完成 -> 確定
電腦設定\系統管理範本\系統\裝置安裝\允許遠端存取隨插即用介面 -> 編輯原則設定 -> 已啟用 -> 確定




資料來源:techbet
安裝 telnet 功能
start /w ocsetup TelnetClient



資料來源:adriank
Microsoft: OCSetup/DISM, Component Name List…
start /w ocsetup <windows_component_name>
or
dism /online /enable-feature:<windows_component_name>
the list can see
dism /online /get-features
樹狀排列
oclist



資料來源:technet
開啟遠端桌面功能
顯示遠端桌面的連接埠
reg query "hklm\System\CurrentControlSet\Control\Terminal  Server\WinStations\RDP-Tcp" /v PortNumber
PortNumber    REG_DWORD    0xd3d (3389)
假設我們要改成 1234
PortNumber    REG_DWORD    0x4d2 (1234)
可已下修改成 1234
reg add "hklm\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d 0x4d2 /f
開啟遠端桌面
reg add "hklm\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0x00000000 /f
開啟遠端桌面防火牆
Netsh firewall set portopening tcp 1234 "Remote Desktop"


資料來源:IT 專業人員的技術資源
使用
Cscript c:\windows\system32\scregedit.wsf /au 4
命令來設定啟用自動更新功能
接著必須分別輸入Net stop wuauserv與Net start wuauserv來重新啟動Windows Update的服務
想要立即進行線上更新的檢查與下載則必須輸入Wuauclt /detectnow
如果您想要知道目前在Server Core的主機上究竟已經更新了哪一些修正程式(Hotfix),則可以輸入Systeminfo命令在各項資訊清單的最後檢視的已經安裝的Hofix清單了。


sconfig 可以啓動文字設定界面




本帖由dc最後編輯於2012-10-28 13:21

Your mind to my mind,

your thought to my thought
發表時間:2012-09-13 23:27
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:114.*.*.* 編輯  引言回覆 
dc
管理員



性別:男
來自:瓦肯星
發表總數:10716
註冊時間:2002-05-07 16:32
(第 2 篇)

從遠端要管理 IIS7 的話必須安裝

IIS Manager for Remote Administration
http://www.iis.net/downloads/microsoft/iis-manager




資料來源:iis
使用 Server Core 安裝在 Windows Server 2008 R2 上安裝 IIS 7.5

Install and Configure IIS 7 on Server Core
By IIS TeamJanuary 30, 2008
Introduction

Server Core, the minimal server installation option for Windows ServerR 2008, is available in Standard, Enterprise, and Datacenter editions. Server Core supports a subset of the server roles available in full installations of the operating system, including the Internet Information Services 7 and above (IIS 7 and above) Web server. In a Server Core installation, only the services, roles, and features required for an installed role are installed.

Running IIS on Server Core provides a modular, customizable Web server on a thin server operating system. This makes it ideal for appliance-like environments, Web farm front-end servers and Web sites, or applications that require minimal maintenance.

With the addition of the MicrosoftR .NET Framework to Server Core in Windows ServerR 2008 R2, the Server Core installation option becomes even more appealing for those who want to use a very small footprint server for hosting their applications. Availability of the .NET Framework provides:

MicrosoftR ASP.NET support.
With Windows Server 2008 R2, Server Core can be used to host ASP.NET applications.
IIS Remote Management.
Server Core does not provide any user interface other than the command-line interface. With the Windows Server 2008 R2 Server Core option, it is possible use IIS Manager for Remote Administration to connect to IIS and perform all management tasks from within the familiar user interface (UI) of IIS Manager.
Windows PowerShell™.
The Windows Server 2008 R2 Server Core option includes the IIS Windows PowerShell snap-in (also available with other installation options of Windows Server 2008 R2).
Install Server Core

To install IIS on an installed and configured Server Core installation of Windows Server 2008, you must have an administrator user account and password for the server running the Server Core installation.

1. Server Core is set up like a typical Windows Server 2008 server, except the “Server Core Installation” option is selected. The Server Core then forces a change in the administrator password.



Figure 1: Select Server Core option
2. Next, verify the NIC and IPConfig (not necessary if there is a Dynamic Host Configuration Protocol [DHCP] server running on the network). To fix an IP address, type the following:

netsh interface ipv4 set address name=”Local Area Connection” source=static address=<IPADDRESS> mask=<255.255.255.0> gateway=<GatewayIP>

3. To add a Domain Name System (DNS) server entry, type:

netsh interface ipv4 add dnsserver name="Local Area Connection" address=<IPAddress of DNS>

4. To find the computer name, type:

hostname
5. To change the computer name type:

netdom renamecomputer <Current Computer name> /NewName:<NewComputerName>

6. Reboot with the command:

shutdown /r /t 0
7. To join the domain, type:

netdom join <ComputerName> /domain:<DomainName> /Userd:<UserName> /passwordd: *

8. Reboot with the command:

shutdown /r /t 0

9. To prevent a later setup error in MySQL, open an exception for MySQL:

netsh firewall add portopening tcp 3306 "MySQL"

10. Reboot with the command:

shutdown /r /t 0

11. Next, activate Server Core.

a. Use the following command if connected to the Internet:

slmgr.vbs –ato

b. If not connected to the Internet, use phone activation.
Type one of the following:

slmgr.vbs –dti

(This displays the installation identification to be given to Microsoft.)

slmgr.vbs –atp <ConfirmationID>
(This activates the server using the confirmation ID given by Microsoft.)

For more information on the initial setup tasks such as managing the WindowsR Firewall and configuring for automatic updates, see Making Sense of Server Core. Also see the Server Core Installation Option Getting Started Guide.

After the Server Core installation is complete and the server is configured, you can install one or more server roles. The Server Core installation of Windows Server 2008 supports the following server roles:

Active DirectoryR Domain Services
Active Directory Lightweight Domain Services
DHCP Server
DNS Server
File Services
Media Services
Print Services
Hyper-V™
Web Services (IIS) (Limited)
Web Server (IIS)
Install IIS

See Install IIS 7.5 on Windows Server 2008 R2 using a Server Core installation for detailed instructions. Note that the full IIS installation, which installs all available feature packages for Server Core. If there are feature packages you do not need, you should edit the script to install only the packages you require. The default IIS installation installs a minimal set of available feature packages.

If you want to install IIS components that rely on the .NET Framework, you must first install the .NET Framework. The components that rely on the .NET Framework will not be installed if the .NET Framework is not already installed.

To use a script to install the .NET Framework and the full IIS 7.5 installation on Server Core, type the following command into a script:

CMD /C START /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementScriptingTools;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;WAS-WindowsActivationService;WAS-ProcessModel;IIS-FTPServer;IIS-FTPSvc;IIS-FTPExtensibility;IIS-WebDAV;IIS-ASPNET;IIS-NetFxExtensibility;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-ManagementService;MicrosoftWindowsPowerShell;NetFx2-ServerCore;NetFx2-ServerCore-WOW64
To use a script for the full IIS 7.5 installation on Server Core, type the following command into a script:

CMD /C START /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementScriptingTools;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;WAS-WindowsActivationService;WAS-ProcessModel;IIS-FTPServer;IIS-FTPSvc;IIS-FTPExtensibility;IIS-WebDAV;IIS-ASPNET;IIS-NetFxExtensibility;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-ManagementService;MicrosoftWindowsPowerShell
To use a script for the default installation on Server Core, type the following command into a script:

start /w pkgmgr /l:log.etw /iu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI</samp>
See IIS 7.0 on Server Core and Installing IIS 7.0 on Server Core for more information about installing IIS 7.0.

Install Roles and Services

1. Use the command oclist to list the available and installed roles and services on the server. The oclist command also renders component dependencies.



Figure 2: Output of oclist command
In the figure above, the oclist output shows that IIS-FTPExtensibility is dependent on IIS-FTPSvc. To install IIS-FTPExtensibility, it is first necessary to install IIS-FTPSvc.

2. Use the ocsetup command to install and uninstall individual roles and services.

3. Next,run oclist | more to verify which IIS components have been installed.

INSTALL THE .NET FRAMEWORK

If you plan to use ASP.NET or IIS Remote Management then it is necessary to install .NET Framework first. To install it use the following commands:

start /w ocsetup NetFx2-ServerCore
start /w ocsetup NetFx2-ServerCore-WOW64
INSTALL ASP.NET

1. Install ASP.NET by running the following commands (in order):

start /w ocsetup WAS-NetFxEnvironment
start /w ocsetup IIS-ISAPIExtensions
start /w ocsetup IIS-ISAPIFilter
start /w ocsetup IIS-NetFxExtensibility
start /w ocsetup IIS-ASPNET
INSTALL WINDOWS POWERSHELL AND IIS SNAP-IN

1. Install Windows PowerShell by running the following command:

start /w ocsetup MicrosoftWindowsPowerShell

2. Next, start Windows PowerShell with the following command:

\windows\system32\WindowsPowerShell\v1.0\powershell.exe

You should see a PowerShell prompt.

3. In order to enable the IIS snap-in, you must change the script execution policy by running this command:

Set-ExecutionPolicy RemoteSigned
4. Restart PowerShell for the policy changes to take effect. After restarting PowerShell, import the IIS snap-in:

import-module WebAdministration

5. You can obtain the list of available IIS cmdlets by typing:

get-command –pssnapin WebAdministration

Refer to Managing IIS with IIS 7.0 PowerShell Snap-in and Managing IIS with the IIS 7.0 PowerShell Snap-in for more information.

For information about Windows PowerShell on Server Core, see Dmitry’s PowerBlog: PowerShell and Beyond.

ENABLE IIS REMOTE MANAGEMENT

Because Windows Server 2008 R2 Server Core does not have a graphical user interface (GUI), the command prompt must be used for administrative tasks. It may be more convenient to manage Server Core from another computer using IIS remote management.

The IIS Manager for Remote Administration:

Remotely manages IIS from WindowsR 7, Windows VistaR, WindowsR XP, and Windows ServerR 2003.
Connects directly to a Web server, Web site, or Web application.
Installs even when IIS is not installed on the local computer.
Allows multiple simultaneous connections.
Supports delegated administration to Web sites and Web applications, so owners can connect to and manage their own site directly.
Is a familiar and easy-to-use administration tool.
Supports HTTP over Secure Sockets Layer (SSL) for more secure management.
Automatically downloads features to the local IIS Manager for Remote Administration console to match features newly installed on the remote Web server.
For more information, see IIS Manager for Remote Administration and Remote Administration for IIS Manager.

1. By default, Remote Desktop is not enabled on the Server Core. Install the IIS remote management service by using the following command:

start /w ocsetup IIS-ManagementService

2. Enable remote management with the following command:

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WebManagement\Server /v EnableRemoteManagement /t REG_DWORD /d 1

3. Start the management service by typing:

net start wmsvc

4. Connect to the IIS on the Server Core from a remote machine by using IIS Manager for Remote Administration.

To uninstall the Web Server (IIS) role, use the following command:

start /w pkgmgr /uu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel


移除掉
start /w pkgmgr /uu:IIS-FTPServer;IIS-FTPExtensibility;IIS-FTPSvc;IIS-FTPExtensibility
會造成遠端管理無法使用




資料來源:黃昏的甘蔗,msdn
將舊有ASP.NET專案由 Windows Server 2003 轉移到 Win Server 2008 x64  + IIS 7 ,發現問題還蠻大的,連執行都不能執行,就出現了「整合式 Managed 管線模式」

錯誤訊息:「HTTP 錯誤 500.22 - Internal Server Error,偵測出ASP.NET 設定沒有套用整合式 Managed 管線模式」

解決方式
1.在命令提示字元中輸入 cd %windir%\system32\inetsrv,然後按 ENTER。
2.輸入%SystemRoot%\system32\inetsrv\appcmd migrate config "網站名稱/"




本帖由dc最後編輯於2012-09-28 15:37

Your mind to my mind,

your thought to my thought
發表時間:2012-09-17 11:05
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:59.*.*.* 編輯  引言回覆 
dc
管理員



性別:男
來自:瓦肯星
發表總數:10716
註冊時間:2002-05-07 16:32
(第 3 篇)

在 Server core 2012 上

oclist 無功能
OCSetup 已過時

列出所有可以安裝的角色
dism /online /get-features /format:table | more

安裝單一角色
dism /online /enable-feature /featurename:IIS-WebServerRole

如果出現需要安裝其他角色的功能 可以加上 /all
dism /online /enable-feature /all /featurename:UpdateServices-Services


資料來源:小歐ou
Server core 切換成 GUI 界面
使用
powershell
如果光碟在 D: 取得 index
Get-windowsimage -imagepath d:\sources\install.wim
代碼:
Index       : 1
Name        : Windows Server 2012 SERVERSTANDARDCORE
Description : Windows Server 2012 SERVERSTANDARDCORE
Size        : 7,378,688,170 bytes

Index       : 2
Name        : Windows Server 2012 SERVERSTANDARD
Description : Windows Server 2012 SERVERSTANDARD
Size        : 12,157,218,950 bytes

Index       : 3
Name        : Windows Server 2012 SERVERDATACENTERCORE
Description : Windows Server 2012 SERVERDATACENTERCORE
Size        : 7,372,204,994 bytes

Index       : 4
Name        : Windows Server 2012 SERVERDATACENTER
Description : Windows Server 2012 SERVERDATACENTER
Size        : 12,152,242,751 bytes

安裝 GUI 界面
Install-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell -Source wim:d:\sources\install.wim:2

移除 GUI 界面
Uninstall-WindowsFeature Server-Gui-Mgmt-Infra -Restart

所以可以安裝 core 介面後先開啓 GUI 安裝所需資源之後,在移除 GUI 方便很多~




本帖由dc最後編輯於2012-10-28 13:58

Your mind to my mind,

your thought to my thought
發表時間:2012-10-28 13:36
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:114.*.*.* 編輯  引言回覆 
dc
管理員



性別:男
來自:瓦肯星
發表總數:10716
註冊時間:2002-05-07 16:32
(第 4 篇)

管理 Windows Server Core/Nano 的殺手級火奴魯魯(Hanolulu) - Windows 10 篇
http://blog.kkbruce.net/2018/01/windows-server-core-nano-project-hanolulu.html?m=0

殺手級火奴魯魯(Hanolulu)

相較於 RSAT,微軟針對 Server Core/Server Nano 及雲端環境,重設計一套基於瀏覽器的管理工具稱 Project Honolulu(火奴魯魯),目前還在 Preview。我個人測試的感覺是 RSAT 的瀏覽器版本,不過安裝、操作與使用都更於簡便,但功能和 MMC 或 Server Manager 幾乎無差異。




說明介紹網頁
https://docs.microsoft.com/en-us/windows-server/manage/honolulu/honolulu

下載網址
https://aka.ms/HonoluluDownload






Your mind to my mind,

your thought to my thought
發表時間:2018-01-09 17:23
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:203.*.*.* 編輯  引言回覆 
所有時間均為GMT+8, 現在是2024-03-29 20:46    
訂覽該主題更新消息 | 將該主題推薦給朋友 發表新主題 發起投票  回覆

快速回覆
主題 ( 回覆文章可以不輸入標題 )
URLs自動分析
有回覆時郵件通知
禁用表情符號
使用簽名

<聯絡我們 - OMEGA - 控制面板>

Powered by Centaur & Joksky & DC, ver 2003.08.14
Copyright ©2002-2008 PHPY.COM


頁面生成時間:0.0087990760803223