{"id":3339,"date":"2014-07-07T22:49:05","date_gmt":"2014-07-07T14:49:05","guid":{"rendered":"http:\/\/rmohan.com\/?p=3339"},"modified":"2014-07-07T22:49:05","modified_gmt":"2014-07-07T14:49:05","slug":"windows-2012-command","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=3339","title":{"rendered":"Windows 2012 Command"},"content":{"rendered":"<p>taskmgr<br \/>\nregedit<br \/>\ntimedate.cpl<br \/>\nintl.cpl<br \/>\nsconfig.cmd<\/p>\n<p>get-process <\/p>\n<p>diskpart<\/p>\n<p>Install DHCP SERVER Using PowerShell<\/p>\n<p>PS C:\\Users\\Administrator> get-command -Module servermanager<\/p>\n<p>CommandType     Name                                               ModuleName<br \/>\n&#8212;&#8212;&#8212;&#8211;     &#8212;-                                               &#8212;&#8212;&#8212;-<br \/>\nAlias           Add-WindowsFeature                                 ServerManager<br \/>\nAlias           Remove-WindowsFeature                              ServerManager<br \/>\nFunction        Disable-ServerManagerStandardUserRemoting          ServerManager<br \/>\nFunction        Enable-ServerManagerStandardUserRemoting           ServerManager<br \/>\nCmdlet          Get-WindowsFeature                                 ServerManager<br \/>\nCmdlet          Install-WindowsFeature                             ServerManager<br \/>\nCmdlet          Uninstall-WindowsFeature                           ServerManager<\/p>\n<p>PS C:\\Users\\Administrator> Add-WindowsFeature -IncludeAllSubFeature -Name DHCP, RSAT-DHCP<\/p>\n<p>Success Restart Needed Exit Code      Feature Result<br \/>\n&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;      &#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nTrue    Yes            SuccessRest&#8230; {DHCP Server, Remote Server Administration&#8230;<br \/>\nWARNING: You must restart this server to finish the installation process.<br \/>\nWARNING: Windows automatic updating is not enabled. To ensure that your newly-installed role or feature is<br \/>\nautomatically updated, turn on Windows Update.<\/p>\n<p>PS C:\\Users\\Administrator> Get-WindowsFeature *dhcp*<\/p>\n<p>Display Name                                            Name                       Install State<br \/>\n&#8212;&#8212;&#8212;&#8212;                                            &#8212;-                       &#8212;&#8212;&#8212;&#8212;-<br \/>\n[X] DHCP Server                                         DHCP                      InstallPending<br \/>\n        [X] DHCP Server Tools                           RSAT-DHCP                 InstallPending<\/p>\n<p>Get-WindowsFeature<\/p>\n<p>Install-WindowsFeature DHCP -IncludeManagementTools -whatif<br \/>\nAdd-WindowsFeature -IncludeAllSubFeature -Name DHCP, RSAT-DHCP<\/p>\n<p>Remove Windows feature<br \/>\nPS C:\\Users\\Administrator> Remove-WindowsFeature -Name DHCP, RSAT-DHCP<\/p>\n<p>Success Restart Needed Exit Code      Feature Result<br \/>\n&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;      &#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nTrue    Yes            SuccessRest&#8230; {DHCP Server, Remote Server Administration&#8230;<br \/>\nWARNING: You must restart this server to finish the removal process.<\/p>\n<p>How to Reboot Windows Server 2012<br \/>\nAs you may have guessed, restarting Server 2012 is conceptually the same as shutting down. If you would like PowerShell to reboot the server then in place of &#8216;Stop&#8217; use the verb &#8216;Restart&#8217;.<\/p>\n<p>For occasions where you employ the shutdown command, then instead of typing -s, substitute -r.<\/p>\n<p># How to Reboot Server 2012 with PowerShell<br \/>\nRestart-Computer<\/p>\n<p># How to Reboot with the built-in command<br \/>\nShutdown -r -m \\\\localhost<\/p>\n<p>Employ PowerShell to Shutdown Windows Server 2012<br \/>\nIf you are familiar with PowerShell&#8217;s cmdlets then you need a verb called &#8216;Stop&#8217; (not shutdown), coupled with the noun &#8216;Computer&#8217;.<\/p>\n<p>Launch PowerShell, type stop then tab, you should see Stop-Computer.  If this flashy technique does not work, then just type this one simple command long-hand:<\/p>\n<p># PowerShell command to shutdown Windows Server 2012<\/p>\n<p>Stop-Computer<\/p>\n<p>shutdown utility. However, there is a little known switch to bring-up a GUI version of this command line utility.<\/p>\n<p># GUI method of using the built-in Shutdown command<\/p>\n<p>Shutdown -i<\/p>\n<p>Note: If you are going to use any of the Shutdown commands, the first switch to learn is -a.  Shutdown -a meaning abort!<\/p>\n<p>Pure Shutdown<\/p>\n<p>I like to operate shutdown from within PowerShell.<br \/>\n# Shutdown the local Windows Server 2012 machine<\/p>\n<p>Shutdown -s -m \\\\localhost<\/p>\n<p>Setting an IP address<\/p>\n<p>PS C:\\Users\\Administrator> Get-NetAdapter<\/p>\n<p>Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed<br \/>\n&#8212;-                      &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;                    &#8212;&#8212;- &#8212;&#8212;       &#8212;&#8212;&#8212;-             &#8212;&#8212;&#8212;<br \/>\nEthernet0                 Intel(R) 82574L Gigabit Network Conn&#8230;      12 Up           00-0C-29-3C-C0-2F         1 Gbps<\/p>\n<p>PS C:\\Users\\Administrator><\/p>\n<p>Get-NetIPAddress -InterfaceIndex 12 -AddressFamily IPv4<\/p>\n<p>To add the IP address use:<\/p>\n<p>New-NetIPAddress -InterfaceIndex 12 -AddressFamily IPv4 -IPAddress 192.168.1.9 -PrefixLength 24<\/p>\n","protected":false},"excerpt":{"rendered":"<p>taskmgr regedit timedate.cpl intl.cpl sconfig.cmd<\/p>\n<p>get-process <\/p>\n<p>diskpart<\/p>\n<p>Install DHCP SERVER Using PowerShell<\/p>\n<p>PS C:\\Users\\Administrator> get-command -Module servermanager<\/p>\n<p>CommandType Name ModuleName &#8212;&#8212;&#8212;&#8211; &#8212;- &#8212;&#8212;&#8212;- Alias Add-WindowsFeature ServerManager Alias Remove-WindowsFeature ServerManager Function Disable-ServerManagerStandardUserRemoting ServerManager Function Enable-ServerManagerStandardUserRemoting ServerManager Cmdlet Get-WindowsFeature ServerManager Cmdlet Install-WindowsFeature ServerManager Cmdlet Uninstall-WindowsFeature ServerManager<\/p>\n<p>PS C:\\Users\\Administrator> Add-WindowsFeature -IncludeAllSubFeature -Name DHCP, RSAT-DHCP<\/p>\n<p>Success Restart Needed [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3339"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3339"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3339\/revisions"}],"predecessor-version":[{"id":3340,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3339\/revisions\/3340"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}