Tag: Windows 8.1

Open website from PowerShell

Open website from PowerShell

If you want to directly open a website from the PowerShell console, you can use the Start-Process cmdlet. This will open the website in the default browser:

 
Start-Process "https://www.thomasmaurer.ch"

You can also use “Start” which is an alias for Start-Process:

 
Start "https://www.thomasmaurer.ch"

Yes this is a very short post, but I hope this was helpful and you can now open a website from PowerShell.



sysprep.exe vm mode

Windows Sysprep for Virtual Machines

For using the same system image for different virtual machines or physical computer, Microsoft created a tool called sysprep.exe. This blog post covers Most people should be already familiar with that tool. If not here is the description:

Sysprep prepares a Windows installation (Windows client and Windows Server) for imaging, allowing you to capture a customized installation. Sysprep removes PC-specific information from a Windows installation, “generalizing” the installation so it can be reused on different PCs. With Sysprep you can configre the PC to boot to audit mode, where you can make additional changes or updates to your image. Or, you can configure Windows to boot to the Out-of-Box Experience (OOBE).

This is great so you can sysprep a virtual machine copy the VHD or VHDX file and use it for the first boot of different VMs. In Windows Server 2012 and Windows 8, Microsoft added an addition to sysprep called the mode switch “/mode:vm”. The mode:vm switch allows you to identify the Windows as a Virtual Machine and sysprep.exe will generalize a Virtual Hard Disk (VHD or VHDX) so that you can deploy the VHD as a VHD on the same Virtual Machine (VM) or hypervisor. You must deploy the VHD on a Virtual Machine (VM) or hypervisor with the same hardware profile. For example, if you created VHD in Microsoft Hyper-V, you can only deploy your VHD to Microsoft Hyper-V VMs with a matching hardware profile, and you can only run VM mode from inside a VM.

This will boost the performance and time for the virtual machine for the first startup and installation. This also work of course with virtual machines running on other hypervisors such as VMware or Xen.

Run the following command inside the Virtual Machine (You find sysprep.exe in the  C:\Windows\System32\Sysprep folder):

 
sysprep.exe /oobe /generalize /shutdown /mode:vm

Now you can copy the VHD or VHDX file from that virtual machine and use it for other VMs. Also check out my post about automating VM creation using an unattend.xml file.



Get-NetIPConfiguration

Basic Networking PowerShell cmdlets cheatsheet to replace netsh, ipconfig, nslookup and more

Around 4 years ago I wrote a blog post about how to Replace netsh with Windows PowerShell which includes basic powershell networking cmdlets. After working with Microsoft Azure, Nano Server and Containers, PowerShell together with networking becomes more and more important. I created this little cheat sheet so it becomes easy for people to get started.

Basic Networking PowerShell cmdlets

Get-NetIPConfiguration

Get the IP Configuration (ipconfig with PowerShell)

Get-NetIPConfiguration

List all Network Adapters

Get-NetAdapter

Get a spesific network adapter by name

Get-NetAdapter -Name *Ethernet*

Get more information VLAN ID, Speed, Connection status

Get-NetAdapter | ft Name, Status, Linkspeed, VlanID

Get driver information

Get-NetAdapter | ft Name, DriverName, DriverVersion, DriverInformation, DriverFileName

Get adapter hardware information. This can be really usefull when you need to know the PCI slot of the NIC.

Get-NetAdapterHardwareInfo

Disable and Enable a Network Adapter

Disable-NetAdapter -Name "Wireless Network Connection"
Enable-NetAdapter -Name "Wireless Network Connection"

Rename a Network Adapter

Rename-NetAdapter -Name "Wireless Network Connection" -NewName "Wireless"

IP Configuration using PowerShell

PowerShell Networking Get-NetIPAddress

Get IP and DNS address information

Get-NetAdapter -Name "Local Area Connection" | Get-NetIPAddress

Get IP address only

(Get-NetAdapter -Name "Local Area Connection" | Get-NetIPAddress).IPv4Address

Get DNS Server Address information

Get-NetAdapter -Name "Local Area Connection" | Get-DnsClientServerAddress

Set IP Address

