Categories
Windows Server 2003

Windows Vista Enable Administrator Account

Run the following command form a command prompt window

 net user administrator password /active:yes

This will enable the local administrator account on a Windows Vista Computer.

Categories
Domain Migration

VBSCript : Force Automatic DNS config on DHCP enabled NIC

Useful for AD / DNS migrations, this script will scan a text file containing a list of PC names and will interrogate each one to see if it is DHCP enabled on each NIC. If DHCP is enabled it will delete any manually assigned DNS servers and configure the NIC to automatically get the DNS servers via DHCP.

‘ Script to scan PCs for network cards that use DHCP and remove
‘ all manually set DNS servers for those cards only

On Error Resume Next

Const ForReading = 1

Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set objTextFile = objFSO.OpenTextFile _
    (“hosts.txt”, ForReading)

Do Until objTextFile.AtEndOfStream
    strComputer = objTextFile.Readline
    Wscript.Echo “Processing ” & strComputer
Set objWMIService = GetObject(“winmgmts:” _
  & “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”)
Set colNicConfigs = objWMIService.ExecQuery _
  (“SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True”)
 
For Each objNicConfig In colNicConfigs
    WScript.Echo VbCrLf & ”  Network Adapter ” & objNicConfig.Index & _
      VbCrLf & ”    ” & objNicConfig.Description & VbCrLf
    If objNicConfig.DHCPEnabled Then
                intSetDNSServers = _
                objNicConfig.SetDNSServerSearchOrder
    Else
        WScript.Echo “DHCP not enabled on this card”
    End If
Next
Loop

Categories
Windows Server 2003

Manual Windows Defender Update

If, like many, you have configured your Windows Firewall / any other 3rd party firewall to block all outgoing traffic you will find that Windows defender will be unable to update unless you allow port 80/443 (HTTP/HTTPS) for executable svchost.exe. However, this is a core Windows executable, and therefore you may wish to block this as it isn’t used by Windows Defender alone.

The solution therefore is to manually update your windows defender definitions using the following URLs:

 

The latest x86 / 32bit Windows Defender Updates are always available using this URL:

http://go.microsoft.com/fwlink/?linkid=70631

For x64 versions of Windows, use the following URL:

http://go.microsoft.com/fwlink/?linkid=70632

Finally, for Itanium version of Windows use the following URL:

http://go.microsoft.com/fwlink/?linkid=70633

Categories
Windows Server 2003

VBScript; List AD Group Members

The script below will list all members of a particular group within AD.

The script should be called as follows from a  command window: cscript.exe script_name.vbs > Group-Members.txt

This will ‘pipe’ the results into a text file in the same folder as the vbs file.

 

‘—————————- Begin Copy Here

Dim arrNames()

intSize = 0

