Posts tagged windows

Disable IPv6 with a script

I like this script that Misha put together to quickly disable IPv6 on all interfaces:

@Echo off
@ECHO Windows Registry Editor Version 5.00 > %TEMP%\DisableIPv6.reg
@ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters] >> %TEMP%\DisableIPv6.reg
@ECHO "DisabledComponents"=dword:000000ff >> %TEMP%\DisableIPv6.reg
REGEDIT /S %TEMP%\DisableIPv6.reg

Set Windows Server 2008 R2 to sync to an external NTP source

Thanks to this site, synching Server 2008 R2 to an external NTP server isn’t too bad.  Here’s what the commands boil down to:

net stop w32time
w32tm /config /syncfromflags:manual /manualpeerlist:0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org
w32tm /config /reliable:yes
net start w32time
w32tm /query /configuration

Register an ActiveX control for all users of a terminal/Citrix server

A customer recently asked me about how to register an ActiveX control so that all users of a terminal/Citrix server could download/run it, regardless of rights.

I can’t even begin to tell you all the things I tried to get this working, but some things that I had no success with were:

  • Adding the site with the .cab file to the Trusted Sites list via GPO
  • Deploying the .cab file as an .msi via GPO
  • Logging in to each Citrix server individually as admin and running the ActiveX control
  • Smashing my face into a dull #2 mechanical pencil

What finally did it for me was the following:

  • Log in to one of the servers as an admin and download/run the ActiveX control.
  • The .cab file for that ActiveX file should be somewhere in your temporary Internet files:

  • Locate that file, browse into it, and extract all the files to a new folder on a file share that you can easily copy files to other servers from.
  • Write a script that copies the contents of the folder to the Download Program Files folder on the target server(s).  For example:

xcopy C:\folder-you-extracted-cab-files-to\* "\\name-of-target-server\c$\windows\downloaded program files\" /Y

  • Run PsExec against any .ocx files that were copied into the Downloaded Program Files folder.  For example:

PsExec \\name-of-target-server regsvr32 /s "c:\windows\downloaded program files\cPPUI.ocx"

Now whenever I have a new ActiveX file that needs to be registered for all users, I can make a few modifications to my script and update all my servers in seconds!

How to fix getting prompted for SBEAGENT.MSI in Vipre Enterprise

One of my customer’s, shortly after a Vipre antivirus deployment, found that any time they right-clicked the start menu, they’d get the following error on one of their machines:

A quick chat with the friendly Web chat folks at GFI, and I was on my way:

  1. Create a new .MSI installer using the Vipre console.
  2. Delete this reg key: HKEY_CLASSES_ROOT\Installer\Products\116445D9734F351419E319EC305638CC
  3. Install the new .MSI on top of what’s already there.
  4. Reboot.

Ka-powzie!  Thanks GFI!

Write your own power scheme for your PC

One of the first things I change when I get a new PC is the way it handles putting the monitor and hard disk to sleep.  I finally did it enough times that it bugged me enough to script it using this article, which walks you through the commands necessary to built out a custom config.  Here’s mine:

powercfg -DUPLICATESCHEME 381b4222-f694-41f0-9685-ff5bb260df2e 11111111-1111-1111-1111-111111111111
powercfg -CHANGENAME 11111111-1111-1111-1111-111111111111 braimee
powercfg -s 11111111-1111-1111-1111-111111111111
powercfg -change -monitor-timeout-ac 0
powercfg -change -monitor-timeout-dc 10
powercfg -change -disk-timeout-ac 0
powercfg -change -disk-timeout-dc 10
powercfg -change -standby-timeout-ac 0
powercfg -change -standby-timeout-dc 10
powercfg -change -hibernate-timeout-ac 0
powercfg -change -hibernate-timeout-ac 15

And that ends up looking like this:

Create files of any size using the command line

I had a situation recently where I needed to create a file of a certain size so I could email it and make sure a customer’s mail server rejected it.  This site shows you how to do it.  The format of the command is:

fsutil file createnew <name of file> <size in bytes>

I needed an 11mb file, so I did:

fsutil file createnew bigfile.txt 11000000