New-NetIPAddress -InterfaceAlias "Wireless" -IPv4Address 10.0.1.95 -PrefixLength "24" -DefaultGateway 10.0.1.1

or if you want to change a existing IP Address

Set-NetIPAddress -InterfaceAlias "Wireless" -IPv4Address 192.168.12.25 -PrefixLength "24"

Remove IP Address

Get-NetAdapter -Name "Wireless" | Remove-NetIPAddress

Set DNS Server

Set-DnsClientServerAddress -InterfaceAlias "Wireless" -ServerAddresses "10.10.20.1","10.10.20.2"

Set interface to DHCP

Set-NetIPInterface -InterfaceAlias "Wireless" -Dhcp Enabled

Clear DNS Cache with PowerShell

You can also manage your DNS cache with PowerShell.

List DNS Cache:

 
Get-DnsClientCache

Clear DNS Cache

 
Clear-DnsClientCache

Ping with PowerShell

PowerShell Networking Test-NetConnection Ping

How to Ping with PowerShell. For a simple ping command with PowerShell, you can use the Test-Connection cmdlet:

 
Test-Connection thomasmaurer.ch

There is an advanced way to test connection using PowerShell

Test-NetConnection -ComputerName www.thomasmaurer.ch

Get some more details from the Test-NetConnection

Test-NetConnection -ComputerName www.thomasmaurer.ch -InformationLevel Detailed

Ping multiple IP using PowerShell

1..99 | % { Test-NetConnection -ComputerName x.x.x.$_ } | FT -AutoSize

Tracert

PowerShell Tracert

Tracert with PowerShell

Test-NetConnection www.thomasmaurer.ch –TraceRoute

Portscan with PowerShell

PowerShell Portscan

Use PowerShell to check for open port

Test-NetConnection -ComputerName www.thomasmaurer.ch -Port 80
Test-NetConnection -ComputerName www.thomasmaurer.ch -CommonTCPPort HTTP

NSlookup in PowerShell

PowerShell Networking NSlookup

NSlookup using PowerShell:

Resolve-DnsName www.thomasmaurer.ch
Resolve-DnsName www.thomasmaurer.ch -Type MX -Server 8.8.8.8

Route in PowerShell

PowerShell Networking Route

How to replace Route command with PowerShell

Get-NetRoute -Protocol Local -DestinationPrefix 192.168*
Get-NetRoute -InterfaceAlias Wi-Fi
 
New-NetRoute –DestinationPrefix "10.0.0.0/24" –InterfaceAlias "Ethernet" –NextHop 192.168.192.1

NETSTAT in PowerShell

PowerShell Networking Netstat

How to replace NETSTAT with PowerShell

Get-NetTCPConnection
Get-NetTCPConnection –State Established

NIC Teaming PowerShell commands

Create a new NIC Teaming (Network Adapter Team)

New-NetLbfoTeam -Name NICTEAM01 -TeamMembers Ethernet, Ethernet2 -TeamingMode SwitchIndependent -TeamNicName NICTEAM01 -LoadBalancingAlgorithm Dynamic

SMB Related PowerShell commands

SMB PowerShell SMB Client Configuration

Get SMB Client Configuration

Get-SmbClientConfiguration

Get SMB Connections

Get-SmbConnection

Get SMB Mutlichannel Connections

Get-SmbMutlichannelConnection

Get SMB open files

Get-SmbOpenFile

Get SMB Direct (RDMA) adapters

Get-NetAdapterRdma

Hyper-V Networking cmdlets

Hyper-V PowerShell Get-VMNetwork Adapter

Get and set Network Adapter VMQ settings

Get-NetAdapterVmq
# Disable VMQ
Set-NetAdapterVmq -Enabled $false
# Enable VMQ
Set-NetAdapterVmq -Enabled $true

Get VM Network Adapter

Get-VMNetworkAdapter -VMName Server01

Get VM Network Adapter IP Addresses

(Get-VMNetworkAdapter -VMName NanoConHost01).IPAddresses

Get VM Network Adapter Mac Addresses

(Get-VMNetworkAdapter -VMName NanoConHost01).MacAddress

I hope you enjoyed it and the post was helpful, if you think something important is missing, please add it in the comments.



diskpart fat32 and gpt

