Tag: command

Download the new Windows Terminal Preview

How to open Windows Terminal from Command Prompt or Run

This is a really short blog post and more of a reminder than anything else. You might have seen the new Windows Terminal for Windows 10 was just released in the Windows Store as a preview. However, in the last couple of updates to the Windows Terminal app, it got to a state which already makes it my default terminal. The Windows Terminal allows you to run Windows PowerShell, PowerShell Core and even Bash using the Windows Subsystem for Linux (WSL). Especially the integration of the Azure Cloud Shell is a great plus for me. In this blog post, I am just going to show you how you can open the Windows Terminal from command prompt or Run (WIN + R).

To open Windows Terminal from the command line (cmd) or in Windows Run (WIN +R) type:

wt
Open Windows Terminal start wt

Open Windows Terminal start wt

 

If you want to know more about the Azure Cloud Shell integration, read the blog of Pierre Roman (Microsoft Cloud Advocate) on the ITOpsTalk blog.



Windows 10 Task View

The best Windows 10 Features – Why you will love Windows 10

Since the first release of the Windows 10 Preview in the Insider program, I was using the Technical previews on my Surface Pro 3, and it is excellent how Microsoft is improving Windows 10 over the last several months based on research and feedback from the Windows Insider program.

In some days, on July 29, Microsoft will release Windows 10 to the public, and here are some reasons why you will love Windows 10:

Microsoft Edge

Microsoft Edge Browser

With Windows 10 Microsoft released a new browser called Microsoft Edge (before Project Spartan) which is amazingly fast and brings a lot of new features to the table such as Cortana Integration, Web notes which allow you basically draw your notes on websites and share them and Microsoft also promised to enable browser extensions. Secret: you can also switch from a Light Theme to a Dark Theme.

You can also check out the new edge insider preview here: Microsoft Edge Insider

Task View & Virtual Desktop

Windows 10 Task View

Most of the IT Pros reading this blog already knew about Task view in the previous version of Windows using WIN + TAB, but only a few other users did know about these features. Microsoft not only improved the Task view, but Microsoft also promoted it much better with an icon in the Taskbar.

In Windows 10 WIN + TAB does not only offer you Task View it also allows you to create and switch between Virtual Desktops. With Virtual Desktops, you can now finally create multiple workspaces on your PC, which should bring you the productivity boost you need. Secret: You can switch between different Desktops using the Shortcut: CTRL + WIN + ARROW (LEFT and RIGHT).

Hyper-V

Hyper-V vNext Runtime Memory Resize

Microsoft builds Hyper-V directly into the Windows Client since Windows 8. This is great if you want to run Virtual Machines on your Windows Client. Windows 10 Client Hyper-V brings you the excellent performance and features Windows Server 2016 Hyper-V will bring you. Of course, some features are only available in the server build of Hyper-V, but you get some great features such as Enhanced Session mode to copy & paste between your PC and your Virtual Machine. Secret: Windows 10 will allow you to run Hyper-V and use Connected Standby at the same time.



Windows Server Core

Commands for Windows Server Core & Hyper-V Server

For some KTSI projects I have been working a lot with Windows Server Core or Hyper-V Server. Now I had to do a lot of automation, so I made this little connection of commands. If you configure the server manually you can do the most important things with the sconfig utility.

Windows Server Core

Networking

Set Hostname

netdom renamecomputer %COMPUTERNAME% /NewName:<NewComputerName>

Join Domain

netdom join %COMPUTERNAME% /domain:<DomainName> /userd:<UserName> /passwordd:*

Remove Domain

netdom remove

Rename Network Interface

netsh interface set interface name=”old name” newname=”new name”

Configure IP Address

netsh interface ipv4 set address name=<Interface Name>” source=static address=<IPAddress> mask=<SubnetMask> gateway=<DefaultGateway>

Configure DNS Servers

netsh interface ipv4 add dnsserver name=<Interface Name>” address=<DNS Server IP> index=1

Disable Firewall (not recommended)

netsh advfirewall set allprofiles state off

 

Remoting

Enable PowerShell Remoting

Enable-PSRemoting

Enable Remotedesktop

netsh advfirewall firewall set rule group=”remote desktop” new enable=yes

Enable Remote Administration

advfirewall firewall set rule group=”Remote Administration” new enable=yes

Enable Remote Firewall Administration

netsh advfirewall firewall set rule group=”Windows Firewall Remote Management” new enable=yes

Enable ICMP (Ping)

netsh firewall set icmpsetting 8

Enable Remote Disk Management

netsh advfirewall firewall set rule group=”Remote Volume Management” new enable=yes

 

Licensing

