six demon bag
Wind, fire, all that kind of thing!
As a sysadmin I frequently have the need to get an overview of the utilization of particular system resources (disk space or memory for instance). Visualizing the numbers greatly helps with spotting bottlenecks.
One way to visualize data with PowerShell are
objects in Windows Forms, which are rather versatile, but not exactly what I
would consider straightforward. They also might be overkill for various tasks.
The current usage of a system resource for instance could easily be displayed
with a bar graph in a text console.
Posted 23:38 [permalink]
When setting up RedHat Enterprise Linux (RHEL) or CentOS systems I always find it handy to have a local repository with the RPMs from the install media. On hosts without Internet connection it saves me the trouble of having to shuffle install media around whenever I need to install an additional package after the system was initially set up. Even if the host is configured to use an online repository, keeping a local repository doesn't hurt except for a little extra disk space, which is cheap enough these days.
Posted 16:30 [permalink]
As a system administrator you're sometimes tasked with finding out who the last person logged into a particular computer was, or when a particular person was last logged in on some computer(s).
Windows records this information in the Security eventlog when you enable auditing account logon events.
Posted 16:03 [permalink]
VSS writers are application-specific components for Microsoft's Volume Shadow Copy Service, which ensure the consistency of application data when a shadow copy is created. That's quite useful for creating consistent backups of a system. However, some of these writers go into error states more or less frequently. And Microsoft did not deem it necessary to document how to reset writers without rebooting the entire system (or at least I didn't manage to find that piece of information).
Posted 18:34 [permalink]
For a couple months now I've been observing the Automatic Updates service (wuauserv) causing high CPU load on hosts running Windows Server 2003 or Windows XP after new updates had been released. The problem vanished after the updates had been installed.
Posted 12:13 [permalink]
List DFS replication groups:
dfsradmin rg list
List replicated folders in a replication group:
dfsradmin rf list /rgname:<REPL_GROUP>
Posted 15:16 [permalink]
Python's interactive mode is very convenient, because you can try simple stuff without having to write it to a script first. Since I have to do a lot of VBScript lately, I wanted to have something like that for VBScript, too.
Update: Added an Import() procedure for loading/executing additional code from other VBScript files.
vbsh can now be customized with an optional init script
Update: Added a function to look up keywords in the VBScript documentation (requires that
script56.chm is installed in the current working directory, the Windows help directory, or one of the directories in the
%PATH%). Note that you'll need the English language version of
script56.chm, since other language versions use different internal paths.
Posted 18:03 [permalink]
Today I encountered the following error message on one of my servers (running Windows Server 2008) when I started Process Explorer:
Posted 11:58 [permalink]
The VBScript language doesn't provide a feature for including other code files, so you can't easily build and import code libraries. However, the missing feature can be emulated using the
ExecuteGlobal statement in a custom
Posted 14:00 [permalink]
Running the following command for backing up a printserver configuration
"%SystemRoot%\System32\spool\tools\PrintBrm.exe" -B -S server -F "C:\path\to\backup.pbk"
gave me an error after listing the printer ports:
The following error occurred: 0x8007007b. The filename, directory name, or volume label syntax is incorrect. Check the eventlog for detailed information about the error which occurred.
PrintBrm doesn't seem to like double quotes around the backup file name, at least not on Windows Server 2008 R2 SP1. I changed the command line to
"%SystemRoot%\System32\spool\tools\PrintBrm.exe" -B -S server -F C:\path\to\backup.pbk
and the backup ran without issues.
Posted 16:15 [permalink]
Internet Explorer exposes a COM object that can be controlled programmatically e.g. from a VBScript. The usual way is to create a new Internet Explorer instance and work with that:
Set ie = CreateObject("InternetExplorer.Application")
However, sometimes you may want to use an already running instance instead of creating a new one.
Posted 20:59 [permalink]
Although IBM doesn't officially support its TSM client on Linux distributions other than SLES and RHEL the client works quite nicely on Debian. With version 6.4 you need at least the following 4 packages on AMD64 systems:
Posted 00:46 [permalink]
Back in the days of Windows 2000 Server and Windows Server 2003 it was common practice to copy the
i386 folder from the CD to the server and change the
SourcePath registry value, so you wouldn't have to shuffle installation media around for adding/removing Windows features. With the advent of Windows Vista and Server 2008 Microsoft introduced the component store. Now all Windows features were put on disk by default and simply had to be activated/deactivated. That increased the size of a Windows installation by factor 3-4, but on the other hand disk space had become rather inexpensive, so it wasn't that big a deal. And although the component store can be a little fragile at times it usually works quite well.
So far, so good. But what happened now with the release of Windows 8 and Server 2012? Someone at Microsoft decided that the component store took up too much space, so they introduced a new concept called "Features on Demand", which simply means that administrators can free disk space by removing components from the store. The .Net Framework 3.5 for instance was removed by default.
This is not a bad thing per se. However, the removed framework still shows up as an installable feature (e.g. in Server Manager), only now you're prompted for an alternate source path when you choose to install the framework. So what we have now is that the component store still eats up disk space (I didn't notice any significant reduction in used disk space) and we're back to either shuffling installation media around or copying sources to the local harddisk (eating up even more disk space).
Posted 15:06 [permalink]
Sometimes you run into a situation where you need to determine the permissions on some directory tree. Be it to document or clean up permissions on the subdirectories of a share, to troubleshoot permission issues due to deleted accounts or groups, or whatever. Manually analyzing permissions is quite tedious, even when using standard tools like
xcacls. The output of
XCACLS.vbs isn't any better, but since it's a script, I considered modifying it to suit my needs … until I took an actual look at the script. I abondoned the thought afterwards.
Posted 20:14 [permalink]
For a customer project I had to create a couple dozen virtual machines on our Hyper-V cluster. The machines were to be installed via a 3rd party software deployment system (the customer doesn't use SCCM), so I had to assign static MAC addresses and enable PXE boot. The respective reservations on the DHCP server had to be created from the MAC addresses in a second step, because the customer domain is separated from the infrastructure domain.
Posted 11:09 [permalink]
I've been working on a project where I needed to migrate (clone actually, in order to maintain a fallback scenario) virtual machines from external (standalone) Hyper-V hosts to a Hyper-V cluster. The external hypervisors were not members of the same domain as the cluster nodes. The networks were separated by a firewall. A trust relationship between the domains was not desired.
System Center Virtual Machine Manager 2012 (SCVMM) supports this scenario, but there are several steps that must be performed to prepare for the migration.
Posted 20:03 [permalink]
On Linux you can mount disk images via loopback devices. Partitions inside disk images can be made accessible via
kpartx from the multipath-tools. Unfortunately this does not work for VirtualBox disk images (.vdi). It's possible to loop-mount those disk images as network block devices, though.
Posted 01:53 [permalink]
Tired of writing the same boilerplate code for querying objects from Active Directory over and over again? So am I. Thus I wrote
ADQuery, a class that wraps the initialization of the required objects, sets some default values and also provides properties to allow for adjusting the usual parameters as the situation requires. See API documentation for details.
Posted 19:49 [permalink]
API documentation is nice, and being able to generate it from the code is even nicer. However, unlike Perl, Python, Java, or several other languages, VBScript doesn't have a feature or tool that supports this. Which kinda sucks.
I tried VBDOX, but didn't find usability or results too convincing. I also tried doxygen by adapting Basti Grembowietz' Visual Basic doxygen filter. However, doxygen does a lot of things I don't actually need, and I didn't manage to make it do some of the things I do need. Thus I ended up writing my own VBScript documentation generator.
Posted 22:54 [permalink]
When building xlockmore (version 5.39) on one of my Debian boxes I encountered two linker issues, one with
libxext, the other with
libcrypt. Both issues persisted even after running configure with the
--without-crypt options. WTF?! Why would anyone with at least half a brain provide
--without-FEATURE options for apparently required features?
Posted 02:03 [permalink]