Get Windows Server Uptime (also Windows 10)

I have needed to retrieve the uptime from several Windows servers in the last few months. There is a number of ways to do this but I can’t seem to remember how to do this when I need to. Obviously a native “uptime” command would be too easy. So here is one way (use these commands in the cmd.exe terminal):

net statistics server

Look for the “Statistics since” line.

Or use this command:

systeminfo | find "Time"

On windows 10:

net statistics workstation

Note that these commands don’t return the actual uptime, but rather the last boot time. If you really want the math done for you so that you get the actual uptime in a human format, and you have a GUI front end, then do the following:

Start the Task manager.
Click the "Performance" tab.

Moving large amounts of data between Windows file servers using robocopy

Part of the reason I have been so behind on posting to this blog is that I am involved with moving ~50 windows and linux servers to a different data center. A large number of VM’s are being replaced by building out new servers on newer OS’s. I have gained plenty of new material to be posted in the blog, but haven’t had the time to write most of it down, never mind doing a proper blog post. Anyway…

One of the problems with moving data is that you also want to preserve ownership and permissions of the directory structures. This typically isn’t an issue if you are moving your own data but when moving data belonging to hundreds of other users and groups it is a requirement. Below is robocopy command that I used for much of the processes that I have been involved in. There are other ways of moving data between storage servers, but sometimes you have to run with what you have.

Before I go on – DO NOT JUST COPY AND PASTE THIS COMMAND – read the available options and use the ones that are appropriate for you. Type the following in a cmd window:

robocopy /?

In most of my cases, I wanted to replicate all data from one virtual drive to another virtual drive between two different servers. Hence, I use /MIR to specify that I want to mirror the data on the drives that are specified using the admin share names (E$). I also did not want to move recycle bin data so I used the /XD switch. /W:5 says to retry failed attempts every 5 seconds. The meat of the command are /E, /ZB, and /COPYALL options. I’ll leave you to the robocopy help output to digest these. Finally, I redirect the command’s output to a text file to be reviewed after the command has finished running. Robocopy’s help also list logging switches that you can utilize.

robocopy \storage1.mydomain\E$ \storage2.mydomain\E$ /E /ZB /COPYALL /MIR /W:5 /XD "$RECYCLE.BIN" > c:\Users\myadminaccount\Documents\robocopy.txt