Set objGroup = GetObject(“LDAP://CN=Merchandising,OU=Security Groups,OU=UK,DC=mydom,DC=com”)

For Each strUser in objGroup.Member
    Set objUser =  GetObject(“LDAP://” & strUser)
    ReDim Preserve arrNames(intSize)
    arrNames(intSize) = objUser.CN
    intSize = intSize + 1
Next

For i = (UBound(arrNames) – 1) to 0 Step -1
    For j= 0 to i
        If UCase(arrNames(j)) > UCase(arrNames(j+1)) Then
            strHolder = arrNames(j+1)
            arrNames(j+1) = arrNames(j)
            arrNames(j) = strHolder
        End If
    Next
Next

For Each strName in arrNames
    Wscript.Echo strName
Next

‘—————————- End Copy Here

Categories
Windows Server 2003

Run Command Prompt as System / Computer Account

This simple, but very useful task is handy for testing kerberos and machine account permissions. From a command prompt run the following command:

at 17:00 /interactive cmd

Where 17:00 is the time now +1 minute. Wait 1 minute and then the command prompt will pop-up.

Categories
Windows Server 2003

Ftp.exe –  Netout :Connection reset by peer :FIX

When using the Windows XP Firewall several of our users encountered the following error when using ftp.exe:

 

> Netout :Connection reset by peer Connection closed by remote host.

 

Initially we tried creating exceptions for this application, but this proved inaffective.

 

The solution was to increase the  FTP Buffer window using the follwoing command:

 

ftp.exe -w:12288

 

This increases the FTP buffer from 4MB to 12MB – the FTP process is significantly faster and does not drop out with the above error.

Categories
Windows Server 2003

MSDTC Could Not Correctly Process a DC Promotion/Demotion Event: Fix

 

Event Type:    Warning
Event Source:    MSDTC
Event Category:    MSDTC Proxy
Event ID:    53258
Date:        19/11/2008
Time:        11:35:49
User:        N/A
Computer:    ESDC02
Description:
MS DTC could not correctly process a DC Promotion/Demotion event. MS DTC will continue to function and will use the existing security settings. Error Specifics: d:\nt\com\complus\dtc\dtc\adme\uiname.cpp:9351, Pid: 1252
No Callstack,
 CmdLine: C:\WINDOWS\system32\msdtc.exe

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 05 00 07 80               …?   

 

 

Event Type:    Warning
Event Source:    MSDTC
Event Category:    SVC
Event ID:    53258
Date:        19/11/2008
Time:        11:35:49
User:        N/A
Computer:    ESDC02
Description:
MS DTC could not correctly process a DC Promotion/Demotion event. MS DTC will continue to function and will use the existing security settings. Error Specifics: %1

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

To resolve this issue modifiy the following registry key as detailed below:

HKLM\Software\Microsoft\MSDTC

Grant Advanced Permissions of Set Value and Create Subkey to the ‘NETWORK SERVICE’ account.

Categories
Windows Server 2003

Performing an Unattended Installation of Active Directory

Performing an Unattended Installation of Active Directory

 

Automating Domain Controller Deployment (read Active Directory Services and DNS) couldn’t be simlper; allowing you to install and configure AD remotely with virtually no interaction with the server at all.

First, you will need an unattend file that provides Windows Setup with the desired settings for NTDS installation. The Contents of this file should look similar to this:

 

[DCINSTALL]
CreateOrJoin=Create
ReplicaOrNewDomain=NewDomain
NewDomainDNSName=newdomain.com
DomainNetBiosName=newdomain
SetForestVersion=Yes
AutoConfigDNS=Yes
DatabasePath=%systemroot%\ntds
LogPath=%systemroot%\ntds
SYSVOLPath=%systemroot%\ntds
SafeModeAdminPassword=Password
SiteName=UK

 

Save the above into a new file named ad-auto.txt.

Use the above file to create a new forest – set using the CreateOrJoin and ReplicaOrNewDomain options.

The DC will be placed into a new AD site named UK – set using the SiteName option.

The forest root domain will be ‘newdomain.com’ with a NETBios name of newdomain – set using the NewDomainDNSName and DomainNetBiosName options.

SYSVOL and NTDS directories will be installed to their default paths (%systemroot%\) – set using the SYSVOLPath, DatabasePath and LogPath options.

The DSRM password will be set to ‘password’ – using the SafeModeAdminPassword option.

DNS will be automatically installed and configured appropriately – set using the AutoConfigDNS option.

Finally, the forest functionality level will set as Windows Server 2003 native rather than mixed mode – set using the SetForestVersion option.

 

To install Active Directory services using this unattended file simply run this command: dcpromo /answer:ad-auto.txt

Categories
Exchange Server 2003

Temporarily Increase Exchange 2000 / 2003 16gb DB Limit

Temporarily Increase Exchange 2000 / 2003 16gb Database Limit

This article covers the necessary stps to increase your Exchange 2000 / 2003 SP1 Database limit from 16GB to 17GB to allow you to perform database maintenence.

Temporarily Increase the Exchange 2000/2003 Mailbox Database Size Limit

Locate the following key in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\\Private-

Add a new REG_DWORD Value: ‘Temporary DB Size Limit Extension‘ set it to 1.This can only be used on servers running Exchange 2000 with the September 2003 Post-Service Pack 3 Roll up or Exchange Server 2003 SP1.Once the database is mounted remove unnecessary database content and then perform a defragmentation of the database in order to reclaim the database space.

In order to permanently resolve this issue on Exchange Server 2003 SP2:

First, verify that sufficient hard disk space is available for the larger database.

Always ensure you have 120% of the desired database size in free space for database maintenence.

For a mailbox store, click the following registry subkey:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSExchangeIS\Server name\Private-Mailbox Store GUID

For a public folder store, click the following registry subkey:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSExchangeIS\Server name\Public-Public Store GUID

Create a new DWORD Value; ‘Database Size Limit in Gb’ set the value as Decimal, and then an integer from 1 to 75.Note These integer values represent the maximum size of the database in gigabytes (GB). For example, a value of 75 represents a database that has a maximum size of 75 GB.

Restart the Microsoft Exchange Information Store service. To do this, follow these steps:

net stop msexchangeis

net start msexchangeis

In the Event Viewer tool, click Application event ID 1216 to verify that the database size has been set successfully.

Categories
Windows Server 2003

Complete Authoritative Restore of Active Directory

Performing a Complete Authoritative Restore of Active Directory

Restart in Directory Services Restore Mode

Simply reboot the server and press F8 during the boot procedures. Select Directory Services Restore Mode. You will require your DSRM password for this procedure. This can be reset as detailed in this guide.

Restore from backup media for authoritative restore

Click the Restore Wizard button, and then click Next.Select the appropriate backup location and ensure that at least the System disk and System State containers are selected.Click the Advanced button and ensure you are restoring junction points. If you do not go through the advanced menu, the restore process will not be successful.Select Original Location in the Restore Files to list.In the Advanced Restore Options window, check the boxes for:Restore security.Restore junction points, and restore file and folder data under junction points to the original location.Preserve existing volume mount points.For a primary restore of SYSVOL, also check the following box. A primary restore is only required if the domain controller you are restoring is the only domain controller in the domain.When restoring replicated data sets, mark the restored data as the primary data for all replicas.Click OK and continue through the restore process. A visual progress indicator is displayed.When asked to restart the computer, do not restart.

Restore system state to an alternate location

Copy the contents of the scripts directory from:

c:sysvolc_winntSysvolDomainscripts and add it to:c:WinntSYSVOLSysvoldomainscripts

Copy the contents of the policies directory from:

c:sysvolc_winntSysvolDomainpolicies And add it to:c:WinntSYSVOLSysvoldomainpolicies

Restore the database

Open a command prompt and type ntdsutil and then press ENTER.Type authoritative restore and then press ENTER.Type restore database and press ENTER.At the Authoritative Restore Confirmation dialog box, click OK.Type quit and press ENTER until you have exited Ntdsutil.exe.

Restart in normal mode

Restart the server. It is now authoritative for the domain, and changes will be replicated to the other domain controllers in the enterprise.

Verify Active Directory restore

When the computer is restarted in normal mode, Active Directory automatically detects that it has been recovered from a backup and performs an integrity check and re-indexes the database. After you are able to log on to the system, browse the directory and verify that all user and group objects that were present in the directory prior to backup are restored.