Network Administrator Knowledgebase


October 31, 2008  12:58 AM

How to find the FSMO from Command Line

Michael Khanin Michael Khanin Profile: Michael Khanin

We can find the FSMO from command line by executing just one command and command line :) :

NETDOM QUERY /D:mydomain.com FSMO

October 31, 2008  12:53 AM

Install Windows Components from Command Line

Michael Khanin Michael Khanin Profile: Michael Khanin

Windows XP and Windows Server 2000 / 2003 have a built-in utility called the System stand-alone Optional Component Manager (sysocmgr.exe) to programmatically add or remove Windows components. Running sysocmgr.exe with no parameters will display the usage. The most basic command line is:

%windir%\system32\sysocmgr.exe /i:%windir%\inf\sysoc.inf This parameter (/i:) is always required and specifies the location of the master inf (%windir%\inf\sysoc.inf). When run it simply displays the Windows Components Wizard. Therefore the above command can be used as a shortcut directly to the Windows Components Wizard.

The real power of sysocmgr is in unattended mode. Additional parameters control the user interface, handle restarting, and control which components are added or removed by way of a standard Windows unattended answer file. Sysocmgr only looks in the [Components] and [NetOptionalComponents] sections, so the answer file can be specifically for component management or reused from a Windows unattended installation. Some components have their own unattended answer file sections, which are also parsed.

The following example uses an answer file (/u:) named ocm.txt in the temporary directory (%temp%\ocm.txt), suppresses any necessary restart (/r), and displays no user interface (/q):

%windir%\system32\sysocmgr.exe /i:%windir%\inf\sysoc.inf /u:%temp%\ocm.txt /r /q

The following example answer file adds the Simple Network Management Protocol (SNMP) service and configures the agent settings:

[NetOptionalComponents]
SNMP = 1

[SNMP]
Contact_Name = Michael Khanin
Location = Canada

Service = Physical, Applications, End-to-End

Community_Name = Public
Traps = server1.thesystemadministrator.com, server2.thesystemadministrator.com

Send_Authentication = Yes
Accept_CommunityName = Public:Read_Only
Any_Host = No
Limit_Host = server1.thesystemadministrator.com, server2.thesystemadministrator.com

Tips:

  • Sysocmgr can only be run by users with local administrative rights. It can be combined with runas, e.g.,

runas /user:admin “%windir%\system32\sysocmgr.exe /i:%windir%\inf\sysoc.inf”

  • Make sure that the target system has the Windows installation source available. The following registry values must point to a source to which the administrative user has access (e.g., if a network path, a local administrator account may not be able to access it):


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
“SourcePath”=”c:\\windows\\i386″
“Installation Sources”= … (REG_MULTI_SZ value)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
“SourcePath”=”c:\\windows\\i386″

Source: TheSystemAdministrator.com


October 31, 2008  12:48 AM

Create PDF Files Using a Network Printer (Completely Free)

Michael Khanin Michael Khanin Profile: Michael Khanin

Recently, I needed to find a free solution to creating a PDF file by using virtual network printer. The idea was send the job to the pdf virtual pdf-printer, then the user is prompted to ‘save as’, they select a location and the pdf is created.
After googleng and testing the solution was done.

I’ve used Bullzip to print pdf as a shared network printer. By doing few changes to the global. ini, Bullzip are then able to output pdf without any dialogue.

Here is a changes in the global.ini:

[PDF Printer]
DisableOptionDialog=yes
Output=R:\<basedocname>.pdf
ShowSaveAS=never
ShowSettings=never
ShowPDF=no
ConfirmOverwrite=no


October 31, 2008  12:34 AM

How many users are logged on to a server?

Michael Khanin Michael Khanin Profile: Michael Khanin

If for any reason, you need to know how many users are logged on to a server, It’s easy to check, at the server’s console (CMD.EXE) execute the following command:

NET SESSION | FIND /C “\\”


October 31, 2008  12:18 AM

Run a Batch File Before Logging on to Computer

Michael Khanin Michael Khanin Profile: Michael Khanin

Windows 2000 or Windows XP can be configured to run a startup script that is a batch file, VB script or JScript by using Group Policies. As well we can use AutoExnt utility, from the Resource Kit.

