Tuesday, March 29, 2011

Home /Active Directory /Microsoft /script /Windows /Windows 2008 R2 / Operating System Info–Batch File

Operating System Info–Batch File

Here is a simple batch file which you can use to identify the version of Operating System (OS).  I created this blog based on a question posted on the

@echo off
ver | find "6.1" > nul
if %ERRORLEVEL% == 0 goto Win7

ver | find "5.1" > nul
if %ERRORLEVEL% == 0 goto WinXP

goto exit

:Win7
echo Running Windows 7 Script
goto exit

:WinXP
echo Running Windows XP Script
goto exit

:exit

You can also use  systeminfo | find "Windows XP" or systeminfo | find "Windows 7" filter instead of VER command. 

The  Systeminfo /S ComptuerName command can be used to collect system information from a remote machine.  Here is an example to get the Logon Server information from a remote machine:

systeminfo  /s RemoteComputer | find "Logon Server:"

SS

Santhosh Sivarajan

Microsoft MVP · Identity & Cybersecurity Architect

Santhosh has 30+ years of hands-on enterprise experience in Identity and Access Management, Microsoft Entra ID, Active Directory, Microsoft 365 and Zero Trust architecture. He is the author of two books on Windows Server and security, and leads consulting, assessments and training at SAG Business Group.

2 comments:

I recommend you to check https://college-homework-help.org/blog/philosophy-degree out if you want to know more about philosophy degree. Education is really important for me , because I want to have successful career.

This blog is a great helper for online learning. This blog will not be the main channel of information for a student who wants to learn programming. The main channel for obtaining information for a student who wants to learn programming will be online courses. It doesn’t matter which: paid online courses or free online courses. You can start with free online courses to understand whether you need to invest in paid tuition. Of course, full-fledged paid courses with a lot of practice, the ability to ask questions to the teacher and with checking homework are very good. But not everyone has the opportunity at the initial stage to invest in training. And not everyone needs it. For example, free courses will be a great start for a person who is taking his first steps in a future profession. For example, some services such as Buypapercheap the cheapest essay writing service also offer free courses that will be a great start for a person who takes the first steps in learning how to write an essay. They will help a student who wants to get acquainted with programming for general development and to understand whether he needs in-depth knowledge in this matter. Yes, and studying in the online format of free courses is quite convenient. 888 In most cases, lectures are provided on record. They can be viewed at a convenient time in a convenient mode. For beginners, this is a big plus, regardless of financial capabilities. Especially if the training takes place simultaneously with work or study in another specialty.

Post a Comment

Popular Posts
Workstation Trust Relationship Issue Issue: You receive the following error message, when you try to login to the domain.  The security database on the server does not have ... ADMT Service Account - Permission and Configuration The ADMT service account needs to have proper permission in source and target domains.  You don’t need to use 2 separate accounts.  You can ... My First Peek into Microsoft Exchange 2010 By Santhosh Sivarajan Before I really dive into Exchange 2010, I thought I would install and play with it first. I took some screen shots and notes during the ins... ObjectSID and Active Directory What is an objectSID in Active Directory? When a new object is created in Active Directory, Domain Controller assigns a unique value used ... AD Group Report - List Group Members in Active Directory–PowerShell Script Updated Script - http://portal.sivarajan.com/2011/10/search-ad-collect-local-admin-group.html Script #1 This script... Add Users to a Group–PowerShell Script Purpose – Add users to a group from an input file – PowerShell V2 Script.  Input file – Input file (Users.csv) contains samAccountName in... User Account Migration and Merging – Part I (ADMT) Part I - User Account Migration and Merging Using ADMT Part II - User Account Migration and Merging Using QMM pre-creating user account ... User Account Migration and Merging – Part II (Quest Migration Manager) Part I - User Account Migration and Merging Using ADMT Part II - User Account Migration and Merging Using QMM Pre-creating user account in... Delete Stale or Inactive Computer Accounts from Active Directory Here is an easy way to identify and delete inactive or stale computers in an Active Directory environment.  Using the dsquery command you c... Converting PowerShell (PS1) to EXE / Standalone Application As we know, there many applications available to convert a PowerShell file to a standalone executable file.  Based on my experience, PowerSh...