How to create Windows Server bootable USB media for deployment on UEFI based systems

When you were create a USB media for PCs, notebooks and servers which were using BIOS you could use several tools to do this. Now most of the tools do not really create a USB media drive which can be used to boot and install Windows or Windows Server on a UEFI based system such a new servers and for example the Surface Pro line. But it is very simple to do this now, just follow this steps:

  • The USB drive has to be formatted in FAT32
  • The USB needs to be GPT and not MBR
  • Copy all files from the ISO to the USB drive

diskpart fat32 and gpt

PowerShell to create a Windows Server USB drive

This is it, and here is how you do it:

First plugin your USB drive to your computer. The USB drive should be bigger than 4GB.

Open a CMD prompt or PowerShell using the Run as Administrator option and open diskpart. Now you can do list all this by using

 
list disk

Select the USB disk, in my case this was disk 1

 
select disk 1

Clean the disk. Be careful this will remove all files and partitions on the USB media.

 
clean

Now convert it to GPT

 
convert gpt

Create a new primary partition. But make sure the partition is not greater than 16GB otherwise it can be formatted with FAT32.

 
create partition primary
 
# If your USB drive is bigger than 16GB use the following command
 
create partition primary size=16000

Format the partition with FAT32

 
format fs=FAT32 quick

Assign a drive letter to the volume

 
assign letter=k

now you can exit the diskpart and copy all files from the Windows or Windows Server to the USB drive and boot it. This works with Windows 8, Windows 8.1, Windows 10, Windows Server 2012, Windows Server 2012 R2 and Windows Server 2016 or even Hyper-V Server in the same editions.

 



Surface 3 Starbucks

My Microsoft Surface 3 Review

A couple of weeks ago I got myself a Microsoft Surface 3 as a secondary device to my Surface Pro 3. While I am totally happy with my Surface Pro 3 as my daily driver on the road, in the office or at home, I wanted a secondary device for home tablet use and to showcase some new Windows 10 scenarios with Azure Active Directory and Office 365 integration. I got some tweets from some user who wanted to know my feedback on the device and so here is a small review:

Technical Specifications

Surface 3 Specs

  • Size 10.52″ x 7.36″ x 0.34″ (267mm x 187mm x 8.7mm)
  • Weight 1.37 lbs (622g)
  • Display 10.8” ClearType Full HD Plus Display Resolution: 1920 x 1280 Aspect ratio: 3:2 10 point multi-touch
  • Surface Pen support
  • Battery Life: Up to 10 hours of video playback
  • RAM/Storage 2GB RAM with 64GB storage & 4GB RAM with 128GB storage
  • Processor Quad Core Intel Atom x7-Z8700 processor (2MB Cache, 1.6GHz with Intel Burst technology up to 2.4GHz)
  • Wi-Fi (802.11 a/b/g/n/ac)
  • Bluetooth 4.0
  • Full-size USB 3.0
  • Mini DisplayPort
  • microSD card reader
  • Micro USB charging port
  • Headset jack
  • Cover port
  • Software Windows 8.1
  • 1-year of Office 365 Personal with OneDrive cloud storage
  • 3.5 megapixel front-facing camera
  • 8.0 megapixel rear-facing camera with autofocus
  • Microphone
  • Stereo speakers with Dolby® audio
  • Ambient light sensor
  • Proximity sensor
  • Accelerometer
  • Gyroscope
  • Magnetometer

I got the smallest version with 2GB of RAM and 64GB of storage.

Design and Durability

Surface 3 and Surface Pro 3

Microsoft did it again, if you expect any sacrifices on design, quality and durability you are wrong. The Surface 3 comes, like the Surface Pro 3 with great design and great built quality. The Surface 3 comes with a 10 inch screen, the Surface Pro 3 comes with a 12 inch screen, but both have a 3:2 aspect ratio which I really like for getting stuff done. With that you can also use it in portrait mode without any problems.

The difference between the Surface 3 and the Surface Pro 3 is the size and performance. With that, the Surface 3 is designed to be used as a tablet. And you can feel that, the size and especially the weight is made for tablet usage. The Surface 3 is just 200 grams lighter than the Surface Pro 3 which is just enough to hold the tablet in one or to hands for awhile without getting tired arms. This is also handy if you are doing some writing using the Surface Pen.

