Windows Networking

Many methods are available to get the system or system uptime or boot time. You can get this from a single command, GUI and from a PowerShell script for get uptime for multiple servers in a file.

Method 1 -This is the most easy way and get information quickly as compare to other method.

Step 1 - Open command prompt and type “net statistics server” or “net stats srv” and press Enter,

You will get date and time since server is up in line of Statistics since.

Method 2 -By System Information command. This will take few second to first get complete system information then search for boot time and show one line result.

Step 1 - Open command prompt and typesysteminfo | find "System Boot Time:"

Method 3 -From Uptime utility.

Step 1 - Download uptime.exe tool from click here. And save it in a folder.

Step 2 - Open command prompt and go to this folder directory and type “uptime

Method 4 -From Event Viewer.

Step 1 - Open Event viewer from computer management or open Run and type “eventvwr

Step 2 - Expand Windows logs and select system.

Step 3 - Click on Filter Current Log.. from right action panel. And type 6005 in field - <All Event IDs>

Step 4 - See latest log date and time, This date and time is the system boot time/uptime since.

Method 5 -You can also get this from WMI scripting. See below microsoft link for details.

https://blogs.technet.microsoft.com/heyscriptingguy/2005/08/02/how-can-i-determine-the-uptime-for-a-server/ 

Method 6 -From Powershell scripting, ANd here you can get uptime information, When you need for many server, And uptime will generate in a txt file.

Step 1 - Download uptime.ps1 by click here, Or use below script code and create a .ps1 file and put this in a folder. Here for example making a folder name - UptimeReport in C: drive

Script code -

$serverlist = "C:\uptimereport\serverlist.txt"

$reporttextfile = "C:\uptimereport\uptime.txt"

out-file -filepath $reporttextfile -append -InputObject ("Uptime Report Run " + (Get-Date))

foreach ($server in Get-Content s1.txt)

{

$ping = gwmi win32_pingstatus -f "Address = '$server'"

if($ping.statuscode -eq 0)

{

   $wmi = Get-WmiObject -ComputerName $server -Query "SELECT LastBootUpTime FROM Win32_OperatingSystem"    

   $now = Get-Date    

   $boottime = $wmi.ConvertToDateTime($wmi.LastBootUpTime)

   out-file -filepath $reporttextfile -append -InputObject ("Uptime for " + $server + ": " + ($now - $boottime))

}

else

{

   out-file -filepath $reporttextfile -append -InputObject ("Uptime for " + $server + ": Host offline")

}

}

Step 2 - Edit some lines from above script.

Change “C:\uptimereport\serverlist.txt” path to your server list file path, in which .txt file you can put multiple server list in below format.

Net-Server01

Net-ServerDC02

Net-SQLRS01

Change “C:\uptimereport\uptime.txt” path to your result file path, Where you can get uptime report of all your server.

Step 3 - Open PowerShell and run the .ps1 file then you will get your all server uptime report in above path of step 2 line 2.

Keyword - How to find Windows uptime?, How to Find Your Computer's Uptime and Installation Date, How to get the uptime in windows, How to Find the Uptime or Boot Time of a Server, How to find the system uptime in a Windows Server, Command line - How to find out uptime on Windows, Find server uptime in bulk by powershell, Powershell script to known multiple server uptime, Find system uptime on Server 2012, How To Check Your System's Uptime In Windows 7 | Vista | XP, Find Your Uptime in Windows Server 2008 / R2, Finding the Uptime of Windows Server 2008, Windows 10: How to See System Uptime

QUESTION - How to change user environment variable as standard or domain user in Microsoft windows 8.1/7

PROBLEM - When trying to edit or change environment variable, by click on "Advanced System Settings" from System or My computer Properties. It always asking for administrator password, whenever user have only the domain user or standard user permission. Even trying to edit only user environment variable not system environment variable.

SOLUTION -

First environment variable is two type first - System level which is called "System Environment Variable", Second - User level which is called "User Environment Variable".