The AutoExNT service permits an administrator to configure a Windows based computer to run a custom batch file when first starting the computer. Also, a user or administrator is not required to be logged on at the time this custom batch file runs.

To start using  AutoExNTdo the following steps:

Installing the AutoExNT Service

  1. Using a text editor (such as Notepad), create a batch file named Autoexnt.bat and include the commands you want to run at startup in this file.
  2. Copy the Autoexnt.bat file you just created, in addition to the Autoexnt.exe, Servmess.dll, and Instexnt.exe files located in the Resource Kit CD-ROM to the %SystemRoot%\System32 folder on your computer.
  3. At a command prompt, type instexnt install, and then press ENTER.

You should then receive the following message:

CreateService AutoExNT SUCCESS with InterActive Flag turned OFF

To view the installation processes running on the desktop, you must install the AutoExNT service using the /interactive switch. For example, instead of typing instexnt install, you would type instexnt install /interactive at a command prompt, and then press ENTER.

Testing the AutoExNT Service
To test the AutoExNT service, log on to your computer with an account that has administrator credentials, type net start autoexnt at a command prompt, and then press ENTER. The Autoexnt.bat file should run in an MS-DOS window.

NOTE: The AutoExNT service includes a /interactive switch, analogous to the /interactive switch of the AT command. This switch permits you to view the status of processes as they run. Because no user environment variables have yet been declared when AutoExNT runs at system startup, you must use full path names.

Also, if you need a service to be running before you start running a dependent process, you may include a command to start this service at the beginning of your Autoexnt.bat file. For example, if your batch file has commands that require the Server service to be running, include a net start server command at the beginning of your Autoexnt.bat file.

Configuring the AutoExNT Service to Run at Startup
To configure the AutoExNT service to run at startup:

  1. Click Start, point to Programs, point to Administrative Tools, and then click Computer Management.
  2. Double-click the Services and Applications branch to expand it, and then click Services.
  3. Double-click the AutoExNT service, click Automatic in the Startup type box, and then click OK.


October 28, 2008  7:20 PM

Windows 7 Preview Video

Michael Khanin Michael Khanin Profile: Michael Khanin

http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=26996ced-888d-4892-b1be-5141da8272bd&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f9%2fc%2f8%2f9c8c2900-588c-4d22-bc0d-cdffce70ded8%2fPartnerVersion02.wmv

 Video by Mike Nash


October 28, 2008  7:11 PM

Hyper-V 2.0 Feature

Michael Khanin Michael Khanin Profile: Michael Khanin

Windows Server 2008 R2 will include Hyper-V 2.0, it promises to deliver the final pieces for enterprise level OS virtualization and to really compete with VMware at that level.

The most anticipated is of course Live Migration: moving running VM’s from one host to another without interruption of services running inside the VM’s. To accomplish this technique a new Shared Filesytem is needed and so will also be introduced in Hyper-V 2.0: Clustered Shared Volumes.

The Live migration works best together with System Center Virtual Machine Manager 2008, it can provide additional Live Migration management and orchestration scenarios such as Live Migration via policy.

Cool thing is you only need to update to Hyper-V 2.0, none of the rest of the infrastructure needs updating.

Logical Processor Support

  • Support for 32 logical processors on host computer
  • Twice the initial supported number of logical processors of Windows Server 2008 Hyper-V

Hot add remove Storage

  • Add and remove VHD and pass-through disks to a running VM without requiring a reboot.
  • Hot-add/remove disk only applies to VHDs and pass-through disks attached to the SCSI controller (not the IDE controller)
  • Hot-add remove of storage controllers is not supported

Benefits

  • Enables storage growth in VMs without downtime
  • Enables additional datacenter backup scenarios

SLAT
Second Level Translation (SLAT)

Overview

  • Leverage new processor features to improve performance and reduce load on Windows Hypervisor
  • AMD: Enhanced Page Tables
  • Intel: Nested Page Tables
  • Benefits
  • Improved memory management performance
  • Memory usage of Windows Hypervisor will decrease from approximately 5% to 1% of total physical memory.
  • More memory will be available for child partitions enabling higher consolidation ratios

Dynamic Memory
Overview

  • Pool of memory is dynamically distributed across VMs
  • Memory is dynamically allocated/removed based VM usage with no service interruption

