Tag Archives: IT Toolkit

Getting System Information from the command line or Powershell

Although there are any number of tools available to gather and collate information regarding the configuration and composition of a computer, these are often overkill when all you wish to learn is one or more basic details like the processor type, memory, computer name etc.

A quick shortcut is to gather this information from the command line or Powershell.  Windows XP and later includes in the systeminfo utility. Typing this at the command prompt will produce information similar to this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
c:\systeminfo
Host Name:                 SOMEPC
OS Name:                   Microsoft Windows 7 Ultimate
OS Version:                6.1.7100 N/A Build 7100
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Member Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          SomeOwner
Registered Organization:
Product ID:                00428-321-7001132-70186
Original Install Date:     04/05/2009, 10:29:33
System Boot Time:          28/09/2009, 13:50:08
System Manufacturer:       Dell Inc.
System Model:              Latitude D820
System Type:               X86-based PC
Processor(s):              1 Processor(s) Installed.
[01]: x86 Family 6 Model 14 Stepping 8 GenuineIntel ~2000 Mhz
BIOS Version:              Dell Inc. A09, 04/06/2008
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume2
System Locale:             en-gb;English (United Kingdom)
Input Locale:              en-gb;English (United Kingdom)
Time Zone:                 (UTC) Dublin, Edinburgh, Lisbon, London
Total Physical Memory:     3,326 MB
Available Physical Memory: 858 MB
Virtual Memory: Max Size:  8,313 MB
Virtual Memory: Available: 5,500 MB
Virtual Memory: In Use:    2,813 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    somedomain.lan
Logon Server:              \\SOMEDC
Hotfix(s):                 4 Hotfix(s) Installed.
[01]: KB958830
[02]: KB969497
[03]: KB970789
[04]: KB970858
Network Card(s):           3 NIC(s) Installed.
[01]: Intel(R) PRO/Wireless 3945ABG Network Connection
Connection Name: Wireless Network Connection
DHCP Enabled:    Yes
DHCP Server:     10.10.0.1
IP address(es)
[01]: 10.10.0.100
[02]: fe80::901:8ac7:5a6b:1f56
[02]: Broadcom NetXtreme 57xx Gigabit Controller
Connection Name: Local Area Connection
Status:          Media disconnected

If you are using Powershell – if not, why not? – the get-wmiobject win32_computersystem command will return rudimentary details regarding the host PC.

1
2
3
4
5
6
7
PoSH>get-wmiobject win32_computersystem
Domain              : somedomain.lan
Manufacturer        : Dell Inc.
Model               : Latitude D820
Name                : SOMEPC
PrimaryOwnerName    : SomeOwner
TotalPhysicalMemory : 3487690752

Windows Task Scheduler Keyset does not exist Error

Task Scheduler is one of those great little components that once you set it, you tend to forget it. One of the Windows 2003 servers I tend has been running scheduled tasks flawlessly for over a year until they suddenly stopped one day. Every time I went to open/edit and individual task’s properties, a dialog with the following message appeared:

1
2
3
General page initialization failed.
The specific error is:0x80090016: Keyset does not exist
An error has occurred attempting to retrieve task account information. You may continue editing the task object, but will be unable to change task account information.

A solution to this problem is not readily apparent, more so after the ubiquitous net search returns results that relate to Windows 2000, not 2003. After some playing, and with reference to the MS KB article http://support.microsoft.com/default.aspx?scid=kb;en-us;246183, I got the Task Scheduler working again doing the following:

  1. Stop the Cryptographic service
  2. Delete the contents of the C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\S-1-5-18 folder – as a precaution, I made a backup first.
  3. Start the Cryptographic service (a server restart may be required)
  4. Re-assign the Run As user account for every required scheduled task

Getting Powershell Management Library for Hyper-V (PSHyper-V) up and running

One of the great capabilities of Powershell is the ability to extend its’ functionality through new libraries. One I am currently playing with is the Powershell Management Library for Hyper-V, or PSHyper-V. For Server Core and Hyper-V Server users, the cmdlets contained within this library add a new dimension of functionality and capabilities, and enable admins to reduce their reliance on Hyper-V manager to perform otherwise simple tasks.