If you want to changes as system level, Windows will always asked administrator password if you don't have administrator privilege. But you can run or manage any application with logged in user environmentvariable. But for that you need to be change or edit your user environment variable. Here I am providing two method from where you can change user environment variable without administrator password.

Method 1: From Control Panel

1) Open control panel and type environment variables in search box

2) Click "Edit environment variables for your account", It will never asked for password and you can make changes.

Method 2: From start menu or windows search.

For windows 7 -

1) Click start or press windows button on KB and type environment variables

2) Click "Edit environment variables for your account"

For Windows 8/8.1 -

1) Press Win+w or Win+s key to open search box

2) Ttype environment variables

3) Click "Edit environment variables for your account"

Method 3: From command

1) Open Run box or CMD prompt.

2) Type - "rundll32 sysdm.cpl,EditEnvironmentVariables"

3) It will open environment variables, And you see User variable for "username" section is highlighted and you can make changes.

https://lh3.googleusercontent.com/xE5D7tXj0O6s1RvwjRSt0n8Fqt3pmiyOccHmqc0ZPjkE4QFPrKlXCq2fAORqvKEeMQffX7_sBvGX8Aup2CBbLut5PHaifP3nkhpZL4YEzN_YJRKhPMtaBOa9QwOs6XmAGVdQ7F8

How to Clear / Delete all event logs in windows 8 / 7 from command line

That is good thing when you try to troubleshooting your system from being, And you want to delete or clear all of event logs from windows 8, 8.1, windows 7, windows vista and xp.

After that any types of event log will create from start again, And can be easy to find out the problem, Or if you want to hide or delete some suspected log.

Step to delete Logs -

Step 1 - Copy and paste these below command in notepad and save it as “clearalllogs.bat” or click here to download a .bat file from site, Its free.

@echo off

FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V

IF (%adminTest%)==(Access) goto noAdmin

for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")

echo.

echo goto theEnd

:do_clear

echo clearing %1

wevtutil.exe cl %1

goto :eof

:noAdmin

exit

 

Step 2 -Right click on file “clearalllogs.bat” and Run as administrator,

If you don’t have administrator privilege then ask for a administrator password, And type Username and password

 

-Or-

 

Run this .bat file from command line by run a cmd as administrator, For details see this below link -

http://networkingstudy.net/forums/index.php?topic=903.0

 

Step 3 - Now it take some minutes, Its depends on your number of event logs and size.

And you will see all of the your event logs will be clear by one click

 

Keyword -

How to delete all Windows Event logs at once, Event Viewer: Clear All Events - Windows 7, Clear an Event Log - TechNet - Microsoft, use .bat file to delete all logs, How to clear the Windows Event Log from the command Line, Clear all event logs on Windows using PowerShell, Delete all event logs at once in Windows 7, clear all event logs at once by .bat file in Windows 7, How to clear all Windows event log categories fast, wmic nteventlog where filename='security' cleareventlog, Windows Event Viewer tips and tricks, Script to collect all event logs off a remote Windows 7, Managing event logs from the command line, Microsoft Windows 8 Event Viewer, Alternative to standard event viewer of Windows, Use PowerShell to Clear All Logs, How to clear all event logs from command in windows, Use PowerShell to Clear All Logs.

 

There are many different ways of finding the serial number of a desktop or laptop computer. They are normally Numeric or Alphanumeric e.g. 0123456789 or A1B2C3E4.

Printed Label - Usually you can find out serial number on printed label as sticker on Laptop or desktop any side.

But in case printer label are not show properly or its sticker has been remove from laptop and desktop, In that case you have only option to see via command prompt. Get serial number via command prompt also help whenever you have assembled system, And you can not comfortable to open your computer hardware and see in motherboard.

Printed label example - See the below one example. If you also want to see more example of serial number go to - http://www.inf.aber.ac.uk/advisory/faq/267/

findserial9.jpg

How to get serial number via command prompt in any versions of windows OS.

Here is a quick command that you can use to find the Serial Number of your machine.