Benefits

  • Enables much higher consolidation ratios per host by addressing the greatest limiting factor to consolidation: Memory

How

  • VM memory configuration includes:
  • Initial (what VM will boot with)
  • Minimum (what VM is guaranteed)
  • Maximum (what VM can grow to)
  • Memory is added via Hot-Add MEM functionality
  • Memory is removed via Balloon driver (supported OSs)

Boot from VHD

Allows any VHD to work on physical hardware, this is very interesting! Boot an OS VHD on your physical hardware.

You can find more information at the WinHEC session descriptions: http://www.microsoft.com/whdc/winhec/2008/sessions.aspx


October 28, 2008  6:47 PM

Detect HALs under WinPE (Vista) by running Batch Script

Michael Khanin Michael Khanin Profile: Michael Khanin

It’s a lot of posts that explained how to detect HAL. Almost all of those solutions done in VB script. As well I’ve seen a lot of post about “problems’ running VB script under WinPE. So, one day I tried to create a batch file, that allows to detect a HAL under WinPE. I did all my tests under VistaPE 12 (I’ve used the VistaPE v.12 RC1).

Here is content of HAL_Detector.bat script:

 

@echo off
REM .
REM . – Advanced Configuration and Power Interface (ACPI) PC:  ACPIPIC_UP
REM . – ACPI Uniprocessor PC:                                                 ACPIAPIC_UP
REM . – ACPI Multiprocessor PC:                                               ACPIAPIC_MP
REM .
REM . Advanced Configuration and Power Interface (ACPI) PC
REM . – halacpi.dll (renamed to hal.dll)
REM . – ntkrnlpa.exe
REM . – ntoskrnl.exe
REM .
REM . ACPI Uniprocessor PC
REM . – halaacpi.dll (renamed to hal.dll)
REM . – ntkrnlpa.exe
REM . – ntoskrnl.exe
REM .
REM . ACPI Multiprocessor PC
REM . – halmacpi.dll (renamed to hal.dll)
REM . – ntkrpamp.exe (renamed to ntkrnlpa.exe)
REM . – ntkrnlmp.exe (renamed to ntoskrnl.exe)
REM .
REM ……………….. Explanation About Diferent HAL Versions ………………… ……..
REM .

SETLOCAL
SET PC-HAL=
SET NumberOfLogicalProcessors=
SET New-HAL=

For /F “Tokens=3 Delims= ” %%a in (‘REG QUERY HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL000 /v HardwareID’) DO Set PC-HAL=%%a

IF %PC-HAL% == acpipic Set New-HAL=ACPI_Uniprocessor_PC
IF %PC-HAL% == acpiapic (
For /F %%a in (‘@WMIC COMPUTERSYSTEM GET NumberOfLogicalProcessors /value^|find “NumberOfLogicalProcessors”‘) do Set %%a
)

IF %NumberOfLogicalProcessors% ==  Set New-HAL=HAL_NOT_DETECTED
IF %NumberOfLogicalProcessors% == 1 Set New-HAL=ACPI_Uniprocessor_PC
IF %NumberOfLogicalProcessors% == 2 Set New-HAL=ACPI_Multiprocessor_PC
IF %NumberOfLogicalProcessors% == 4 Set New-HAL=ACPI_Multiprocessor_PC

@echo Detected HAL: %New-HAL%
@echo Number of Logical Processors: %NumberOfLogicalProcessors%

endlocal


October 24, 2008  1:26 PM

How to Set Time Zone from Command Line

Michael Khanin Michael Khanin Profile: Michael Khanin

If you need to change Time Zone for a lot XP computers, you can do this by simple :) command:

RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Central Standard Time

to change Time Zone to Jerusalem (GMT+02:00) run the following command:

RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z (GMT+02:00) Jerusalem


October 24, 2008  1:14 PM

How to Repair .NET 2.x

Michael Khanin Michael Khanin Profile: Michael Khanin

If for what ever reason you need to repair installation of .NET 2. x, you can do this from command line by running the following command:
“C:\WINDOWS\microsoft.NET\Framework\v2.0.50727\Microsoft .NET Framework 2.0\install.exe” /qb! /norestart


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: