Category Archives: Windows

Windows Vista Tip – EnabledLinkedConnections

Windows Vista LogoOn Windows Vista when you map a drive under your admin account you will find that your mapped drive is not available after you switch to your full token via a RunAs or Consent dialog. This is by design because there are actually two tokens in play here. What happens is the LSA recognized that you are admin at logon and creates two logons. The first with a “filtered” token or non-admin which is used to render your desktop and the other containing your full token to be available after consent dialogs.\r\n\r\nBecause there are two separate logons there are separate logon ID’s.  When network shares are mapped they are linked to the current logon session for the current process token. Meaning you don’t have access to the network drive from the alternate logon. This can come into play with logon scripts and a number of other areas where you may require access to a network share from both tokens.\r\n\r\nIf you set the following key it will change how SMB shares are mapped. They will be mapped to a token, which means that LSA will check to see if there is a linked token associated with the user session and add the network share to that location as well. Basically all of this means that after setting this drives will be accessible from both tokens no matter which they are mapped under.\r\n\r\nHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\r\n\r\nEnableLinkedConnections = 1 (DWord)\r\n\r\nDisclaimer: This is not supported by Microsoft and was never tested. Use at your own risk.\r\n\r\nNote: All images, brand names and code used in articles are property of their respective owners. Do not use them without written approval of the respective owner. Windows/ Windows 7 is trade mark of Microsoft Corporation.\r\n\r\n \r\n\r\n \r\n\r\nCredits to: Josh Phillips, Windows Connected

How to create a new Active Directory site?

Active Directory (AD) has sites, which you can use to group servers into containers that mirror your network’s physical topology. Sites also let you configure replication between domain controllers (DCs). In addition, you can map several TCP/IP subnets to sites so that new servers can automatically join the correct site depending on their IP address and so that clients can easily find the DC closest to them.\r\n\r\nWhen you create the first DC, AD creates the default site Default-First-Site-Name and assigns the DC to this site. Subsequent DCs also add to this site, although you can later move the DCs to other sites. You can rename the default site if you want.\r\n\r\nYou use the Microsoft Management Console (MMC) Active Directory Sites and Services Manager snap-in to create and administer sites. To create a new site, perform the following steps.\r\n

    \r\n

  1. Start the MMC Active Directory Sites and Services snap-in. (From the Start menu, select Programs, Administrative Tools, Active Directory Sites and Services Manager.)
  2. \r\n

  3. Right-click the Site branch, and select New, Site from the context menu.
  4. \r\n

  5. Enter a name for the site (e.g., NewYork). The name must be 63 characters or fewer and can’t contain spaces or periods. You must also select a site link (only one site link, DEFAULTIPSITELINK, exists by default). Alternatively, enter
  6. \r\n

    IP

    \r\n

  7. Click OK.
  8. \r\n

\r\nAfter you create the site, you can assign various IP subnets to the site as follows.\r\n

    \r\n

  1. Start the MMC Active Directory Sites and Services snap-in. (From the Start menu, select Programs, Administrative Tools, Active Directory Sites and Services Manager.)
  2. \r\n

  3. Expand the Sites branch.
  4. \r\n

  5. Right-click Subnets, and select New, Subnet, as shown in image below:
  6. \r\n

    Active Directory New Subnet
    Active Directory New Subnet
    \r\n

  7. In the past, you needed to enter the subnet name in the formnetwork/bits masked (e.g., for network 200.200.201.0 with subnet mask 255.255.255.0, you’d enter 200.200.201.0/24). However, this method proved too complicated. Now, you simply enter the address and mask, as the Screen shows.
  8. \r\n

    Active Directory New Subnet Screen2
    Active Directory New Subnet Screen 2
    \r\n

  9. Then, select the site to associate the subnet with.
  10. \r\n

  11. Click OK.
  12. \r\n

\r\nAfter you have a subnet linked to a site, you can assign multiple subnets to the site.\r\n\r\nDetermining the bits masked portion of the subnet name can be confusing. This value is the number of bits set in the subnet mask, which ranges from 22 to 32. The subnet mask consists of four sets of 8 bits. You can use the following Figure to convert the subnet mask to bits.\r\n\r\n

