Stoppt die Vorratsdatenspeicherung! Jetzt klicken & handeln!Willst du auch bei der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:

six demon bag

Wind, fire, all that kind of thing!

2014-11-18

Reset VSS Writers

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).

See more ...

Posted 19:43 [permalink]

2014-11-03

VBSdoc - A VBScript API Documentation Generator

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.

See more ...

Posted 23:28 [permalink]

2014-07-11

Force Extensions into SeaMonkey

I'm using SeaMonkey as my web browser most of the time, because its user interface suits my needs best. However, some of my favorite extensions (namely text/plain and ReloadEvery) claim to be incompatible when trying to install them, although they actually work just fine with SeaMonkey. Here's how you can convince an extension that SeaMonkey is totally fine for installation.

See more ...

Posted 19:58 [permalink]

Compare ACLs

Recently I had the need to compare the ACLs of two Active Directory objects. With file ACLs I could expand their Access properties and compare the resulting lists with Compare-Object. However, for ACLs of Active Directory objects that didn't work, so I came up with the following function.

See more ...

Posted 18:50 [permalink]

2014-06-07

Translate VBA to VBScript

Since I'm seeing lots of questions like "how can I do FOO in Excel/Word/... with VBScript" I thought I'd post some guidelines on how to approach this kind of task.

In general, VBA and VBScript are quite similar, so most of the time you're better off recording a VBA macro and translate that to VBScript than writing the whole thing in VBScript from the get go. There are some notable differences between the two languages, though, which you need to observe when translating VBA to VBScript.

See more ...

Posted 15:26 [permalink]

2014-06-04

Domain Password Change in Remote Desktop Sessions

At work we're connecting to customer systems through a jump station. This creates the problem that for domain password changes on the customer systems I can't open the Windows Security dialog/screen via either Ctrl-Alt-Del (shows the one on the local computer) or Ctrl-Alt-End (shows the one on the jump station).

See more ...

Posted 23:14 [permalink]

2014-03-26

Lync Automation

We're using Microsoft Lync 2010 at work, and I find it quite annoying that the software keeps resetting my status to "available" when I don't want it to. So I started looking for a way to automate setting the status back to "busy".

Unfortunately the normal Lync installation doesn't seem to include a PowerShell module. There is, however, a .Net assembly included with the Lync SDK (this article describes the details). Having to install Visual Studio, SQL Server Express and the Silverlight 4 Tools seemed a little overkill to me, though.

See more ...

Posted 21:46 [permalink]

Cleanup of DB2 Backups Fails with Return Code 136

Recently I encountered a rather weird problem with the cleanup of backups of some of our DB2 databases. The database backups are done via TSM by running the following command:

db2 "backup db DBNAME online use tsm"

Cleanup of obsolete backups is done by running the following commands via a scheduled task.

db2adutl delete full older than TIMESTAMP db DBNAME without prompting
db2adutl delete logs between S0000000.LOG and S(xxxxxxx-1).LOG db DBNAME without prompting
db2 "connect to DBNAME"
db2 "prune history DATE and delete"
db2 "prune logfile prior to Sxxxxxxx.LOG"
db2 "connect reset"

Sxxxxxxx.LOG is the oldest log of the oldest backup to be kept, which is extracted from the output of db2adutl query full db DBNAME. S(xxxxxxx-1).LOG is that log number minus one.

Although this setup had been working for several years without problems and no changes were made to the system, the log cleanup step suddenly started to fail for some databases while it still worked fine for the others.

See more ...

Posted 21:10 [permalink]

2014-03-18

Migration of SMB Shares

Share migration is a common (if not integral) part of a file server migration. If you just move the shares from one host to another host the process is pretty straightforward as described in MSKB article 125996:

  1. Export [HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares] on the old file server to a file:

    reg export HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares shares.reg
    
  2. Copy the file to the new file server and import it:

    reg import shares.reg
    
  3. Restart the Server service:

    net stop server && net start server
    
  4. Done.

See more ...

Posted 21:09 [permalink]

2014-02-26

A Bar Graph for the PowerShell Console

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 DataVisualization 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.

See more ...

Posted 23:38 [permalink]

2014-02-16

Create a Local Yum Repository

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.

See more ...

Posted 16:30 [permalink]

Check the Last User Logon

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.

See more ...

Posted 16:03 [permalink]

2013-12-20

Automatic Updates Consuming 100% CPU

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.

Apparently this is a problem with the Windows Update Agent, caused by inefficient handling of superseded updates. Installing the latest cumulative Internet Explorer update should resolve the problem.

Posted 12:13 [permalink]

2013-12-11

Some Useful DFS Commands

List DFS replication groups:

dfsradmin rg list

List replicated folders in a replication group:

dfsradmin rf list /rgname:<REPL_GROUP>

See more ...

Posted 15:16 [permalink]

2013-10-30

Interactive VBScript Shell

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.

I found this blog post that has almost exactly what I wanted, except for line continuation. Which is what I added (for my own convenience). You can download the modified script here.

Update: Added an Import() procedure for loading/executing additional code from other VBScript files.

Update: vbsh can now be customized with an optional init script %USERPROFILE%\init.vbs.

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]

2013-10-09

Process Explorer Error: .NET Performance Counters Are Corrupt

Today I encountered the following error message on one of my servers (running Windows Server 2008) when I started Process Explorer:

The .NET performance counters on this system are corrupt. Run Exctrlst from the Microsoft Windows Resource Kit to repair them.

See more ...

Posted 11:58 [permalink]

2013-08-27

Import other script files in VBScript

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 Import procedure.

See more ...

Posted 14:00 [permalink]

2013-06-20

PrintBrm Error 0x8007007b

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.

Turns out, 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]

2013-04-03

Attach to Internet Explorer

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.

See more ...

Posted 20:59 [permalink]

2013-03-12

TSM BA Client 6.4 on Debian

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:

  • TIVsm-BA
  • TIVsm-API64
  • gskcrypt64
  • gskssl64

See more ...

Posted 00:46 [permalink]