DigitalDeviation

a little deviation never hurt anyone

Windows Update Error Code 8024402C

When attempting to install updates from WSUS, you might receive the follow error:

Windows Update encountered an unknown error. Code 8024402C

Windows Update Error Code 8024402c

Windows Update Error Code 8024402c

Typically this would point to connectivity.  After you’ve verified network connectivity to your WSUS server, you can follow these steps:

  1. Stop the Windows Update Service
    net stop wuauserv
  2. Delete the contents of C:\Windows\SoftwareDistribution
    rmdir C:\Windows\SoftwareDistribution /s /q
  3. Start the Windows Update Service
    net start wuauserv
  4. Check for updates
    wuauclt /detectnow /reportnow

You can string all of this together in a batch like so:

net stop wuauserv
rmdir %windir%\softwaredistribution /s /q
net start wuauserv

Outlook 2010 Shared Exchange Mailboxes

Outlook 2010 Shared Exchange Mailboxes

Handling Sent & Deleted Items

Microsoft Outlook 2010 introduced several new features. Unfortunately, it removed one feature that many organizations utilize: sent items & deleted items support for shared mailboxes. By default, Outlook 2010 will place all sent items and deleted items in the user’s mailbox. The issue with this is that users of a shared mailbox cannot see what emails have been sent out or deleted. In Outlook 2007, you could manually enable this feature by adding a registry key. This doesn’t work the same way in Outlook 2010. There is a fix though.

  1. Obtain the hotfix from Microsoft found at http://support.microsoft.com/kb/2459115 You need will need to fill out the information to have Microsoft send you a link to the hotfixes. There is one for x64 and x86.
  2. Install the provided hotfix.
  3. On the client computer logged in as the user, add the following registry key (based on http://support.microsoft.com/kb/972148):
    [HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Preferences]
    "DelegateSentItemsStyle "=dword:00000001
  4. In the mail profile, add each shared mailbox as an account.
  5. Reboot the computer.

Eject a CD/DVD Drive with Powershell

Here’s a quick Powershell script to eject all CD/DVD drives on a computer.  This uses the WMPlayer COM object.

$wm = New-Object -ComObject "WMPlayer.ocx"

$drives = $wm.cdromCollection<a href="http://digitaldeviation.com/wp-admin/edit.php">All Posts</a>

for($i = 0; $i -lt $drives.Count; $i++) {
    $drives.Item($i).Eject()
}

Great for playing jokes on co-workers or locating a PC.

Change DNS Servers Remotely with Powershell

At some point most admins will need to change a DNS server (or two) on their network.  This is an easy change for DHCP clients, but can be a real pain for statically assigned clients.  Below is a simple Powershell script that runs through a list a computer names and updates the DNS servers on the clients.


$servers = "SERVERA","SERVERB","CLIENT1"

foreach($server in $servers) {
Write-Host "Connect to $server..."
$nics = Get-WmiObject Win32_NetworkAdapterConfiguration -ComputerName $server -ErrorAction Inquire | Where{$_.IPEnabled -eq "TRUE"}
$newDNS = "192.168.1.200","192.168.1.201"

foreach($nic in $nics) {
Write-Host "`tExisting DNS Servers " $nic.DNSServerSearchOrder
$x = $nic.SetDNSServerSearchOrder($newDNS)

if($x.ReturnValue -eq 0) {
Write-Host "`tSuccessfully Changed DNS Servers on " $server
} else {
Write-Host "`tFailed to Change DNS Servers on " $server
}
}
}

Simply change $servers to match your list of computers.  What’s that you say?  Don’t feel like typing out a comma separated list of computers?  Change line 1 to $servers = Get-Content C:\PathToFile\computers.txt to feed in a list of computers from a text file.

This has been tested on Windows Server 2003, Windows Server 2008, Windows Vista, Windows 7, and Windows XP.  The script does requires WMI access to the computers so be sure to add an exception to the firewall if needed.

Netdiag [FATAL] Could not open file C:\WINDOWS\system32\config\netlogon.dns for reading

When you run the netdiag command on a Windows Server 2003 server, you may encounter the following errors:

[FATAL] Could not open file C:\WINDOWS\system32\config\netlogon.dns for reading.
[FATAL] Could not open file C:\WINDOWS\system32\config\netlogon.dns for reading.
[FATAL] No DNS servers have the DNS records for this DC registered.

This is because the 32-bit version of netdiag, while supported by Microsoft, isn’t able to locate the DNS file in a 64-bit installation.  To fix this issue, copy netdiag.exe from the Windows Server 2003 64-bit installation CD (SUPPORT\TOOLS\Support.cab) to C:\Program Files (x86)\Support Tools.

McAfee Agent & AntiVirus Uninstall – Completely remove McAfee via command line/script

If you’re like most admins out there, you’ve had a need to completely remove McAfee components whether it’s troubleshooting or getting rid of the product.

McAfee is a stubborn product to remove.  They offer a tool to assist with removing their consumer products.  This won’t work on managed installations (ePO) unfortunately.  So I’ve assembled a batch file to handle the dirty work.  As always, use at your own risk.

Code

@ECHO OFF
REM McAfee Removal Script
REM Last Update: 11/01/2010
REM

ECHO Removing AntiSpyware
"C:\Program Files\McAfee\VirusScan Enterprise\scan32.exe" /UninstallMAS
"C:\Program Files (x86)\McAfee\VirusScan Enterprise\scan32.exe" /UninstallMAS

REM Kill McTray &amp; Trusted Validation
ECHO Killing processes
taskkill.exe /f /t /im mctray.exe
taskkill.exe /f /t /im mfevtps.exe

ECHO Removing VirusScan 8.0
msiexec.exe /x {5DF3D1BB-894E-4DCD-8275-159AC9829B43} REMOVE=ALL REBOOT=R /q

ECHO Removing VirusScan 8.5
msiexec.exe /x {35C03C04-3F1F-42C2-A989-A757EE691F65} REMOVE=ALL REBOOT=R /q

ECHO Removing VirusScan 8.7
msiexec.exe /x {147BCE03-C0F1-4C9F-8157-6A89B6D2D973} REMOVE=ALL REBOOT=R /q

ECHO Remove McAfee Agent
"C:\Program Files\McAfee\Common Framework\frminst.exe" /forceuninstall /silent
"C:\Program Files (x86)\McAfee\Common Framework\frminst.exe" /forceuninstall /silent</code></strong>
<span style="font-size: 12px;"><code><span style="font-family: courier new,courier,monospace;">"c:\Program Files\Network Associates\Common Framework\frminst.exe" /forceuninstall /silent</span></code></span>

REM Remove McAfee Registry Keys
ECHO Removing Registry Keys
REG DELETE HKLM\SYSTEM\CurrentControlSet\services\McShield /f
REG DELETE HKLM\SYSTEM\CurrentControlSet\services\McTaskManager /f
REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfeapfk /f
REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfeavfk /f
REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfebopk /f
REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfehidk /f
REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mferkdet /f
REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfetdik /f
REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\mfevtp /f
REG DELETE HKLM\SOFTWARE\McAfee /f

If you have suggestions, problems, etc. please post below.  Happy hunting!

Indexing Adobe Arobat PDF files with SharePoint Server 2007

So you have a snazzy new SharePoint site?  It works wonderfully with Office documents.  Now you need to index all those PDF files that are floating around the office.  Fortunately, this is an easy fix.

Prerequisites

  • Windows Server 2008 R2 Standard
  • Microsoft Office SharePoint Server (MOSS) 2007
  • Adobe IFilter 9.0 for 64-bit platforms – Download
  • Adobe Acrobat Reader (to view documents)
  • A GIF to use for the Acrobat file icon – Download

Installation

  1. Extract and run PDFiFilter64installer.  Follow the prompts.
  2. Add C:\Program Files\Adobe\Adobe PDF iFilter 9 for 64-bit platforms\bin to your PATH variable.  (Right click on Computer –> Properties –>Advanced system settings.  Click the Advanced tab and click on the Environment Variables button)
  3. Open SharePoint Search Administration. (Central Administration->Shared Services Administration)
  4. Click on File Types
  5. Click on New file type.  Type in pdf for the file extension and click OK.
  6. Open regedit and navigate to \\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf
    Change the (Default) key to {E8978DA6-047F-4E3D-9C78-CDBE46041603}.
  7. Copy your PDF GIF icon to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES.
  8. Open C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\DOCICON.xml in Notepad.
  9. Under the <ByExtension> section add:
    <Mapping Key=”pdf” Value=”youricon.gif”/>
    Save the file.
  10. Restart the server.

There you have it.  Searchable PDF files with the proper icon.  You can initiate a full crawl again just to be sure everything already existing gets indexed.  Bear in mind that scanned PDF files (those generated from multi-function scanner/printer/fax units) are often images embedded in the PDF document and aren’t searchable.

Resources

Hash Large Files with .Net SHA1/MD5

I’ve been working on an application that checks for duplicate files.  One of the better ways to test whether files are identical is to hash them.  MD5 hashing is common, but it has been known to cause collisions.  I elected to use the SHA1 algorithm instead.

In my testing, I’ve found that I can has a ~1GB file within about 7 seconds without consuming an equal share of memory.

You will need the following namespaces:

  • System.Security.Cryptography
  • System.IO

SHA1 Hash Example Code:

public string SHA1HashFile(string sPath) {
	string sHash = "";

	using (StreamReader sr = new StreamReader(sPath)) {

		SHA1CryptoServiceProvider sha1h = new SHA1CryptoServiceProvider();
		sHash = BitConverter.ToString(sha1h.ComputeHash(sr.BaseStream));
	}

	return sHash;
}

Usage: SHA1HashFile(“C:\\Path\\File.iso”);

MD5 Hash Example Code:

public string MD5HashFile(string sPath) {
	string sHash = "";
	using (StreamReader sr = new StreamReader(sPath)) {
		MD5CryptoServiceProvider md5h = new MD5CryptoServiceProvider();
		sHash = BitConverter.ToString(md5h.ComputeHash(sr.BaseStream));
	}

	return sHash;
}

Usage: MD5HashFile(“C:\\Path\\File.iso”);

COM 10016 Errors with SharePoint 2007 and Windows Server 2008 R2

It seems that by default SharePoint 2007 has some DCOM/IIS related issues on Windows Server 2008 R2.  I’ve run into this error multiple times on multiple servers:

EVENT ID: 10016
SOURCE: DistributedCOM
LEVEL: ERROR
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID

{61738644-F196-11D0-9953-00C04FD919C1}

and APPID

{61738644-F196-11D0-9953-00C04FD919C1}

to the user DOMAIN\USERNAME SID (S-1-5-21-000000000-3444370893-82664450-4606) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.

This error is related to the DCOM launch and activation permissions for the IIS WAMREG admin Service.  Typically you can resolve this error by granting the needed permissions in Component Services.  With Windows Server 2008 R2, all of the tabs are disabled.

To fix this error:

  1. Click the “Start” menu and then “Run…”
  2. Type in “regedit” and click “OK”
  3. Navigate to HKEY_CLASSES_ROOT\AppID\{61738644-F196-11D0-9953-00C04FD919C1}.  You could also press “CTRL+F” and search for {61738644-F196-11D0-9953-00C04FD919C1}.  It will be the first key found.
  4. Right click on the key and choose “Permissions”.
  5. Click on the “Advanced” button.
  6. Choose the “Owner” tab.
  7. Choose the “Administrators” group and click “OK”.
  8. On the permissions dialog, grant the “Administrators” group full control and click “OK”.  Close regedit.
  9. Open Component Services from the Administrative Tools menu.
  10. Locate the IIS WAMREG admin Service.  Right click on it and choose “Properties”.
  11. Click on the “Security” tab.
  12. Under “Launch and Activation Permissions”, click on the “Edit” button.
  13. Click the “Add” button and add the WSS_WPG & WSS_ADMIN_WPG groups.  You may need to change the Location to the server you’re working on if you’re on a domain.
  14. Check the “Local Activation” boxes for each of teh WSS groups. Click “OK”
  15. Click “OK” on the permissions dialog.
  16. Reboot the server.

Note that this will need to be done on each server in your SharePoint farm.

How to stream media to your Xbox360 using TVersity

I’ve been a long time TVersity user.  Love the app.  It’s the nicest of the UPnP streaming out there.  Well documented, easy to use, etc..  Enough with the kissing up…

One thing I’ve been struggling with as of late is streaming large videos across the network.  I’ve started ripping my DVDs & Blu-rays so the family can watch them whenever (and so the discs don’t get goobered up).  The trouble I’ve found is that if they are not a lower bitrate WMV, transcoding will darn near kill your PC.  As a result you get crappy (technical term), choppy video.  Since I can’t leave well enough alone, I spent many hours trying to come up with a solution.

This guide will (hopefully) help you stream various video file formats/containers including the Matroska .mkv files.

What You Need

A Word on MKV Files

I think it’s important to quickly cover .mkv or Matroska files.  MKV files are containers for video, audio, subtitle, or picture files.  They are NOT video files themselves.  They merely contain the video/audio/etc..  This allows for multiple languages and subtitles to be packaged into a single file.  More on Matroska files here.

Software

This has been tested on Windows 7 64-bit and Windows Server 2008 R2.  This should work on on Windows XP as well.  If you’re running an anti-virus program, you may want to exclude your media directories from being scanned when accessed.  I would still advise that you run a nightly scan on your entire computer just to be safe.

Hardware

You will need a PC with a dual-core processor at bare minimum.  Why you ask?  Well because you will be using the PC to do the heavy lifting otherwise known as transcoding.  The more CPU you can toss at it the better.

You will need some RAM too.  At least 2GB.  Again, the more the merrier.  Though this is NOT as important as CPU.

Your network needs to not suck.  If your Xbox is on a wired connection, you should be good.  If your Xbox is connected via wireless, make sure the signal is good.  A poor signal will cause issues.

Basic hard drives should work fine.  Internal (SATA) drives will perform better than external.  Externals do work fine for smaller videos though.

My Hardware Setup:
BFG nVidia 8800GT Video Card
BFG 680i Motherboard
Intel Q9550 2.83Ghz Quad-Core
6GB RAM (no pagefile)
WD 36GB Raptor Hard Drives in RAID0 (operating system)
WD 1TB USB External Hard Drive (movies / music /pictures)
Windows 7 Enterprise 64-bit
Xbox360 Elite

My Network Setup:
Xbox360 Wired to a Linksys WRT54G acting a as client-bridge (running dd-wrt firmware)
Linksys WRT54G acting as an AP (PC wired to this)

As you can see, I am using wireless.  My SNR is excellent though.  I have no signal issues.

Installation Steps

  1. Install MediaInfo.
  2. Download TVersity.
  3. Install TVersity, but do NOT install the TVersity codec pack.
  4. Install CCCP using the defaults.  (Don’t mess with the settings.  I know it’s tempting.)
  5. Open the TVersity GUI.
  6. Under Library, add a folder for your videos.  Click advanced and choose “always” under the transcode options.  (At this point you’re probably complaing about quality because everything will be transcoded.  Well, quit.  Read to the entire article first.)
  7. In the Settings menu, choose “Transcode”.

So here’s where things get interesting.  I’m going to give you all of my settings that work for me.  First I need to tell you that I “dumb” things down to 720p.  Why you ask?  Well quite honestly 1080p is rough on hardware.  There aren’t currently any hardware decoders for the format so it tends beat up the CPU.  The other part is that 720p looks just fine to me.  Heck the Xbox can’t even do Dolby Digital on streamed movies so what’s the point.  That said, here are my settings:

  • When to transcode: Only when needed
  • Decrease the bitrate…: Unchecked
  • Maximum Video and Image Resolution:
    Video: 1280 x 720
    Images: Who cares
  • Windows Media Encoder
    Use DirectShow for Windows Media Encoding: Checked
    Windows Media 7
  • Optimization: Quality
  • Connection Speed and Quality
    Wireless 54G
    Medium (if you’re using wireless, choose medium)
  • Compression: Minimum
  • Decoding Speed
    Decode the media as fast as…: Checked
  • Audio Capture
    Use Stereo Mix: Unchecked

There you have it.  It wasn’t complex, but it did take some time to fine tune everything.  Some movies will still buffer at the start.  They shouldn’t pause during the movie though.

Problems?

Well it could be a myriad of things.  Open Task Manager and watch your CPU, memory, disk, and network utilization.  My quad-core sits at around 75-79% CPU, 8-10Mbps network, and 2-8MB/s disk activity.  You mileage will vary.

Also, use the MediaInfo tool.  It will give you a wealth of information about your files.  Pay special attention to bitrates.  High bitrates will kill the network.

All else fails, feel free to leave a comment.  I’ll do what I can to help.

« Older posts

© 2014 DigitalDeviation

Theme by Anders NorenUp ↑