Again, everything seems to be at the right place and all buttons and the whole chassis is feeling very “high-class”.

Display and Audio

If you think you get any sacrifices on display quality or audio, you are wrong again. The Surface 3 comes with a stunning display, very bright and good color quality, in some scenario, the display even feels brighter than the Surface Pro 3. Now the biggest surprise of the device was the audio quality, this is maybe the best audio quality I every had from a tablet. If you have used other tablets including the iPad or Surface 2, you know that audio quality wasn’t bad, but it was far from being good. The Surface 3 has changed this, of course it is still not somethings music enthusiast will really use, but if you want to watch House of Cards on Netflix the speakers are loud and clear.

The other big pictures here is the Surface Pen support. As the Surface Pro 3, the Surface 3 does support the Surface Pen, not like the Surface 2. This is great to take notes using OneNote and use it as a notebook, especially if you wake up in the middle of the night and have a great idea you can use the Surface Pen and the OneNote button to quickly open an new OneNote page.

Ports and Internals

The Surface Pro 3 has full-size USB 3.0, microSDXC card slot, a Headset jack, a Mini DisplayPort and at the bottom a Cover port for the Type Cover. Of course also the older covers work perfectly, but they just don’t match in size. The position of the ports have changed a little bit from the Surface 2. The Surface 3 does also have a new power port in form of a micro USB port, instead of the magnetic power port of the Surface 2 or Surface Pro 3. This is great so you can use every charger, even the one from your phone. But to be honest you don’t really want to do this, because the charging speed using a phone charger is very slow. And on the other hand you lose the magnetic adapter safety feature.

Heat and Fan Noise

The Surface 3 comes equipped with Quad Core Intel Atom x7-Z8700 processor and I had never had any issues with heat or fan noise. To be honest, I am not even sure the Surface 3 has a fan. But on the other side, the workloads you are running on the Surface 3 are not even close as powerful as the applications you run on the Surface Pro 3.

Type Cover

Surface 3 Type Cover

The Surface 3 also comes with an own Type Cover in the right size. Microsoft also improved the Type Cover from the Type Cover 3 which you got with the Surface Pro 3, even you can not really see it directly. Especially the keys feel much better, which make it a perfect typing machine. I am sure with the next release of the Surface Pro comes out, the improvements in the Type Cover for the Surface 3 will be included in that as well.

Battery life and Performance

Surface 3 IE

I think this is the most important part for most of the people reading this review. First, the performance of the Surface 3 is a lot better than the performance of the Surface 2 and the same goes for battery life. But for the same the Surface Pro 3 performance is much better compare to the Surface 3. But this was clear right? The Surface 3 is designed as a tablet with light usage for office apps and some other apps as well, and the Surface 3 handles that just fine. The Surface Pro 3 is design as a powerful notebook replacement which is a total different story, so if you are looking on a powerful machine you should go with the Surface Pro 3, if you need something thin and light to use as a tablet and Office usage, you will definitely be happy with the Surface 3. As I mentioned I got the smallest version with only 2GB of RAM, and this is my real bottleneck if you are doing multitasking. So if you are expecting to do any real multitasking you should go for the 4GB version. The other performance bottleneck is the disk speed, this is a huge difference to the Surface Pro 3 as well, but to be honest for the things I use the Surface 3 for, I don’t really care.

Camera

Microsoft also upgraded the back-facing camera to a 8 megapixel camera which is even better than the Surface Pro 3. So you can do some simple but good shots with the tablet. But of course this never comes close to your Nokia Lumia.

Software and Accessories

Surface 3

Software is where everything comes together. Windows 8.1 works perfectly on the Surface 3 and I really like the mix between touch and keyboard usage. I use it as a tablet with touch apps and can run a full desktop applications like Office to get real work done. I really love the combination of different Microsoft Services such as Skype or Skype for Business for communication. But where the real power comes together is with OneDrive and OneNote. The new Surface Pen and OneNote are already a perfect combination. You can press the OneNote button on the Surface Pen and OneNote opens instantly and you can start taking notes, even if you are not logged. The notes from OneNote get sync via OneDrive on all your devices like your phone or desktop pc. Microsoft is not only bringing software services together, they are now also integrate hardware.