Although you can load the library upon demand, there is another method available whereby it may be preloaded as part of your windows profile.

  1. Download the latest recommended release of PSHyper-V from http://www.codeplex.com/PSHyperv
  2. Copy the contents of the ZIP archive onto your Hyper-V server. In my instance, these were to a folder called c:\powershell
  3. To get your profile path, type the following from with a Powershell prompt:
    1
    $profile

    You will typically get something like:

    1
    C:\Users\your_user_name\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
  4. The file Microsoft.PowerShell_profile.ps1 is the Powershell script that is executed upon the startup of any Powershell prompt for your user account. In most circumstances, this script doesn’t exist, so you will need to create it (it is worth checking first). To create the script, enter the following into a Powershell prompt
    1
    new-item $profile -itemtype file -force
  5. Now edit this file and add the path to PSHyper-V.ps1 into it. In my example, this is as follows:
    1
    . c:\powershell\PSHyper-V.psq

    Note the dot-space prior to the file path. This is required to execute the script.
    (Editing this file on server core or Hyper-V server can be a bit of trial. In the end, I did it remotely.)

  6. That’s it. To test it, either start a new Powershell prompt. If all is well, a list of the loaded PSHyper-V cmdlets will be shown.

Thanks to the author of the Technet blog post from which I have sourced most of the information for this.

Virtual Server to Hyper-V: Parallel port driver service failed to start error

I’m currently migrating a substantial number of virtual machines (VMs) from Virtual Server to Hyper-V server.  Although this is a fairly painless process, a common error for Windows VMs relates to the parallel port service.  The system eventlog error goes something like:

The parallel port driver service failed to start due to the following error:  The service cannot be started, either because it was disabled or because it has no enabled devices associated with it.

The reason for this is quite simple:  Virtual Server supported parallel ports, whilst Hyper-V doesn’t.  Typically, any basic VM created through VS will incorporate a virtual parallel port even once the Hyper-V integration components includes in the new HAL are installed.

There are two options here, you can either manually hack your way through Windows removing all traces of the parallel port, or much simpler, completely disable the parallel port service.  The latter is somewhat easier, and may be accomplished in a matter of minutes:

  1. Backup your registry
  2. Open Regedit
  3. Go to HKLM > System > CurrentControlSet > Services > ParPort
  4. Change the start parameter value to 4.
  5. Restart your server – optional, but I do this to confirm this has worked.

That’s it.  Upon the next restart, you should not get any service  alert for the parallel port.

Getting list of network interface in Linux

For those of us used to Windows management tools, getting a comprehensive list of data regarding installed hardware on a Linux box can be a little daunting.  Whilst recently migrating a virtualised ubuntu box, I needed to find out just what network hardware was in use.

Within a linux shell, type the following

lshw -class network

This will produce a full list of all installed network hardware.  For newbies, the define name you are probably looking for is called logical name.

Manually Setting DNS Server Addresses in Ubuntu (Linux)

No matter how many times I have installed and configured Linux, I can never remember the name of the configuration file that stores the DNS/Nameserver details.  This really only applies if your Linux machine is using a static IP address.  In most scenarios, it does not apply to DHCP clients.

DNS server settings are stored in /etc/resolve.conf  To edit this file, enter the following command from the shell

1
$sudo nano /etc/resolv.conf

(If you have installed XWindows/Gnome, you can use sudo gedit /etc/resolve.conf instead)

Add the entries for your DNS or nameservers as follows

1
2
nameserver <IP address of DNS server 1>
nameserver <IP address of DNS server 2>

etc…

Toolkit: Virtual CloneDrive

As someone who uses ISO files on an almost daily basis, a tool like SlySoft Virtual CloneDrive is a brilliant utility that allows the easy mounting of any ISO file as local disk drive.  I’ve used several similar utilities over the years, but this one is the best I’ve used yet.  It has been installed on a variety of PCs including my venerable Thinkpad, and I have yet to experience any problems.

Virtual CloneDrive is a free download available through the SlySoft website at http://www.slysoft.com/en/virtual-clonedrive.html.

As usual, you use Virtual CloneDrive at entirely your own risk.