Windows – Find your ‘Uptime’

KB ID 0000552 

Problem

There are lots of reasons you might want to know your PC/Servers uptime, to make sure a client has rebooted a server (like you asked them to), or to see if a server has had a BSOD and rebooted overnight, etc.

Check Uptime with Task Manager

You can get your uptime from the Task Manager’s “Performance” tab.

To launch Task Manger

Start > Run > Taskmgr.exe {enter}. or Press CTRL+SHIFT+ESC, or Right click the Task bar > Select Task Manager.  > Options

 

Use PowerShell to find Server Boot time

From Powershell Use the following syntax;

[box]

[Management.ManagementDateTimeConverter]::ToDateTime((Get-WmiObject Win32_OperatingSystem).LastBootUpTime)

[/box]

Use PowerShell to find Uptime

From Powershell Use the following syntax;

[box]

(Get-Date) - [Management.ManagementDateTimeConverter]::ToDateTime((Get-WmiObject Win32_OperatingSystem).LastBootUpTime)

[/box]

Option 3 – Use Systeminfo to find Uptime

From command line execute the Systeminfo | find /I “boot” command;

 

Option 3 -Use Net Statistics to find Uptime

You can get uptime information by either querying the workstation service, or the server service, issue either, the following command;

[box]

net statistics workstation

[/box]

Or the following command;

[box]

net statistics server

[/box]

Option 4 – Use Uptime.exe to find Uptime

Download uptime and put a copy in your “System32” Directory, you can then use the uptime command.

Option 5 – Use WMI (Windows Management Instrumentation) to find Uptime

Issue the following command;

[box]

wmic os get lastbootuptime

[/box]

As you can see the result is not pretty, it is presented in UTC format.

20120109081112.925800+000 = Year 2010, Month 01, Day 09, Time 08:11:12

Option 6 – Check the Event Log to find Uptime

Launch the Event Viewer (eventvr.msc) > Windows Logs > System Log > Find > Search for Event ID 6005, (Note: This event gets logged each time the server boots, as the event log service starts). Event ID 6006 will be labeled as “The event log service was stopped.” This is synonymous with system shutdown.

 

Note: Event 6013 is periodically logged this shows the machines uptime at that point.

Note:  In the event of an abnormal shutdown look for Event ID 6009 indicates the processor information detected during boot time. Event ID 6008 will let you know that the system started after it was not shut down properly.

Option 1 – Use Uptime.exe to get a Remote Machines Uptime

Already mentioned above download uptime and extract it to your system32 directory. Then to get a remote machines uptime, use the following command;

[box]

uptime {Name of Remote PC}

[/box]

Use Powershell to get a Remote Machines Uptime

Use the following syntax;

[box]

[Management.ManagementDateTimeConverter]::ToDateTime((Get-WmiObject Win32_OperatingSystem -ComputerName RemoteMachine).LastBootUpTime)

[/box]

Related Articles, References, Credits, or External Links

NA

Add The ‘Group Policy Management Console’

KB ID 0001615

Problem

On a Domain Controller you will get Group Policy Management, (by default) listed under administrative tools. But if you have a ‘Management Server‘ of a ‘Jump Box‘, that you want to install the tool onto, (without making it a domain controller!) Then do the following;

Option 1: Install GPMC with Powershell

This is the quickest and simplest option! Open a PowerShell Windows and execute the following command;

[box]

Install-WindowsFeature –Name GPMC

[/box]

 

Note: For older, (Windows Server 2012 and older) servers use the following commands instead.

[box]

Import-Module servermanager
Add-WindowsFeature –Name GPMC

[/box]

Option 2: Install GPMC with Add Roles and Features

From Server Manager > Manage > Add Roles And Features > Proceed to ‘Features‘ > Select Group Policy Management > Next > Finish.

Related Articles, References, Credits, or External Links

NA

PowerShell: Find Computers Last Logon Date

KB ID 0001612

Problem

I had to find the last time a particular server had logged on for a client the other week, so we knew for sure it was dead!

Solution

The two commands you may need are;

Locate Servers Last Login Time

[box]

Get-ADComputer -Filter {OperatingSystem -Like '*SERVER'} -Properties lastlogondate,operatingsystem | Select name,laslogondate,operatingsystem

[/box]

Locate Clients Last Login Time

[box]

Get-ADComputer -Filter {OperatingSystem -notLike '*SERVER'} -Properties lastlogondate,operatingsystem | Select name,laslogondate,operatingsystem

[/box]

Short and sweet!

Related Articles, References, Credits, or External Links

NA

VMware Horizon: ‘VM With Unsupported Guest OS’

KB ID 0001592

Problem

Seen when attempting to deploy Window Server 2016, as an ‘Image‘ (Parent VM,) with VMware Horizon View.

‘VM With Unsupported Guest OS’

I double checked, and Server 2016 (Standard and DataCenter) were supported, as was Server 2019 (Standard and DataCenter.) The image also had a new version of the VMware Horizon View agent installed in it?

Solution

In my case this was an embarrassingly easy fix, previously I’d deployed Windows 7, 8, and 10 with Horizon View, this was the first time I’d ever deployed a server OS as a VDI image, (With Windows Server Datacenter, this works out cheaper, licensing wise).

By Default: VMware Horizon View does not allow server operating systems, (even though they are supported.) You just need to enable the feature! Launch Horizon Administrator, View Configuration > Global Settings > Edit > Tick ‘Enable Windows Server Desktops‘ > OK.