After the first 2 weeks I upgraded the Surface 3 to Windows 10, and I have to say the new tablet mode works perfectly, performance of the Surface 3 with Windows 10 is great.

Microsoft also offers a lot of different accessories like display or Ethernet adapters for the Surface Pro line and they will now also work with the Surface 3. You can use the same USB Ethernet Adapter or Mini Display Port adapter as for the Surface Pro 3. Microsoft also released a new docking station for the Surface 3, which helps you make the Surface 3 also a desktop replacement.

Conclusion

Well if you have to choose between the Surface 3 and the Surface Pro 3 you really have to consider what the devices are designed for. The Surface Pro 3 can be the tablet which is your powerful laptop and desktop replacement. The Surface 3 is more your lightweight tablet which also can be your laptop if you only need it of light Office usage. So if size and weight matter to you, and you don’t need great performance you should go for the Surface 3. But if you need any performance you may want to go with the Surface Pro 3, even the i3 version has much more power than the Surface 3. Another thing here is, if you want to go with the Surface 3, I really recommend you to spend that extra money and go with the 4GB model.



Windows 10 Product Familiy

Windows 10 Editions and upgrade paths

Last week Microsoft announced the different editions of Windows 10. As in the past Microsoft offers Windows in different editions that are tailored for various different use cases and scenarios. Windows 10 will power an broad range of devices – everything from PCs, tablets, phones, Xbox One, Microsoft HoloLens and Surface Hub. It will also power the world around us, core to devices making up the Internet of Things, everything from elevators to ATMs to heart rate monitors to wearables.

Editions

The different Windows 10 editions address specific needs of our various customer groups, from consumers to small businesses to the largest enterprises.

  • Windows 10 Home – Windows 10 Home is the consumer-focused desktop edition.
  • Windows 10 Mobile – Windows 10 Mobile is designed to deliver the best user experience on smaller, mobile, touch-centric devices like smartphones and small tablets.
  • Windows 10 Pro – Windows 10 Pro is a desktop edition for PCs, tablets and 2-in-1s. Building upon both the familiar and innovative features of Windows 10 Home, it has many extra features to meet the diverse needs of small businesses. Windows 10 Pro will add some management capabilities to the Windows 10 and also adds Windows Update for Business.
  • Windows 10 Enterprise – Windows 10 Enterprise builds on Windows 10 Pro, adding advanced features designed to meet the demands of medium and large sized organizations. Windows 10 Enterprise will be available to Volume Licensing customers and adds some features such as Direct Access, Branch Cache and Windows Update for Business. With Windows 10 Enterprise customers will also get access to the Long Term Servicing Branch to better control deployment options for future updates.
  • Windows 10 Education – Windows 10 Education builds on Windows 10 Enterprise, and is designed to meet the needs of schools – staff, administrators, teachers and students. This edition will be available through academic Volume Licensing, and there will be paths for schools and students using Windows 10 Home and Windows 10 Pro devices to upgrade to Windows 10 Education.
  • Windows 10 Mobile Enterprise – Windows 10 Mobile Enterprise is designed to deliver the best customer experience to business customers on smartphones and small tablets. It will be available to our Volume Licensing customers. Windows 10 Mobile Enterprise will adds a flexible ways for businesses to manage updates.
  • Windows 10 IoT  – Windows 10 will also be avaialble for different industry devices like ATMs, rteail point of sale, handheld terminals and industrial robotics and as well for IoT (Internet of Things) devices with a Windows 10 IoT Core edition.

Upgrade

As Microsoft  announced in January this year, for the first time ever, Microsoft is offering the full versions of Windows 10 Home, Windows 10 Mobile and Windows 10 Pro as a free and easy upgrade for qualifying Windows 7, Windows 8.1 and Windows Phone 8.1 devices that upgrade in the first year after launch. Once you upgrade, you have Windows 10 for free on that device. In the Microsoft Partner Network Microsoft published some more information about the upgrade paths.