Step 1 - Open your command prompt and type following command.

Step 2 - “wmic bios get serialnumber

Step 3 - Now you can get serial number of your laptop from getting information from BIOS.

Note : - You can also get the model number of your machine by following command “wmic csproduct get name”

WMIC (Windows Management Instrumentation Command-Line)

You receive Error 0x800f0906: “Windows couldn't connect to the Internet to download necessary files. Make sure that you're connected to the Internet, and click Retry to try again.” during install or add the Microsoft .NET Framework 3.5 feature on a computer that is running Windows 8.1, Windows Server 2012 R2, Windows 8 or Windows Server 2012.

This error code occurs because the computer cannot download the required files from Windows Update.

Solution

This behavior can be caused by network, proxy, or firewall configurations or by network, proxy, or firewall failures. To resolve this problem, try to connect to the Microsoft Update website - http://update.microsoft.com/.

If you cannot access this page, Then check your internet connection or firewall/proxy setting which cause the access and download files from microsoft site.

Step 1 :- Try again by restarting BITS and DNS client service - How to restart BITS see http://networkingstudy.net/forums/index.php?topic=906.0

If nothing happens, Try to disable/stop firewall service. If still you are facing problem go to Next Step

Step 2 :- May configure the windows update from WSUS (Windows Software Update Service) by group policy. In that case you have to additional

Group Policy configuration for “Optional component installation and component repairon domain controller.

If you are using standalone Windows without domain or not configure windows update via WSUS Skip this step.

  • Open Group Policy Management Console from Administrative Tools or Run - gpmc.msc

  • Edit wsus group policy

  • Go to - Computer Configuration | Administrative Template | System | Double click on Specify settings for optional component installation and component repair, Select Enable.

  • If you want to specify an alternative source file, in the Alternate source file path box, specify a fully qualified path of a shared folder that contains the contents of the \sources\sxs folder from the installation media.

Example of a shared folder path: \\server_name\share\Win8sxs

  • Now run the gpupdate /force on server and client machine.

Step 3 :- Install or Add Microsoft .Net 3.5 features in Windows 8 by offline or Using Windows installation media.

You can use the Windows installation media as the file source when you enable the .NET Framework 3.5 feature. To do this, follow these steps:

  1. Insert the Windows installation media.

  2. Open Command Prompt by Run as Administrator, Help- How to run command as administrator

  3. Type - Dism /online /enable-feature /featurename:NetFx3 /All /Source:<drive>:\sources\sxs /LimitAccess

Note In this command, <drive> is a placeholder for the drive letter for the DVD drive or for the Windows 8 installation media. For example, you run the following command: Dism /online /enable-feature /featurename:NetFx3 /All /Source:D:\sources\sxs /LimitAccess

  • During running the command, If you get the error code - 0x800F0907, That means you don’t have a correct files in media, try to by using other/change source files or media.

Step 4 :- This step is only for server 2012 / 2012 R2

In Windows Server 2012 and Windows Server 2012 R2, you can also specify an alternative source by using Windows PowerShell cmdlts or by using the Add Roles and Features Wizard.

To use Windows PowerShell, follow these steps:

  1. Insert the Windows installation media.

  2. Open Power Shall by Run as Administrator

  3. Type - Install-WindowsFeature –name NET-Framework-Core –source <drive>:\sources\sxs

Example - Install-WindowsFeature –name NET-Framework-Core –source D:\sources\sxs

To use the Add Roles and Features Wizard, follow these steps:

  1. Insert the Windows installation media.

  2. Start the Add Roles and Features Wizard.

  3. On the Select features page, select the .Net Framework 3.5 Features check box, and then click Next.

  4. On the Confirm installation selections page, click the Specify an alternate source path link.

  5. On the Specify Alternate Source Path page, type the path of the SxS folder as a local path or as a network share path.

Click Ok and Click Install

Subcategories

Additional information

Commentics

<p>Currently under general maintenance.</p><p>Please check back shortly. Thanks.</p>