2008 R2 Server core 下的常用命令
生活随笔
收集整理的這篇文章主要介紹了
2008 R2 Server core 下的常用命令
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
最近學(xué)習(xí)了一下2008 R2 Server core 現(xiàn)把常用的命令記錄下來(lái),以備后查。 一、常用配置 1、安裝產(chǎn)品密鑰 slmgr /ipk? <Product key> 激活系統(tǒng) slmgr /ato 顯示當(dāng)前許可證狀態(tài)的截止日期 slmgr /xpr 2、安裝驅(qū)動(dòng) pnputil -i -a D:\<驅(qū)動(dòng)文件夾>\<驅(qū)動(dòng)文件名>.inf 3、開(kāi)啟遠(yuǎn)程桌面 c:\windows\system32>cscript scregedit.wsf /ar 0 ? 4、讓windows vista之前的版本也能用遠(yuǎn)程桌面連接到Server core 關(guān)閉高級(jí)安全級(jí)別 c:\windows\system32>cscript scregedit.wsf /cs ? 5、工作組下計(jì)算機(jī)改名 c:\windows\system32>netdom renamecomputer %computername% /NewName:<計(jì)算機(jī)名> 域模式下計(jì)算機(jī)改名 c:\windows\system32>netdom renamecomputer %computername% /NewName:<計(jì)算機(jī)名> /UserD:<域管理員帳號(hào)> /PasswordD 6、將計(jì)算機(jī)加入域 netdom join %computername% /domain:<域名> /userd:<域管理員帳號(hào)> /passwordd: 7、打開(kāi)自動(dòng)更新 c:\windows\system32>cscript scregedit.wsf /AU 4 關(guān)閉自動(dòng)更新 c:\windows\system32>cscript scregedit.wsf /AU 1 檢查自動(dòng)更新?tīng)顟B(tài) c:\windows\system32>cscript scregedit.wsf /AU /v 8、查看所有的服務(wù) sc query或者net start 二、用戶配置 1、新建用戶 net user <用戶名> <密碼> /add 2、刪除用戶 net user <用戶名> /del 3、修改本地用戶密碼 net user <用戶名> <新密碼> 4、將用戶加入用戶組 net localgroup <用戶組> <用戶名> /add 5、將用戶從用戶組中刪除 net localgroup <用戶組> <用戶名> /del 三、網(wǎng)絡(luò)配置 1、設(shè)置靜態(tài)IP地址和網(wǎng)關(guān) netsh interface ipv4 set address name =<"本地連接"> source=static? address=<新IP地址> gateway=<新網(wǎng)關(guān)> 2、設(shè)置動(dòng)態(tài)IP地址 netsh interface ipv4 set address name="本地連接" source=DHCP 3、設(shè)置DNS地址 netsh interface ipv4 add dnsserver name=<"本地連接"> address=<新IP地址> index=1 4、配置計(jì)算機(jī)訪問(wèn)代理 netsh Winhttp set proxy <服務(wù)器名>:<端口> ? 5、允許PING入
netsh firewall set icmpsetting 8
禁止PING入
netsh firewall set icmpsetting 8 disable
四、防火墻配置 1、把所有入站規(guī)則寫(xiě)到C盤的in.txt文件,然后用記事本打開(kāi): netsh advfirewall firewall show rule name=all dir=in > c:\in.txt & notepad c:\in.txt 2、把所有出站規(guī)則寫(xiě)到C盤的out.txt文件,然后用記事本打開(kāi):
netsh advfirewall firewall show rule name=all dir=out > c:\out.txt & notepad c:\out.txt 3、啟用帶有分組字符串“文件和打印機(jī)共享”組的端口 netsh? advfirewall? firewall? set? rule? group=”文件和打印機(jī)共享”new enable=yes 4、啟用名字為”遠(yuǎn)程桌面(TCP-In)” 的端口 netsh advfirewall firewall set? rule name=”遠(yuǎn)程桌面(TCP-In)”? new enable=yes 五、角色安裝 1. Active Directory Domain Services (AD DS) dcpromo /unattend:<應(yīng)答文件> 注意: a. 不能在命令行提示符下輸入dcpromo來(lái)搭建AD,而必須使用以上方法。但是可以通過(guò)在普通的Windows Server 2008計(jì)算機(jī)上進(jìn)行dcpromo并將配置另存為以獲得應(yīng)答文件。 b. 如果不在應(yīng)答文件中加入:RebootOnCompletion=No,則系統(tǒng)在dcpromo完成后會(huì)馬上重新啟動(dòng)計(jì)算機(jī)。 2. Active Directory Lightweight Directory Services (AD LDS) 安裝:start /w ocsetup DirectoryServices-ADAM-ServerCore 卸載:start /w ocsetup DirectoryServices-ADAM-ServerCore /uninstall 3. DHCP Server 安裝:start /w ocsetup DHCPServerCore 卸載:start /w ocsetup DHCPServerCore /uninstall 設(shè)置為自動(dòng)啟動(dòng):sc config dhcpserver start= auto 4. DNS Server 安裝:start /w ocsetup DNS-Server-Core-Role 卸載:start /w ocsetup DNS-Server-Core-Role /uninstall 5. File Services 安裝文件復(fù)制服務(wù)(File Replication Service): start /w ocsetup FRS-Infrastructure 安裝分布式文件系統(tǒng)服務(wù)(Distributed File System service): start /w ocsetup DFSN-Server 安裝分布式文件系統(tǒng)復(fù)制(Distributed File System Replication): start /w ocsetup DFSR-Infrastructure-ServerEdition 安裝網(wǎng)絡(luò)文件系統(tǒng)(Network File System): start /w ocsetup ServerForNFS-Base start /w ocsetup ClientForNFS-Base 6. Print Services 安裝: start /w ocsetup Printing-ServerCore-Role start /w ocsetup Printing-LPDPrintService(LPD) 7. Streaming Media Services 安裝:start /w ocsetup MediaServer 8. Web Server (IIS) 默認(rèn)安裝: start /w pkgmgr /iu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel 包含所有選項(xiàng)的安裝: start /w pkgmgr /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;IIS-FTPPublishingService;IIS-FTPServer;WAS-WindowsActivationService;WAS-ProcessModel 卸載: start /w pkgmgr /uu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel
netsh firewall set icmpsetting 8
禁止PING入
netsh firewall set icmpsetting 8 disable
四、防火墻配置 1、把所有入站規(guī)則寫(xiě)到C盤的in.txt文件,然后用記事本打開(kāi): netsh advfirewall firewall show rule name=all dir=in > c:\in.txt & notepad c:\in.txt 2、把所有出站規(guī)則寫(xiě)到C盤的out.txt文件,然后用記事本打開(kāi):
netsh advfirewall firewall show rule name=all dir=out > c:\out.txt & notepad c:\out.txt 3、啟用帶有分組字符串“文件和打印機(jī)共享”組的端口 netsh? advfirewall? firewall? set? rule? group=”文件和打印機(jī)共享”new enable=yes 4、啟用名字為”遠(yuǎn)程桌面(TCP-In)” 的端口 netsh advfirewall firewall set? rule name=”遠(yuǎn)程桌面(TCP-In)”? new enable=yes 五、角色安裝 1. Active Directory Domain Services (AD DS) dcpromo /unattend:<應(yīng)答文件> 注意: a. 不能在命令行提示符下輸入dcpromo來(lái)搭建AD,而必須使用以上方法。但是可以通過(guò)在普通的Windows Server 2008計(jì)算機(jī)上進(jìn)行dcpromo并將配置另存為以獲得應(yīng)答文件。 b. 如果不在應(yīng)答文件中加入:RebootOnCompletion=No,則系統(tǒng)在dcpromo完成后會(huì)馬上重新啟動(dòng)計(jì)算機(jī)。 2. Active Directory Lightweight Directory Services (AD LDS) 安裝:start /w ocsetup DirectoryServices-ADAM-ServerCore 卸載:start /w ocsetup DirectoryServices-ADAM-ServerCore /uninstall 3. DHCP Server 安裝:start /w ocsetup DHCPServerCore 卸載:start /w ocsetup DHCPServerCore /uninstall 設(shè)置為自動(dòng)啟動(dòng):sc config dhcpserver start= auto 4. DNS Server 安裝:start /w ocsetup DNS-Server-Core-Role 卸載:start /w ocsetup DNS-Server-Core-Role /uninstall 5. File Services 安裝文件復(fù)制服務(wù)(File Replication Service): start /w ocsetup FRS-Infrastructure 安裝分布式文件系統(tǒng)服務(wù)(Distributed File System service): start /w ocsetup DFSN-Server 安裝分布式文件系統(tǒng)復(fù)制(Distributed File System Replication): start /w ocsetup DFSR-Infrastructure-ServerEdition 安裝網(wǎng)絡(luò)文件系統(tǒng)(Network File System): start /w ocsetup ServerForNFS-Base start /w ocsetup ClientForNFS-Base 6. Print Services 安裝: start /w ocsetup Printing-ServerCore-Role start /w ocsetup Printing-LPDPrintService(LPD) 7. Streaming Media Services 安裝:start /w ocsetup MediaServer 8. Web Server (IIS) 默認(rèn)安裝: start /w pkgmgr /iu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel 包含所有選項(xiàng)的安裝: start /w pkgmgr /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;IIS-FTPPublishingService;IIS-FTPServer;WAS-WindowsActivationService;WAS-ProcessModel 卸載: start /w pkgmgr /uu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel
轉(zhuǎn)載于:https://blog.51cto.com/zhcxl/211834
總結(jié)
以上是生活随笔為你收集整理的2008 R2 Server core 下的常用命令的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 恒生证券期货行业用户维稳工作指引(一)
- 下一篇: 采购杀毒软件,你说话能算数么?