Microsoft will offer a free upgrade to Windows 10 for qualified Windows 7, Windows 8 and Windows Phone 8.1 devices in the first year. After the first year, upgrades will be paid via boxed product and VL Upgrades.

  • Windows 8/8.1 and Windows 7 Home Basic and Home Premium devices upgrade to Windows 10 Home
  • Windows 8/8.1 Pro and Windows 7 Professional and Ultimate devices upgrade to Windows 10 Pro
  • If upgraded within the first 12 months following launch, the device will receive ongoing Windows 10 updates for free for the life of that device
  • Excludes Windows Enterprise and RT devices
  • The free Windows 10 upgrade is delivered through Windows Update; domain-joined machines can manually get the update via Windows Update. The upgrade cannot be deployed through WSUS.

Windows Update for Business

At Ignite, Microsoft  announced the free Windows Update for Business service, available for all Windows Pro and Windows Enterprise devices, designed to help organisations keep their Windows devices always up to date with the latest security and features. In case you missed it, check out the blog, Announcing Windows Update for Business for what the service will provide.



InstantGo powercfg

Troubleshoot Windows InstantGo (Connected Standby)

In Windows 8 Microsoft released a feature called InstantGo (formerly know as Connected Standby) which should bring smartphone like Power Management features to your Windows tablet or notebook. Devices such as the Surface Pro 3 do offer this feature. This post should help you troubleshoot issues with InstantGo or Connected Standby.

InstantGo requires the following:

  • Windows 8.1 Operating System (In Windows 8 this is called Connected Standby)
  • A firmware flag indicating support for the standard
  • The boot volume must run on a SSD disk
  • Support for NDIS 6.30 by all network devices
  • Passive cooling on standby
  • Secure Boot
  • Memory to be soldered to the motherboard
  • The Hyper-V Hypervisor role must be disabled on Windows 8 and Windows 8.1 systems. Windows 10 Hyper-V will allow you to use Hyper-V and InstantGo at the same time.

Check if the hardware supports InstantGo

To check if your hardware supports InstantGo you can run the following command:

 
powercfg /a

InstantGo powercfg

InstantGo Issues / Connected Standby Issues

In some case you can run in some issues where you have your battery draining more than expected during the InstantGo or Connected Standby time. This could be of the following reasons:

  • Drivers – Make sure you have the latest drivers installed
  • Firmware – Make sure you have the latest Firmware (BIOS) installed
  • Mails –  The Windows communication app keeps the broker infrastructure (BI) system active. BI, in turn, keeps the WLAN network up so that the system stays up-to-date with emails. If you get a lot of emails this can end up in a higher power drain.
  • Software –  Some installed legacy Software which does not let you go into the InstantGo modus.
  • VPN Clients – Some older VPN Clients can also cause issues with InstantGo
  • Network Activity – The WLAN device might have a challenging radio environment and the Windows system might not be able to establish a reliable Internet connection. We see how these events affect the WLAN device, which, in turn, impacts the battery.
  • Hyper-V – If you run Hyper-V in Windows 8 or Windows 8.1 you can not run InstantGo, this is solved in Windows 10.

Troubleshooting InstantGo / Troubleshooting Connected Standby

To get some more information about your device and InstantGo or Connected Standby you can use the following tools and reports.

powercfg /SleepStudy

Powercfg SleepStudy

The maybe best way to Troubleshoot Connected Standby or InstantGo issues, is to use the powercfg /SleepStudy command. This will generate a Sleep Study report which allows you to analyze different things about Conncted Standby:

Connected Standby / InstantGo Overview

SleepStudy Report

Connected Standby Transitions

SleepStudy Report Connected Standby Transitions

Connected Standby Sessions

Here you can analyze which application or driver did use battery resources during the Connected Standby session.

SleepStudy Report InstantGo

powercfg /batteryreport

powercfg batteryreport

With powercfg /batteryreport you can generate a report about how your battery is used.

Battery Report

And you can also see what kind of state drained your battery, if this was an active session or a Connected Standby session.

Battery Report Battery Usage

powercfg /energy

PowerCFG Engery

With powercfg /engery you can see not only InstantGo or Connected Standby issues, you can see what other applications, drivers and more does could drain your battery.

Energy Report

I hope this helps you to troubleshoot Connected Standby issues.

Sources