Upgrading a Domain Controller from Windows Server 2008 to 2012

Windows Server logo

When upgrading an Active Directory Domain Controller from Windows Server 2008 (or 2008 R2) to Windows Server 2012, the AD Forest must be upgraded first.  This has to be manually done, as it is not part of the setup process.

To upgrade the AD Forest, right-click on the Command Prompt icon and select “Run as Administrator”.  Insert the Windows Server 2012 DVD (or mount the ISO using a virtual drive) and switch to that drive inside Command Prompt: “cd [Drive letter]: <ENTER>“.

At the command prompt, type “[Drive letter]:supportadprep /forestprep <ENTER>“.  You will be given a warning about how this is not a reversible operation.  Type “C” and hit <ENTER> to continue.  Once this is done, type “[Drive letter]:supportadprep /domainprep <ENTER>“.

After this step is complete, you may proceed with the upgrade to Windows Server 2012.

Differences between the VB6 TreeNode and .NET System.Windows.Forms.TreeNode

Visual Basic logo

In working on the conversion of a VB6 Forms application to VB.NET (as mentioned in my last post), I have discovered many instances where Microsoft decided to keep the name (and sometimes even the associated syntax) of an element, while changing the functionality of the methods related to that element.
One such example is that of the TreeView and its TreeNodes.

In the VB6 application, the code associated with the NodeCheck event was written like this:

Private Sub tvwDataCategory_NodeCheck(ByVal Node As MSComctlLib.Node)
Dim n As Integer

If Left(Node.Key, cTagLength) = cDataTypeTag Then
Node.ForeColor = DefaultForeColor
If Node.Children <> 0 Then
n = Node.Child.Index
While n <> Node.Child.LastSibling.Index
If Node.Checked Then
tvwDataCategory.Nodes(n).Checked = True
Else
tvwDataCategory.Nodes(n).Checked = False
End If
n = tvwDataCategory.Nodes(n).Next.Index
Wend
If Node.Checked Then
tvwDataCategory.Nodes(n).Checked = True
Else
tvwDataCategory.Nodes(n).Checked = False
End If
End If

Else
Call FormatChecks
End If

End Sub

Even after running the VB6 code through the Visual Studio upgrade wizard, the resulting code did not work as it did before.  The NodeCheck event in VB6 has become the AfterCheck event in .NET, and the new code should read something like this:

Private Sub tvwDataCategory_AfterCheck(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.TreeViewEventArgs) Handles tvwDataCategory.AfterCheck
Dim Node As System.Windows.Forms.TreeNode = eventArgs.Node
Dim n As Integer

If VB.Left(Node.Name, cTagLength) = cDataTypeTag Then
Node.ForeColor = DefaultForeColor

Dim nNodes As TreeNodeCollection = eventArgs.Node.Nodes

For Each nNode As TreeNode In nNodes
If nNodes.Count = 0 Then
If nNode.Checked Then
tvwDataCategory.Nodes.Item(n).Checked = True
Else
tvwDataCategory.Nodes.Item(n).Checked = False
End If
End If
Next
Else
Call FormatChecks()
End If
End Sub

I am still working to verify that this will traverse the entire node and all child branches.  As the FirstSibling and LastSibling functions have been made obsolete, new code must be written to duplicate that functionality.  The adventure continues…

Problems with the Out of Office Indicator and Status Message on Microsoft Lync 2010

Microsoft Lync 2010 logo

This isn’t a software development problem per se, but it was a technical problem I had with Lync that does not appear to have been documented, based on my searches.
In an enterprise environment where Microsoft Lync is integrated with Exchange, Lync has an indicator that shows if your Out of Office Assistant (OoOA) in Outlook is turned on.  It appears as a little red asterisk in the lower right-hand corner of the status light.  Also, your Lync status message is automatically set to whatever your OoOA internal message is.

If you set your OoOA to be turned on and off at a scheduled time, the Lync features will be activated when the start time passes.  The problem I had was that even when the end time had passed and Outlook’s feature had been turned off automatically, Lync’s feature remained on.  Even changing the status message in Lync manually did not work; it was immediately reset to the one set up in Outlook.  Closing and reopening both Lync and Outlook had no apparent effect.

I discovered that if I manually activated the OoOA and then manually deactivated it, Lync was once again properly synched up with Exchange and the red asterisk and status message reverted to their default states.