Doh! That cost me two hours, (hope it saved you some time).

Related Articles, References, Credits, or External Links

NA

Scheduled Task Error 0x1

KB ID 0001457

Problem

While replacing a server, I copied over some scripts, (batch files) the client was using to back up some data. I scheduled them on the new server, but noticed they were finishing with a status of 0x1. (and not actually backing anything up!)

Solution

Edit the properties of the job > General Tab > Tick “Run with the highest privileges”.

Note: You can also tick “Do not store password. This task will only have access to local computer resources” if the process is only running on this machine.

Actions > Select the Action and edit it > Change the ‘Start In‘ section, so that it points to the folder the script is in > OK >Apply > OK.

Rerun the job and it should complete with a 0x0 status (successful).

Related Articles, References, Credits, or External Links

NA

Windows – Get a List of all Installed Programs (and Updates)

KB ID 0000619

Problem

I needed to get a list of installed programs from a server I was having problems with, so I could compare the results with another server. Note: This will work on Windows client OS’s as well.

Solution

1. On the machine in question launch a command window.

2. To display all the installed programs execute the following two commands;

[box]
WMIC

product get name,version [/box]

3. To export all the installed programs to a text file (c:ProgramList.txt) execute the following two commands;

[box]
WMIC

/output:c:ProgramList.txt product get name,version [/box]

4. Here’s the sort of information you can get.

5. To export all the installed updates to a text file (c:UpdateList.txt) execute the following two commands;

[box]
WMIC

/output:C:UpdatelList.txt QFE get [/box]

Note: You can get a list of updates by running the ‘systeminfo’ command but this gives you much more information.

6. Here’s the sort of information you can get.

 

Related Articles, References, Credits, or External Links

NA

Enable Aero for RDP “One or more of the themes has been disabled by Remote Desktop Connection settings”

KB ID 0000647 

Problem

If you have enabled Aero on your remote machine, when you connect to it via RDP you will see this error, (if you try and change the theme to Aero).

One or more of the themes has been disabled by Remote Desktop Connection settings

Solution

1. Close your RDP session, and launch the RDP client software again > Options > Experience > Place a tick in “Menu and window animation”.

2. Reconnect to your machine.

Related Articles, References, Credits, or External Links

NA

Windows Server 2012 – Install Error

KB ID 0000618 

Problem

I thought I’d spin up Server 2012 today, and as usual with all new OS’s I run them up in VMware Workstation to take a look (I’m running Workstation 8.0.3 build-703057).

As soon as it started up I was greeted by this.

Your PC needs to restart.
Please hold down the power button.
Error Code: 0x0000005D
Parameters:
0x000000000FEBFBFF
0×0000000020000800
0×0000000000000000
0×0000000000000000

Below is information for VMware Workstation and ESXi 5

Solution

For VMware Workstation

1. In my case it was simply a BIOS setting that needed to be enabled. Enter your system BIOS and locate a feature called Data Execution Prevention, (or No Execute Memory Protection).

2. Enable that setting, then ensure you shut the machine down then manually power it back on again.

Additional Points to Note when installing Server 2012

Make sure on the properties of the VM > Hardware > Processors > Tick Virtualize Intel VT-x/EPT or V/RVI (Note: Virtual support should also be enabled in the host machines BIOS).

VMware Workstation – Error – “Virtualized Intel VT-x/EPT is disabled”

VMware Workstation likes to automatically install VMware Tools, Sometimes Server 2012 does not like this and sits with a black screen that will flash blue when you click on it. So to Stop it Installing VMware Tools, Options Tab > VMware Tools > Select Manual. Note: you can always snapshot it and then manually install it later it you want to test. This has been a problem since the early releases of Windows 8.

Solution For ESXi5

1. Here’s the same problem on an ESXi 5 host.

2. Before you do anything you need to be at ESXi 5.0 U1 for Server 2012 to be supported (That’s build number 623860 or better).

3. However in this case the problem is the same as above, The server in question was an HP Proliant ML 350 G5. Boot the server and press F9 to enter the RBSU > Advanced Options.

4. Processor Options

5. Enable ‘No-Execute Memory Protection” > Exit and save settings.

6. And now we are good to go.

Follow up

04/07/12 Email from Simon Reindl:

I had to update my Bios as InsydeH2O does not offer any tweaking options, It is using Compal Bios (previous 9, now 10 – downloaded from Compal.com. It is using InsydeH20 BIOS on a Compal motherboard. It is a custom build.

 

Related Articles, References, Credits, or External Links

NA

Windows Server – Disable IESC  (IE Enhanced Security Configuration)

KB ID 0000728 

Problem

We have had IESC (or IE Enhanced Security) in previous iterations of Windows Server, It is not a bad thing, in most cases you will not want people browsing the internet from a server anyway. Though when you have just built a server, and you are trying to get software and patches onto it it can be very annoying. With IESC enabled you will see this every time you visit a site;

Content from the website listed below is being blocked by the Internet Explorer Enhanced Security Configuration.

And this every time you try and download something;

You are attempting to download a file form a site that is not part of your Trusted Sites and that might be different from the website you are viewing.

Solution

1. From Server Manager (ServerManager.exe) > Local Server > IE Enhances Security Configuration > Then you can change the IESC for both administrators and normal users.

Related Articles, References, Credits, or External Links

Windows Server – Javascript Is Disabled