Active Directory New Subnet Mask
Active Directory New Subnet Mask
\r\n\r\nFor example, the subnet mask 255.255.255.0 is 11111111.11111111.11111111.00000000 in binary, which uses 8 + 8 + 8 bits (i.e., 24) to define the subnet mask. The subnet mask 255.255.252.0 is 11111111.11111111.11111100.00000000 in binary, which is 8 + 8 + 6, or 22.\r\n\r\nAfter you define multiple sites, new DCs that you use DCPROMO to create will automatically join the site that matches their IP address. If no site exists for a DC’s IP subnet, the DC will join the site that authorized the DC’s promotion.\r\n\r\nCredits: John Savill, WinITPro

How to Disable Windows Automatic Update

You can disable Windows Automatic updates following methods as below:\r\n

    \r\n

  • The default setting in Windows XP is to have XP scan for updates automatically. If you follow a specific routine for your updates or if your connection doesn’t effectively support having this feature run automatically, disable it as follows:\r\n
      \r\n

    • Click on Start menu button >> [Control Panel] >> [Performance and Maintenance] >> [System] >> select [Automatic Updates]
    • \r\n

    • New window will launched, click on Turn off automatic updates. I want to update my computer manually.
    • \r\n

    • Click on OK button to apply changes.
    • \r\n

    \r\n

  • \r\n

\r\n

\r\n\r\n\r\n

Disable Windows Automatic Update
Disable Windows Automatic Update
\r\n

    \r\n

  • To Disable Automatic Update Service through Services MMC panel
  • \r\n

\r\n

Note: It’s named as Windows Updates service in Windows Vista / Windows 7/ Windows Server 2008)

\r\n\r\n

    \r\n

  • \r\n
      \r\n

    • Start menu button >> Control Panel>>  Administrative Tools >> Double click on Services OR
    • \r\n

    • Click on Start menu button >> click on Run >> type “services.msc” and click on OK button
    • \r\n

    • Windows Services Management Console window will launched, Scroll down for “Automatic Update” Service (in Windows 2000/ XP/ 2003).
    • \r\n

    \r\n

  • \r\n

\r\n

Note: It’s “Windows Update” services in Windows  (Vista/ Windows 7 / Windows Server 2008)

\r\n\r\n

    \r\n

  • \r\n
      \r\n

    • Right click on “Automatic Update” services and stop it.
    • \r\n

    \r\n

  • \r\n

\r\n

You can also do the same thing at the command line by typing:\r\n

net stop wuauserv        or

\r\n

\r\n
net stop "automatic updates"

\r\n\r\n

\r\n

    \r\n

  • \r\n
      \r\n

    • To disable double click on service and change start up type to disabled and save.
    • \r\n

    • On
    • \r\n

    \r\n

  • \r\n

\r\n

\r\n\r\n\r\n

Disable Windows Automatic Update Service
\r\n

    \r\n

  • You can Disable Windows Automatic update through Group Policy too. It’s effective for domain environment.\r\n
      \r\n

    • Click on Start >> Run >> Type “gpedit.msc” to bring up the group policy editor.
    • \r\n

    • Navigate to the folder: Local Computer Policy >> Computer Configuration >> Administrative Templates >> Windows Components >> Windows UpdateLocal Computer Policy >> Computer Configuration >> Administrative Templates >> Windows Components >> Windows Update
    • \r\n

    • Double Click on “Configure Automatic Updates” option
    • \r\n

    • New Window Will launch, select Disable “Automatic Option” and click on OK button to save.
    • \r\n

    \r\n

  • \r\n

\r\n

Note: You These setting will be effective on next reboot of your system.

\r\n

\r\n\r\n\r\n

Disable Windows Automatic Update via Group Policy
\r\n

\r\n\r\n\r\n

Disable Windows Automatic Update Via Group Policy

How To Fix ‘Microsoft.Jet.OLEDB.4.0’ error

\r\n

Problem:

\r\n

\r\n

Server Error in ‘/’ Application.

\r\n

——————————————————————–

\r\n

The ‘Microsoft.Jet.OLEDB.4.0’ provider is not registered on the local machine.

\r\n

Description: An unhandled exception occurred during the execution of the current web request.

\r\n

Please review the stack trace for more information about the error and where it originated in the code.

\r\n

Exception Details: System.InvalidOperationException: The ‘Microsoft.Jet.OLEDB.4.0’

\r\n

provider is not registered on the local machine.

\r\nSolution:\r\n\r\nYou will get this error on Windows Server 2008 R2 or Windows 7 64 bit. To fix it, switch your Application Pool from Native 64 bit to 32 Bit more under Advanced Settings.\r\n\r\nSuggestion:\r\n\r\nIt is also suggested that you upgrade your application to new ACE OLEDB provider, you can download from here.

