How to set the network adapter order from the command line.

You will notice that now matter how you install your operating system, the network adapters order is very likely to be wrong, usually with the wireless adapter at the top.

How to find out:
  • Open the Control Panel.
  • Open “Network and Sharing Center”.
  • On the left pane, click on “Change Adapter Settings”.
  • Press the Alt key on your keyboard then on the menu bar that appears, click Advanced > Advanced settings.
  • On the first tab, “Adapters and Bindings” check what connection is at the top.
Now, there’s a way to automate this for enterprise deployment: Hyper-V Network VSP Bind Application.
This utility is not intended to be used on client Operating Systems but indeed works great. All the info is here: http://code.msdn.microsoft.com/nvspbind
Simply copy the executable to a known location and execute the following command:
nvspbind /++ “Local Area Connection” *
Where /++ puts the adapter named “Local Area Connection” at the top for all protocols with *
Namaste.

MDT 2010: Make the local admin password optional.

If you want to be able to set the local admin password but also leave the possibility to make it blank, edit the following file scriptsDeployWiz_Validation.vbs:

‘ Validate Password’
Function ValidatePassword
ValidatePassword = TRUE
NonMatchPassword.style.display = “none”
If Password1.Value “” then
If Password1.Value Password2.Value then
ValidatePassword = FALSE

NonMatchPassword.style.display = “inline”
End if
End if
ButtonNext.Disabled = not ValidatePassword
End Function

Namaste.

Add a domain user as the local admin with a script.

If you need to automate the attribution of local admin rights, use the following script, that will save you quite a few clicks:

Dim DomainName
Dim UserAccount
Set net = WScript.CreateObject(“WScript.Network”)
local = net.ComputerName
DomainName = “CONTOSO”