Enter License key

slmgr.vbs -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Activate Windows

slmgr.vbs -ato

 

Windows Update

Enable automatic updates

cscript C:'Windows'System32'Scregedit.wsf /au 4

Disable automatic updates

cscript C:'Windows'System32'Scregedit.wsf /au 1

 

Roles & Features

Get availibale features & roles

Dism /online /get-features /format:table

Enable feature & roles

Dism /online /enable-feature /featurename:<featurename>

 

Basics

Change Administrator password

net user administrator *

Restart Computer

shutdown /r /t 0

Logoff

logoff

More information about Server Core: TechNet



Check NTFS Version

If you need to know which version of NTFS you are using you can do that with the fsutil.exe and the following command.

In my case I am testing my C:\ drive:

fsutil fsinfo ntfsinfo c:

fsutil

More on NTFS Versions on wikipedia.



Run Remote Powershell Commands on multiple standalone Computers

Powershell Header

With this little Powershell Script you can run Powershell Commands on multiple Remotehosts even if those are not in an Active Directory.

# Config
$Servers = @("Server01", Server02)
$Cred = Get-Credential # Add Credentials for all Servers (Domain or non-Domain)
 
# Run Command (for example Get-Service | Where-Object {$_.Name -eq "BITS"}
foreach ($Server in $Servers) {
	Invoke-Command -ComputerName $Server -Credential $Cred {Get-Service | Where-Object {$_.Name -eq "BITS"}}
}

Important:

You have to enable Powershell Remoting on the Remotehost with Enable-PSRemoting



Enable Tiger “Classic” Style Dock In Leopard and Snow Leopard

defaults write com.apple.dock no-glass -boolean NO; killall DockIf you like the old or classic Dock Style from Mac OS X 10.4 you can enable this in Mac OS X 10.5 (Leopard) and in Mac OS X 10.6 (Snow Leopard).

Mac OS X 10.4 (Tiger) Dock:

Mac OS X 10.4 Tiger DockMac OS X 10.6 (Leopard) Dock:

Mac OS X 10.6 Snow Leopard Dock

  1. Open Mac OS X Terminal in the Utilities folder
  2. Run the following command in the Terminal
    defaults write com.apple.dock no-glass -boolean YES; killall Dock
  3. Now you have the classic Dock activated

If you want to activate the new glass Dock again, you can use the following command:

defaults write com.apple.dock no-glass -boolean NO; killall Dock



Cheatsheet: Using Diskpart on a Server Core installation #4

Using Diskpart on a Server Core installation. Disk Administration or Partition a disk.

Create a new partition and format a partition

SELECT DISK 0
CREATE PARTITION PRIMARY
ASSIGN LETTER=E
SELECT PARTITION 1
FORMAT FS=NTFS LABEL="New Volume" QUICK
EXIT

Commands you may then issue at the DISKPART prompt:

LIST Disk
LIST Partition
LIST Volume

SELECT Disk n
SELECT Volume n
SELECT Partition n

DETAIL Disk
DETAIL Partition
DETAIL volume

HELP
REM (remark/comment)
EXIT

Commands to Manage Basic Disks:

(set the current in-focus partition to be the system partition)

ASSIGN (allocate the next free drive letter)
ASSIGN LETTER=l (Choose a free letter)

CREATE PARTITION Primary Size=50000 (50 GB)
CREATE PARTITION Extended Size=25000
CREATE PARTITION logical Size=25000

DELETE Partition

EXTEND Size=10000

REMOVE letter=l (Remove drive letter l from the in-focus partition)
REMOVE /ALL (Remove ALL current drive letters and mount points)

Commands to Manage Dynamic Disks:

(set the current in-focus partition to be the system partition)

ASSIGN (allocate the next free drive letter)
ASSIGN LETTER=l (Choose a free letter)

ADD disk=n (Add a mirror to the in-focus SIMPLE volume on the specified disk.)

BREAK disk=n (Break the current in-focus mirror)

CREATE VOLUME Simple Size=n Disk=n
CREATE VOLUME Stripe Size=n Disk=n,n,...
CREATE VOLUME Raid Size=n Disk=n,n,...

DELETE DISK
DELETE PARTITION
DELETE VOLUME

EXTEND disk=n [Size=n]
IMPORT
ONLINE

REMOVE letter=l (Remove drive letter l from the in-focus volume)
REMOVE /ALL (Remove ALL current drive letters and mount points)
RETAIN

Commands to Convert Disks:

CONVERT mbr
CONVERT gpt
CONVERT dynamic
CONVERT basic

CLEAN ALL (remove all partition and volume info from the hard drive)
RESCAN