How To Fix overrideMode=”Deny” Error (HTTP Error 500.19)

HTTP Error 500.19 - Internal Server Error\r\nThe requested page cannot be accessed because the related configuration data for the page is invalid.\r\nConfig Error\r\nThis configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".\r\n226:     <system.webServer>\r\n227:         <handlers>

\r\nIf you get the error above, you have to make a change in ApplicationHost.config file. To fix this error follow the steps as  below:\r\n

    \r\n

  • Open ApplicationHost.config file in notepad This file is located under C:\Windows\System32\inetsrv\config
  • \r\n

  • Search for <location path=”Default Web Site” overrideMode=”Deny”>
  • \r\n

  • Replace with: <location path=”Default Web Site” overrideMode=”Allow”>
  • \r\n

\r\nChange “Default Web Site”  with the name of your website.\r\n\r\nNOTE: On 64 bit Windows, if you are using 32 bit editor or File Manager, you will NOT be able to see any files in the config folder. Navigate using Windows Explorer or Notepad in native 64 bit mode.

How to Create Rewrite Rule in web.config

If you need a domain URL redirection from yourdomain.com to www.testdomain.com or vise versa, you can do something like this:\r\n\r\nPlace either of these (depending on what you’d like done. And edit to match your domain) inside the <system.webServer></system.webServer> tags in the web.config of the domain.\r\n

<rewrite><rules>\r\n<rule name=”Add WWW prefix” >\r\n<match url=”(.*)” ignoreCase=”true” />\r\n<conditions>\r\n<add input=”{HTTP_HOST}” pattern=”^testdomain\.com” />\r\n</conditions>\r\n<action type=”Redirect” url=”http://www.testdomain.com/{R:1}”\r\nredirectType=”Permanent” />\r\n</rule>

\r\n—————–\r\n

<rule name=”Remove WWW prefix” >\r\n<match url=”(.*)” ignoreCase=”true” />\r\n<conditions>\r\n<add input=”{HTTP_HOST}” pattern=”^www\.testdomain\.com” />\r\n</conditions>\r\n<action type=”Redirect” url=”http://yourdomain.com/{R:1}”\r\nredirectType=”Permanent” />\r\n</rule>\r\n</rules></rewrite>

\r\n

Note: This is applicable on websites hosted on IIS 7.0 or 7.5 (on Windows Server 2008).

Backup IIS7 ApplicationHost.config and Settings

\r\n

Internet Information Services 7 (IIS7) doesn’t use metabase-like file from IIS6. Instead the settings and configuration are stored in schema files and applicationHost.config files.\r\n\r\nSince the configuration files are different, the old IIS6 tools will not be able to backup IIS7 settings.\r\n\r\nThis is the new script that you can use to backup your IIS7 web servers.\r\n\r\n1. Using notepad or any text editor create a file backupiis7.cmd\r\n\r\n2. Insert the following code and save the file:\r\n

\r\n

Code:

\r\n

@echo off\r\ncls\r\n\r\npushd "%WinDir%\System32\inetsrv"\r\n\r\necho.| date | find /i "current">datetime1.tmp\r\necho.| time | find /i "current">datetime2.tmp\r\n\r\nfor /f "tokens=1,2,3,4,5,6" %%i in (datetime1.tmp) do (\r\n  echo %%n>datetime1.tmp\r\n)\r\nfor /f "tokens=1,2,3,4,5,6" %%i in (datetime2.tmp) do (\r\n  echo %%m>datetime2.tmp\r\n)\r\nfor /f "delims=/ tokens=1,2,3" %%i in (datetime1.tmp) do (\r\n  set TMPDATETIME=%%k%%i%%j\r\n)\r\nfor /f "delims=:. tokens=1,2,3,4" %%i in (datetime2.tmp) do (\r\n  set TMPDATETIME=D%TMPDATETIME%T%%i%%j%%k%%l\r\n)\r\n\r\nappcmd add backups %TMPDATETIME%\r\n\r\ndel datetime1.tmp\r\ndel datetime2.tmp\r\n\r\nset TMPDATETIME=\r\n\r\npopd\r\necho.

\r\n

\r\n3. The IIS7 configuration will be backed up at the following path:\r\n

\r\n

C:\Windows\System32\inetsrv\backup

\r\n

\r\nNOTE: you can also use Task Scheduler to automate backups.

\r\n