美文网首页Windows
Windows Server 2019 Core(2)-MMC远

Windows Server 2019 Core(2)-MMC远

作者: Rakutens | 来源:发表于2019-03-18 01:44 被阅读0次

    必尽通过Powershell来管理服务器是非常麻烦的,所以能用上服务器系统自带的MMC的图形界面来管理远程服务器是再好不过的了.....

    1.想要使用MMC管理远程的Windows Server Core服务器,需要先在远程服务器上打开一些防火墙规则

    #
    # This script works on a variety of settings that are easiest done from the
    # local machine to make it remotely manageable by a management workstation.
    
    # Ensure Server Manager remoting is enabled
    Configure-SMRemoting.exe -Enable
    
    # 设置一些防火墙规则
    
    #  允许Ping
    Set-NetFirewallRule –Name "FPS-ICMP4-ERQ-In" –Enabled True
    Set-NetFirewallRule –Name "FPS-ICMP6-ERQ-In" –Enabled True
    Set-NetFirewallRule –Name "FPS-ICMP4-ERQ-Out" –Enabled True
    Set-NetFirewallRule –Name "FPS-ICMP6-ERQ-Out" –Enabled True
    
    #  Enable remote volume management - firewall rules need to be set on both
    #  source and destination computers
    #  ***NOTE*** Policy must also be set on system to "Allow remote access
    #  to the Plug and Play interface"
    #  This is done with gpedit.msc locally or gpedit for domain policy
    Set-NetFirewallRule –Name "RVM-VDS-In-TCP" –Enabled True
    Set-NetFirewallRule –Name "RVM-VDSLDR-In-TCP" –Enabled True
    Set-NetFirewallRule –Name "RVM-RPCSS-In-TCP" –Enabled True
    
    #  允许 DCOM 管理入站规则(因为其它功能可能会打开DCOM-IN,所以有可能会报错找不到对象,不影响)
    Set-NetFirewallRule –Name "ComPlusNetworkAccess-DCOM-In" –Enabled True
    
    
    #  Enable remote service management
    Set-NetFirewallRule –Name "RemoteSvcAdmin-In-TCP" –Enabled True
    Set-NetFirewallRule –Name "RemoteSvcAdmin-NP-In-TCP" –Enabled True
    Set-NetFirewallRule –Name "RemoteSvcAdmin-RPCSS-In-TCP" –Enabled True
    
    #  Enable Remote Event Log Management
    Set-NetFirewallRule –Name "RemoteEventLogSvc-In-TCP" –Enabled True
    Set-NetFirewallRule –Name "RemoteEventLogSvc-NP-In-TCP" –Enabled True
    Set-NetFirewallRule –Name "RemoteEventLogSvc-RPCSS-In-TCP" –Enabled True
    
    #  Enable Remote Scheduled Tasks Management
    Set-NetFirewallRule –Name "RemoteTask-In-TCP" –Enabled True
    Set-NetFirewallRule –Name "RemoteTask-RPCSS-In-TCP" –Enabled True
    
    #  Enable Windows Firewall Remote Management
    Set-NetFirewallRule –Name "RemoteFwAdmin-In-TCP" –Enabled True
    Set-NetFirewallRule –Name "RemoteFwAdmin-RPCSS-In-TCP" –Enabled True
    
    #  Enable WMI management requests in
    Set-NetFirewallRule –Name "WMI-WINMGMT-In-TCP" –Enabled True
    
    #  Set some services to automatically start and start them.
    Set-Service -Name PlugPlay -StartupType Automatic
    Start-Service PlugPlay
    Set-Service -Name RemoteRegistry -StartupType Automatic
    Start-Service RemoteRegistry
    Set-Service -Name vds -StartupType Automatic
    Start-Service vds
    
    #  Enable Remote Desktop
    (Get-WmiObject Win32_TerminalServiceSetting -Namespace root\cimv2\TerminalServices).SetAllowTsConnections(1,1) | Out-Null
    (Get-WmiObject -Class "Win32_TSGeneralSetting" -Namespace root\cimv2\TerminalServices -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(0) | Out-Null
    
    $srvr = Read-Host "Enter name to assign to this computer:"
    (Get-WmiObject win32_computersystem).rename($srvr)
    
    $domain = Read-Host "Enter domain this computer should join (you will be prompted for credentials):"
    Add-Copmuter -DomainName $domain
    
    Write-Host -ForegroundColor Yellow "System will now be rebooted."
    Shutdown -r -t 5
    
    

    2.在服务管理器>仪表板选择"添加要管理的其他服务器",如果没有域,则面弹出机板中通过DNS选项添加IP地址

    3.在服务管理器>所有服务器中>选中刚添加的服务器>右键选择"管理方式..."

    4.输入用户帐户和密码,注意! 非域用户需要输入"IP地址\administrator"

    5.右键选中新添加的服务器,试试管理功能吧

    相关文章

      网友评论

        本文标题:Windows Server 2019 Core(2)-MMC远

        本文链接:https://www.haomeiwen.com/subject/vopimqtx.html