Wednesday, December 14, 2011

Move Windows 2008 Bootmgr to Another Partition

Ran into this problem when the bootmgr was installed on a 100MB partition. Windows assigned the partition (this was the first partition on the disk) the drive letter D:. I needed to move the bootmgr to the C: drive and get rid of this partition. Below are the very rough steps (recorded here for my own purpose).

  1. Copy the boot files (bootmgr, BOOT folder, BCD will error out, that's OK, we'll address that later) from the current active partition to the partition you want to be active
  2. Reboot to the machine to the install disk
  3. When the computer boots into the install, choose to "repair windows"
  4. Click next then choose command prompt
  5. run bcdedit /export c:\BCD
  6. ren c:\boot\bcd bcd.old
  7. Bootrec /rebuildbcd
  8. Run Diskpart (select the disk then the partition that you want to be active) and mark the new partition as active using the ACTIVE command
Reboot and that's it. 

Wednesday, December 7, 2011

Powershell + DNSCMD to find all CNAME (Alias) records from DNS

Sometimes a DBA or developer requests what aliases are pointing to a given machine. To quickly facilitate this request for them, I came up with the script below. I thought there would be a way to accomplish this task with NSLOOKUP or DNSCMD, but I couldn't get it working. If you now of a way to get this working with only one of those tools, please post it in the comments.

function Get-DNSAlias
{
Param([string] $computername=$env:computername)
if ($_) {$computername=$_}

echo "Aliases for $computername"
$aliases = dnscmd computername /enumrecords domain.com . /type CNAME
foreach($alias in $aliases){$alias | % {$_.split(" ")[0]} | where {$alias.Contains($computername)}
}
<#
.SYNOPSIS
Gathers DNS CNAME records for the given host
.EXAMPLE
Get-DNSAlias computername
.DESCRIPTION
This command gathers and reports all of the CNAME records for the given computer in the hardcoded domain list
#>
}#end Get-DNSAlias

Thursday, July 7, 2011

Windows UNC: No network provider accepted the given network path

I have seen many posts around the Internet for this, including WINS and scanning system files. Ultimately, if this is only a problem for a single user, it is most likely the TCP/IP NetBIOS Helper service being disabled or not running. Start the service, set it to Automatic, and tell the user to leave the services alone.

Duplicate MAC Addresses in SCVMM and Hyper-V

There is a possiblity that duplicate MAC addresses can occur in Hyper-V (specifically when configuring networks using Hyper-V). As an example, if the machine is created with SCVMM and then the network is configured using Hyper-V, there could be a duplicate MAC. If the VM was created with Hyper-V and later migrated to a SCVMM host, this duplication could still happen. If the VM has been registered with SCVMM (regardless of how the network was configured), the script below will output a CSV of the VM name and the MAC(s). Using Excel to quickly find duplicates is an easy way to avoid network headaches. If a duplicate is found, the simple fix is to add a new network card through SCVMM which will ensure that the MAC is not duplicated.

add-pssnapin Microsoft.SystemCenter.VirtualMachineManager
Get-VMMServer | get-vm | Get-VirtualNetworkAdapter | select name,EthernetAddress | export-csv "c:\temp\VM_Macs.csv"

Wednesday, June 1, 2011

SCVMM Powershell Script to Find Startup Actions

Powershell command/script to find the startup actions for all VMs and output them to a CSV.

$Hosts = @(Get-vmmserver SCVMMSERVER | get-vm | Select Name, StartAction) | Export-Csv C:\VM_Startup_Actions.csv

Thursday, May 26, 2011

How Windows Server Picks the Source IP Address

When Windows Server (in my testing, 2008) has multiple IP addresses configured on a single adapter, Windows will choose the IP address closest to the gateway as the source address. We ran into this problem when using NAT through a firewall for a web service call.

Friday, December 10, 2010

How to Dry Out Wet Cellphone (Electronic Device)

As an "IT guy", I get a lot of questions regarding ANYTHING with power. Sometimes, when people have their phones (or other devices) near liquid (or in the bathroom) they accidentally get the device wet. Not a little wet, rather soaked or submerged. Even I have experienced such a tragedy.

To "dry" the device out, put it in a ziploc baggie with dry rice. The rice will absorb the moisture from the device.

I have done this, and it worked. Mine was a remote control, but it worked.

If you have any experience with this, or know any other ways to accomplish this please post a comment.

Tuesday, December 7, 2010

How-to Setup AAA Authentication for Cisco Switches using Microsoft IAS (RADIUS)

This can certainly be overcomplicated by many posts on the web. This can be configured very, very granularly, but below is the simplest configuration that I have been able to come up with.
  1. Install IAS on the Windows Server
  2. Right-click Remote Access Policies (in the IAS MMC) and choose "New Remote Access Policy"
  3. Select "Setup a custom policy"
  4. For the policy name, we'll call it Cisco Switches
  5. Click Next
  6. Click Add
  7. Select Windows-Groups
  8. Click Add
  9. Click Add and select the groups for this policy
  10. Click OK
  11. Click OK
  12. Click Next
  13. Select "Grant remote access permission"
  14. Click Edit Profile
  15. Click the Authentication Tab
  16. Leave the defaults and select the following: Unencrypted authentication, Allow clients to connect without negotiating an authentication method
  17. Click the Advanced tab
  18. Change "Service-Type" to Login
  19. Remove Frame-Protocol
  20. Click Add
  21. Select "Vendor-Specific"
  22. Click Add
  23. Select Cisco from the list
  24. Select "Yes. It conforms"
  25. Click Configure Attribute
  26. Change "Vendor-assigned attribute number" from 0 to 1
  27. Enter "shell:priv-lvl=15" (without the quotes) in the Attribute Value field
  28. Click OK
  29. Click OK
  30. Click OK
  31. Click Close
  32. Click OK
  33. Respond "No" to a message about a Help topic
  34. Click Next
  35. Click Finish
  36. In the IAS MMC, right-click RADIUS Clients and select New RADIUS Client
  37. Enter the friendly name and the IP address
  38. Click Next
  39. Enter a preshared key to be used in the switch configuration
  40. Click Finish
On the Cisco Switch (IOS) enter the following (changed to fit you situation):

Couple of assumptions:
  • RADIUS-GROUP-NAME is an arbitrary name that you choose
  • PRESHARED-KEY is the key used above when adding the RADIUS client to IAS
  • 10.1.1.10 and 10.1.1.11 are servers in your environment running IAS

aaa authentication login default local group RADIUS-GROUP-NAME
aaa authorization exec default local group RADIUS-GROUP-NAME
!
radius-server host 10.1.1.10 auth-port 1645 acct-port 1646 key PRESHARED-KEY
radius-server host 10.1.1.11 auth-port 1645 acct-port 1646 key PRESHARED-KEY
!
aaa group server radius RADIUS-GROUP-NAME
 server 10.1.1.10 auth-port 1645 acct-port 1646
 server 10.1.1.11 auth-port 1645 acct-port 1646

Friday, October 1, 2010

Blackberry Enterprise Server - Low Disk Space Cleanup

The BES keeps log files in the \Program Files\Research In Motion\BlackBerry Enterprise Server\Logs directory. From time to time, this directory may need to be cleaned up to free disk space. I will be writing a quick script to copy these off every week or so, but for now all folders EXCEPT the following can be moved off the disk:

  • webserver
  • Installer
  • Current week's folder