PowerShell Single Line commands on Windows Server 8 and Windows 8

by vivek 5/17/2012 8:30:00 PM

Here are some really good and helpful PowerShell single line commands I have been using on my Windows Server 8 and Windows 8 machines.

Remove GUI from Windows Server 8

Remove-WindowsFeature -Name Server-Gui-Shell
Remove-WindowsFeature -Name Server-Gui-Mgmt-Infra

Add GUI to Windows Server 8

Install-WindowsFeature -Name Server-Gui-Shell

Get Volume details for a particular drive

Get-Volume -DriveLetter 'C'

Get all Volume details (including Free space)

Get-Volume

Optimize drive

Optimize-Volume -DriveLetter 'C'

Rename a Network Adapter

Rename-NetAdapter -Name 'External Interface' -NewName 'Internet Facing'

Disable IPv6

Set-NetAdapterBinding -Name "Internet Facing" -ComponentID ms_tcpip6 -Enabled $False

IPConfig equivalent

Get-NetIPConfiguration

IPConfig /all equivalent

Get-NetIPConfiguration -All

IPConfig /all equivalent and more..

Get-NetIPConfiguration -All -Detailed

Disable a Network Adapter

Disable-NetAdapter -Name "Internet Facing"

Configure a IPv4 IP Address

New-NetIPAddress -InterfaceIndex 21 -AddressFamily IPv4 -IPAddress 192.168.78.12

Add a computer to the domain (from client machine)

Add-Computer -Credential scrap\administrator -DomainName scrapping.local -ComputerName VIVEK-W8

Install Active Directory Domain Services and Active Directory Administrative Center

Install-WindowsFeature -Name AD-Domain-Services
Install-WindowsFeature -Name RSAT-AD-AdminCenter

I will keep updating the list as I come across the new ones..

Hope this helps,
Vivek Kumbhar


Quote of the day:
There are people who think that everything one does with a serious face is sensible. - Georg Christoph Lichtenberg


blog comments powered by Disqus

Rahul Soni

Rahul Soni  Twitter

 LinkedIn

 Facebook

 Email me



Vivek Kumbhar

Vivek Kumbhar  Twitter

 LinkedIn

 Facebook

 Email me


Stack Exchange

profile for Vivek at Server Fault, Q&A for system administrators and IT professionals

profile for Rahul Soni at Stack Overflow, Q&A for professional and enthusiast programmers

Calendar

<<  May 2013  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

All Items
Sign in

Visit Microsoft's Site

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2013, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0