set group = GetObject(“WinNT://”& local &”/Administrators”)

UserAccount = InputBox( “Please enter the username (first.last) of the local admin or cancel (the user must exist in AD)” )

on error resume next
group.Add “WinNT://”& DomainName &”/”& UserAccount &”"
CheckError

sub CheckError
if not err.number=0 then
set ole = CreateObject(“ole.err”)
MsgBox ole.oleError(err.Number), vbCritical
err.clear
else
MsgBox “User added to the local Admin Group”
end if
end sub

Namaste.

Adding PXELinux option to WDS.

Deployment guru Johan Arwidmark has a pretty interesting article about adding a boot menu to WDS. But it’s about Windows Server 2008 R2. If, like me, you need info about Windows Server 2008, follow his step-by-step until step 7.

  • At step 7, open the Windows Deployment Services console, right click on your server, then click on Properties.
  • Go to the Boot tab.
  • Change the boot images to the following:
  • Go back to Johan’s step 8.
Namaste.

Deploy Windows on Macs using MDT 2010.

[Edited for Mac OSX Lion, thanks to Ted.]

Deploying Windows on Macs is a bit complicated since they don’t support standard PC features like PXE. Considering you have one-and-only one Mac OS partition (usually Macintosh HD), running the Boot Camp installer creates a fourth partition on Disk0 (Disk0\Partition3 or Disk 0\Partition4 if you’re running Lion).

MDT lets you generate boot CDs for unsupported hardware. Make sure you include BroadcomMarvell and Nvidia Ethernet drivers into your driver repository.

  1. Go into your deployment share (Deployment$\Scripts) and create a file named DiskPartMac.txt then insert the following contents into it:
    SELECT disk 0
    SELECT partition 3 or SELECT partition 4 if you’re running Lion
    FORMAT FS=NTFS LABEL=”Bootcamp” QUICK
    EXIT
  2. Create a standard Task Sequence in the Deployment Workbench, chose the OS you want to install.
  3. Under PreinstallNew Computer Only, delete “Format and Partition Disk”.
  4. Still under New Computer Only, create a command line action by clicking “Add” at the top then “General”, then “Run Command Line”. Rename it to “Custom Mac Format” and input the following command:
    diskpart /s “%scriptroot%\DiskPartMac.txt”
  5. Move it between “Validate” and “Copy scripts”.
  6. Click on “Install Operating System” under “Install” and configure the target partition as Disk 0 Partition 3 or 4 if you’re running Lion:
You’re done.
Namaste.

Prevent Outlook from prompting for a password on a network context change.

Sometimes when Outlook changes network contexts (i.e. from wired to wireless), it triggers an annoying authentication popup. There’s a way around:

  1. Open Outlook.
  2. Go to “Tools” > “Account Settings”.
  3. Double click on your account.
  4. At the bottom right, click on “More Settings…”.
  5. Click on the “Connection” tab.
  6. Under “Outlook Anywhere”, click on “Exchange Proxy Settings”.
  7. Uncheck the “On slow networks, connect using HTTP first, then connect using TCP/IP”.
Namaste.

My favorite tools…

I’ve been wanting to put a list of my favorite tools online for a long time…
System cleanup, tune-up and optimization:
Ccleaner – Piriform – Free – Cleans caches, temp files, application specific settings, cleans up the registry and much more.
Defraggler – Piriform – Free – An awesome disk defragmentation software.
Cleanup! 4.5.2 – Steven Gould – Free – Very very strong cleanup tool for Windows XP only.
Filesystem repair:
Data Recovery Wizard Pro – EaseUs – $69.95 – Best data recovery software I’ve ever used. Way more efficient than Ontrack EasyRecovery Pro. And cheaper. Saved my a** more than a couple of times.
ViVard – Copyrsoft – Free – HDD diagnostic and sector repair. Vendor independent.
Mac side:
Appcleaner – FreeMacSoft – Free – Application uninstaller for Mac OS. Like AppZapper but free.
OnyX – Titanium Software – Free – Like Ccleaner, for mac. Awesome.
Misc:
Mouse Jiggler.vbs, a small VBscript I use to prevent a computer from locking itself when I’m working on it without knowing the user’s password:

Set WshShell = WScript.CreateObject("Wscript.Shell")
Do While 1
WshShell.SendKeys"{SCROLLLOCK}"
WshShell.SendKeys"{SCROLLLOCK}"
WScript.Sleep(300000)
Loop

More to come…

Namaste.

Migrate Outlook settings sans pain.

Just a useful tip from the top of my head. If you want to migrate Outlook settings without having to reconfigure accounts, delivery options and PST locations, here is the registry key you need to export:

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles
* If you’re migrating from XP to a next-gen OS (Vista or 7), you’ll get some error messages because C:\Documents and Setting\User\Local Settings\Application Data is now C:\Users\User\AppData\Local make sure you put the PST files in the right place and simply browse to their location when asked.
Namaste.

How Adobe CS3 software can badly hose your network stack on Windows 7.

Since I try to put everything here that gives me headache, makes me pull my hair or worse, makes me want to run to the closest hardware store to buy the biggest hammer I can find, here is my latest discovery…
Case study:
A Windows XP user requests a new computer running Windows 7.
Actions taken:
Backup the old computer to a network share.
Take a new computer out of the box.
Put a standard image on it.
Have the user logging in.
Restore files.
Let the user go.
Issue:
A few days after the system deployment, the user starts complaining about connectivity issues (i.e. getting an IP but no connectivity) and general slowness of the computer.

Troubleshooting steps:

  • Hardware swap -> no improvement.
  • OS complete reinstallation -> good for a few hours then bad again.
  • Switch configuration, patch panel, network cable and outlet check -> no improvement.
  • The user ended up giving up and asking for his old computer.

Since I got the new one back, I had some more time to investigate…
Here’s what I found after running ipconfig /all:
Default Gateway . . . . . . . . . : 0.0.0.0

Very interesting, that explains why he has an IP but no connectivity. A quick Google search confirmed the issue:It’s related to Adobe CS3 software that installs Bonjour which basically breaks WinSock on Windows and the solution is to remove Bonjour using the following steps:

  • Go to http://cexx.org/lspfix.htm and download lspfix.zip.
  • Unzip to a desktop folder.
  • Open task manager and terminate mDNSResponder.exe.
  • Open a command prompt and navigate to c:program filesbonjour
  • Run “mdnsresponder -remove”. This will uninstall the exe and remove the service from the reg.
  • Rename mdnsnsp.dll to anything else.
  • Reboot.
  • Run lspfix and use it to fix the broken winsock.dll.
  • Delete c:program filesbonjour folder.
  • Open a DOS window and run “netsh winsock reset”.
  • Reboot.

Courtesy of FritoBandito from the Adobe Forums.

Namaste.