In this post I will show you how to check and change Nano Server Time Zone, Disk Space, Local admin credentials, Firewall, How to check edtion, host name etc.
- HOW TO CHANGE TIME ZONE
Connect to your Nano Server:
Enter-PSSession -ComputerName <nanoservername> and type in Get-TimeZone
As you can see my time zone is Pacific Standard Time, which is wrong because I live in Sweden.
First of all I would like to check all available Time Zones
Get-TimeZone -ListAvailable | ft
I will change my time zone to W. Europe Standard Time
Set-TimeZone -name “W. Europe Standard Time”
- HOW TO CHANGE LOCAL ADMIN PASSWORD
First let’s check the admin info by typing
Get-LocalUser -Name Administrator |fl
The Microsoft .NET Framework provides the SecureString object, which is a secure representation of a string. The following PowerShell command masks the string on the screen as you type it and stores it in a SecureString object:
$Password = Read-Host “Password” -AsSecureString
OBS!!!! “Password” — This is not the place where you are going to type in new pass
To change the password we need to type in
Set-LocalUser -Name Administrator -Password $Password
To verify type in Get-LocalUser -Name Administrator |fl
- HOW TO VIEW EVENT LOG FILES (NANO SERVER)
It will be very hard to view those log files with powershell so our best option is to use MMC on the management machine.
First, you will need to open firewall ports. If you do not enable it you will receive this error message
First type in:
Netsh advfirewall firewall set rule group=”Remote Event Log Management” new enable=yes
Next, open MMC on the management machine and connect to Nano server and that’s it.
- HOW TO CHECK NANO SERVER EDITION, INSTALLATION DATE AND VERSION
Get-ComputerInfo -Property Windows*
- HOW TO CHECK DISK, RESIZE IT, VIEW PARTITION
To check the disk we need to run
Get-Disk
To resize it we need to first edit and expand it in Hyper-V manager (If you are not familiar with Hyper-V, please take a look on my Deep Dive into Hyper-V 2016 series)
New size will be 15 GB
Now if we run Get-Partition we will see that the actual partition size is still 4 GB
To specify a new size type in
Resize-Partition -DiskNumber 0 -PartitionNumber 1 -Size (“Size in GB”)
New Size
- HOW TO CHECK FIREWALL AND MODIFY IT
To view Firewall Profile (Domain, Private, Public)
Get-NetFirewallProfile | select name, enabled
If you would like to disable or enable it, you can do it by running
Set-NetFirewallProfile domain/private/public -Enabled/ False
To view rules
Get-NetFirewallRule |ft
If you would like to enable or disable specific rule you can do it by typing
Set-NetFirewallRule -Name “Firewall Rule Name” -Enabled True / False
To view which rule is enable or disabled
Get-NetFirewallRule |select name, displaygroup, enabled
Cheers,
Nedim