Tag: PowerShell

Last updated by at .

PowerShell Windows Server System Insights

Windows Server 2019 System Insights

Currently Microsoft is releasing preview versions of Windows Server 2019 to the public. In one of the latest Windows Server Insider Preview builds, Microsoft released a new feature called Windows Server System Insights. The Windows Sevrer 2019 System Insights capability is a machine learning or statistics model that analyzes system data to give insight into the functioning of your Windows Server deployment. These predictive capabilities locally analyze Windows Server system data, such as performance counters or ETW events. This is helping IT administrators proactively detect and address problematic behavior in their Windows Server environment.

Windows Admin Center System Insights CPU Capacity forecasting

System Insights runs completely locally on Windows Server. All of your data is collected, persisted, and analyzed directly on your local machine, allowing you to realize predictive analytics capabilities without any cloud-connectivity. However, if you are using for example Azure Log Analytics (OMS), you forward the events created by System Insights to Azure Log Analytics, which than can give you a unified view about your environment.



Install SNMP Feature on Windows Server Core

Install SNMP on Windows Server Core

If you run Windows Server as Core Installation, like Windows Server 2016 Core or any Microsoft Hyper-V Server edition and you want to use SNMP (Simple Network Management Protocol) on that system, you first have to install the SNMP feature on that Core Server. After that you can use the MMC to remotely connect to the services list on the Core Server.

Install SNMP on Windows Server Core

First lets see if the SNMP feature is installed, using PowerShell:

By default the SNMP feature is not installed. To install the SNMP feature on Windows Server Core, you can run the following command:



Windows Server FTP

Install FTP Server on Windows Server

Windows Server has IIS build in, which also offers a FTP server option. The File Transfer Protocol (FTP) is still a very popular protocol that allows users to simply upload and download files. Of course today you have more modern options, however it is still very often used and a lot of legacy applications still support it.

In this blog post I wanna quickly go rough how you can install the FTP Server on Windows Server. I do this on a brand new Windows Server 2019 operating system, however it didn’t really change since early Windows Server versions.

Install FTP Server Feature on Windows Server

Install FTP on Windows Server using PowerShell

First you will need to install the FTP feature. I usually simply do that using PowerShell to install the FTP Server feature in Windows Server. You can also do that using the Server Manager. However, if you want to use PowerShell, you can use the following command:



Windows Server 2019 USB Drive

Create a USB Drive for Windows Server 2019 Installation

This blog post covers how you can create a bootable USB media drive to install Windows Server 2019 on a physical server. This blog post will not use any third party tools, it only uses build in tools which you can find on Windows 10 or Windows Server. Depending on your system you will need it to install it on a BIOS system or a UEFI based system, which is slightly different since UEFI will use GPT disks and BIOS will use a MBR disk.

Getting ready to create a USB Drive for a Windows Server 2019 Installation

First you will need to have all prerequisites in place.

  • Download the Windows Server 2019 ISO File
  • A USB Drive with at least 8GB size



AzsReadinessChecker

Azure Stack Readiness Checker – AzsReadinessChecker

Since I am dealing with a lot of Azure Stack installations I also want to share some interesting tools you can leverage like the Azure Stack Capacity Calculator and others. One of the latest I want to share with you is the Azure Stack Readiness Checker PowerShell module called AzsReadinessChecker. This PowerShell module helps you to run validations of your environment and resources before you deploy Azure Stack. The AzsReadinessChecker module for example validates things like:

  • Certificates
  • Azure Active Directory
  • Azure Accounts
  • Azure Subscriptions

The Start-AzsREadinessChecker cmdlet also helps to generate a Certificate Signing Request (CSR) which you can summit to your CA or your CA provider to get the specific certificates.



Flush DNS Cache with PowerShell

Flush DNS Cache with PowerShell

Awhile ago I wrote a blog post called PowerShell Networking Cheat sheet, where I put together several networking commands which can be replaced by PowerShell. One of the latest once I saw and a couple of people requested is how you flush the DNS cache using PowerShell. This would allow you to replace ipconfig/ flushdns with PowerShell. Guess what, Microsoft as now a PowerShell cmdlet for that.

Clear and Flush DNS with PowerShell

You can use the following command to clear the DNS cache on a Windows system using PowerShell

Show DNS Cache with PowerShell

There is also a PowerShell command to show you the DNS cache:

I hope this blog post and these commands are useful.



Windows Users with PowerShell

Manage Local Windows User with PowerShell

Awhile ago Microsoft added a new PowerShell module to manage local Windows user accounts. This post should quickly show you how easily you can for example use PowerShell to create a new Windows User account, remove a Windows user account or modify windows users and groups with PowerShell.

List Windows User accounts with PowerShell

The most simple one is obviously to list Windows users or groups, using the PowerShell Get- commands.

List all local Windows Users:

List all local Windows Groups:

Create new Windows User account using PowerShell

There are three different account types you can add to Windows 10:

The following part describes how you can add them to your Windows system using PowerShell

To create a new Windows User account you can simply use the following command:

If you want to see that password you can also use this method, to create a new Windows User:

Create a new Windows User account connected to a Microsoft Account using PowerShell

With Windows 10 you have the opportunity to login using Microsoft Accounts, for example with outlook.com or hotmail.com email aliases. For that you can use the folloing command to create a new Windows User connected to a Microsoft Account. In this case you will not need to configure a password for the account, since this is connected to the Microsoft Account.

You can also add Azure Active Directory (Azure AD) accounts if your business is for example using Office 365. The following command adds an Azure AD account to the local Windows Users:

Remove Windows User account using PowerShell

You can also simply remove user accounts from Windows using PowerShell. The following command will delete the account:

Change password of a Windows User account using PowerShell

To change the password of a local Windows User account, you can use the Set-LocalUser cmdlet. This also has some other options as well, but one of the most common ones is to reset the password.

Rename a Windows User account using PowerShell

To rename a Windows User account with PowerShell, you can use the following command:

Add Windows User account to group using PowerShell

This command for example adds users to the Windows Administrator group:

I hope this gives you a quick overview how you can manage local Windows User accounts using PowerShell.