Category Archives: Windows knowhow

Howto do some things in Windows

Windows: Powershell script to fix and repair WMI

Hi,

this script repairs and recreates the WMI Repository of a Windows. For example, this occurs sometimes if you clone a Windows machine with an installed SCCM/SMS Client. The typical error in this case is “Failed to open to WMI namespace ‘\\.\root\CCM\SoftwareUpdates\DeploymentAgent’ (8007045b)”

Lasts start. Start a Powershell console as Administrator. Stop all services. Sometimes other services depends on the WMI Service and does not accept a stop request. Therefore you cannot stop the WMI service. TrendMicro Office is such a service. You have to kill them by TaskManager.

1
2
3
4
# Stop WMI
# Only if SCCM/SMS Client is installed. Stop ccmexec.
Stop-Service -Force ccmexec -ErrorAction SilentlyContinue
Stop-Service -Force winmgmt

(Re)Register WMI binary components

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[String[]]$aWMIBinaries=@("unsecapp.exe","wmiadap.exe","wmiapsrv.exe","wmiprvse.exe","scrcons.exe")
foreach ($sWMIPath in @(($ENV:SystemRoot+"\System32\wbem"),($ENV:SystemRoot+"\SysWOW64\wbem"))){
    if(Test-Path -Path $sWMIPath){
        push-Location $sWMIPath
        foreach($sBin in $aWMIBinaries){
            if(Test-Path -Path $sBin){
                $oCurrentBin=Get-Item -Path  $sBin
                Write-Host " Register $sBin"
                & $oCurrentBin.FullName /RegServer
            }
            else{
                # Warning only for System32
                if($sWMIPath -eq $ENV:SystemRoot+"\System32\wbem"){
                    Write-Warning "File $sBin not found!"
                }
            }
        }
        Pop-Location
    }
}

Reregister WMI Managed Objects
Continue reading Windows: Powershell script to fix and repair WMI

Windows: Change the Volume Serial Number of a partition or volume

Hi,

for some migration scenarios it is nesseccary to set Volume Serial Number of a partition or volume. For example when you move  a license manager to a new hardware and the licenses are bound to the disk serial.
Continue reading Windows: Change the Volume Serial Number of a partition or volume

Windows: Writing a new MBR an a USB Drive to boot Windows PE

Hi,

booting operating systems, such as linux live systems or Windows PE based installations (Windows Vista,7,8),  from a USB Drive or Stick is a nice featured.

Unfortunately each writes it own boot code to the MBR (Master boot record). The boot code of Windows PE 2 and later  loads \BOOTMGR, linux is usually loaded with \syslinux.

Well known linux installers like TUXBOOT, the Universal-USB-Installer or UNetBootin do updating the MBR by installing the syslinux bootloader.

To get the  Windows PE MBR back without formating the stick, do the following steps.
Continue reading Windows: Writing a new MBR an a USB Drive to boot Windows PE

Windows: Read the IP Address of a BMC Board

Most of the Serversystems have a Baseboard Management Controller (BMC) integrated for maintenace and management tasks.

Typical functions are, indepentend from the running operating system:

  • Shutdown and reboot
  • Switch Power On and Off
  • KVM (Keyboard, Video, Mouse) redirection
  • Hardware monitoring
  • USB redirection, connect the local DVD Drive to the Server over a LAN connection
  • and much more…

Usually, the BMC has its own LAN Interface and therefore an own IP Address.
Continue reading Windows: Read the IP Address of a BMC Board

Windows: Could not establish a remote desktop connection. No client licenses available.

Even though you have already installed and configured a Terminal Server license Server, you can not connect to a Terminal Server with the Remote Desktop Client from some individual clients. Some other will work.

The following error occurs:

The remote session was disconnected because there are no Terminal Server client access licenses available for this computer. Please contact the server administrator.
Continue reading Windows: Could not establish a remote desktop connection. No client licenses available.