Showing posts with label Windows 7. Show all posts
Showing posts with label Windows 7. Show all posts

Sunday, January 04, 2015

Rescuing a 2TB Harddisk

My first mission on the first day of 2015 was to rescue my wife’s 2TB portable harddisk.  She was not able to access her 2TB portable harddisk using her laptop. 

To rule out that it is cable or USB port issues, we have tried using different cables and tried on a few laptops but still no luck.

Windows is able to detect the harddisk but it will freeze the whole Windows.  Meaning that, nothing will response when I tried to run them and I couldn’t even shutdown the laptop even I unplugged the harddisk.  I will need to do a hard reboot.

I tried to open the command prompt before plugging in the harddisk.  I then tried to run a chkdsk but it just freezed there forever.

I am optimistic that the data in the harddisk can be recovered and the problem might be caused by bad file system which is stopping Windows from accessing the harddisk.

Tuesday, September 11, 2012

The account is not authorized to log in from this station

A user was having problem accessing a file share at a remote site using his Windows 7 computer.  He has no problem accessing file share located in our office.  He was getting the following error.

The account is not authorized to log in from this station

The account is not authorized to log in from this station

Friday, March 09, 2012

Looking for credential tiles

I was configuring my Microsoft Outlook profile to connect to an Exchange Server and was stuck at the following Windows after clicking on the Check Name button.

Looking for credential tiles

It supposes to prompt me for my user name and password but it never appear.  It just stuck at there looking for credential tiles.

It turns out that the culprit is the Acer Bio Protection software installed on my laptop.  Uninstalling the Acer Bio Protection solved the problem.

Tuesday, February 21, 2012

SQL query exceeds specified time limit or storage limit

One user was having problems using an Microsoft Access 2003 form after changing her machine.  The person who developed the form has left the company so she has no idea how the form works.  She has to keep going back to her old machine to run the form.  Out of goodwill, I decided to help her to troubleshoot the problems.

The form provides function to pull data from an Excel file and from DB2 as well.  I opened the the form in design mode by holding down the shift key while opening the Access file.  The design mode allowed me to better understand how the form works and where/how data are being pulled.

The first problem was the linked table path for the Excel file was out-dated after the change of machine.  The problem was fixed by updating the path through the Linked Table Manager.

The second problem was due to the limited text field size (255) of Access table.  The data from the Excel file exceeded the size limit so she has to truncate the data to make them fit in.

The last problem happens when the form tries to pull data from DB2.  It throws out the following error.

ODBC – call failed.
[IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0666 – SQL query exceeds specified time limit or storage limit. (#-666)

Monday, February 20, 2012

The system has detected a possible attempt to compromise security

Someone was having problem getting her logon script running when she logon to her computer.  When I tried to run it manually in the command prompt, the following error appeared.

The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you.

Helpdesk has helped her to dis-join and re-join the Active Directory Domain but it did not help.  However, the system event log shows the cause of the problem.

MaxTokenSize

Yes, it is a token bloat problem.  The solution is to increase the maximum token size.  To do so, follow the instruction at http://technet.microsoft.com/en-us/library/dd348689%28WS.10%29.aspx.

Wednesday, February 15, 2012

Is there bug in Windows Server 2008 R2 DFS Management Console?

DFS (Distributed File System) Management Consoles on my servers running Windows Server 2008 R2 are acting weird when I try to add new replicated folders.

Here is the scenario of what happened.

I have 4 Windows Server 2008 R2 servers installed with DFS service.  Let’s call them dfsserver1, dfssever2, dfsserver3 and dfsserver4.  There are 2 AD sites and let’s call them adsite1 and adsite2.  dfsserver1 and dfssever2 are in adsite1.  dfsserver3 and dfssever3 are in adsite2.

AD Sites adsite1 adsite2
DFS Servers dfsserver1
dfsserver2
dfsserver3
dfsserver4

There are 2 replication groups and let’s call them rg1 and rg2. Members of rg1 are dfsserver1 and dfsserver3.  Members of rg2 are dfsserver2 and dfsserver4.

DFS Servers at adsite1 Replication Groups DFS Servers at adsite2
dfsserver1

<--- rg1 --->

dfsserver3
dfsserver1

<--- rg2 --->

dfsserver3

Now comes the weird behaviours.

Tuesday, February 14, 2012

How to disable and enable DEP on Windows 7 and Windows 2008

Although DEP (Data Executive Prevention) exist for a good reason but there might be time where you need to disable DEP for some good reasons as well (e.g. to perform troubleshooting).

Prior to Windows Vista, you can edit the “boot.ini” through the “Startup and Recovery” window by click on the “Edit” button to enable or disable DEP.

Windows 2003 System Startup

However, you can’t do the same thing for Vista and beyond.

Windows 2008 System Startup

Thursday, February 09, 2012

Cannot Amend Wrongly Entered User Name On Windows Authentication

I was in an urgent to RDP to a Windows 2008 server from my Windows 7 machine and misspelled the user name.  Instead of deinfotech\administrator, I entered deinfotech\administartor.  I hit the enter key and got a “Your credential did not work” message.  Here comes the frustration.

Instead of giving a chance for me to amend the user name, I have to re-enter the whole user name.

wrong user name

Maybe I am just being critical but when I am in a rush, I find this really annoying.

Wednesday, February 01, 2012

Internet Explorer Gave Blank Print Preview or Print Out

Someone using Windows 7 (32 bits) was having problem with his Internet Explorer 8 (IE8) showing him blank print preview or print out except for the header and footer.

Running the IE with add-ons disabled, logging on with another user profile, safe mode and resetting IE settings, all gave the same result.

Then I noticed that Internet Explorer Window title bar was showing “Windows Internet Explorer provided by Yahoo!”.  So I thought it might be a possible cause.  I did a search and found Remove the ISP branding for Internet Explorer and Outlook Express and managed to remove the Windows Internet Explorer provided by Yahoo!”.  However, this is far from solving the problem.  So troubleshooting continue.

Thursday, December 29, 2011

Office Communicator 2007 unable to sign in because of clock not set correctly

One user was having problem trying to sign into his Office Communicator.  He received the following error message when trying to sign in.

Cannot sign into Communicator because your computer clock is not set correctly. To check your computer clock settings, open Date and Time in Windows.

The date, time and time zone was all correctly set.  So what is the cause of it?  The culprit turned out to be the wrong setting of the W32Time synchronization type in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\Parameters registry key.

Thursday, December 01, 2011

Windows Scheduled Tasks Inventory

Here is another script which goes through each my Windows Servers and list out scheduled tasks and the credentials use to run them.  I needed to know what are the scheduled tasks running on each server and most importantly what accounts are used to run them.

image

Initially, I was looking at using the Win32_ScheduledJob WMI class.  However, it does not work well for me because it only represents a job/task created with the AT command.  Job/Task created with the Scheduled Task Wizard from the Control Panel cannot be found in this class.  Check http://msdn.microsoft.com/en-us/library/windows/desktop/aa394399(v=vs.85).aspx for more information.
So with some searching, I found this script http://msdn.microsoft.com/en-us/library/windows/desktop/aa446865%28v=vs.85%29.aspx which display task name and status.  I modified the script to get what I needed .
On Error Resume Next
Dim rootFolder
Dim taskCollection
Dim numberOfTasks
Dim taskDefinition
Dim principal
Dim registeredTask

Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objServerFile = objFSO.OpenTextFile("servers.txt", ForReading)
strFileName = "ScheduleTasks.txt"
Set objFileResult = objFSO.OpenTextFile(strFileName, 8, True, 0)
objFileResult.WriteLine "Server Name" + vbTab + "Service Account" + vbTab + "Task Name"

Do Until objServerFile.AtEndOfStream
    strServerName = objServerFile.Readline
    ' Create the TaskService object.
    Set service = CreateObject("Schedule.Service")
    call service.Connect(strServerName)
    Wscript.echo "Connecting to " & strServerName
    'Catch the error connecting to the server
    If Err.Number <> 0 Then
        Wscript.echo strServerName + vbTab + "Error Connecting" + vbTab + Err.Description
        objFileResult.WriteLine strServerName + vbTab + "Error Connecting" + vbTab + Err.Description
        Err.Clear
    Else
        ' Get the task folder that contains the tasks.
        Set rootFolder = service.GetFolder("\")
        Set taskCollection = rootFolder.GetTasks(0)
        numberOfTasks = taskCollection.Count
        If numberOfTasks = 0 Then
            Wscript.Echo "No tasks are registered."
                objFileResult.WriteLine strServerName + vbTab + "None" + vbTab + "No Task"
        Else
            WScript.Echo "Number of tasks registered: " & numberOfTasks
   
                'Loop trhough the task collection to get the task name and account used to run the task
            For Each registeredTask In taskCollection           
                Set taskDefinition = registeredTask.Definition
                 Set principal = taskDefinition.Principal
            WScript.Echo "Task Name: " & registeredTask.Name
            Wscript.Echo "User Name: " & principal.UserId
                objFileResult.WriteLine strServerName + vbTab + principal.UserId + vbTab + registeredTask.Name          
                Next
        End If   
    End If
Loop
'Clean up
objFileResult.Close
objServerFile.Close
 
The script will read from a file servers.txt to get the list of servers you want to go through.
Example of servers.txt:
servers.txt
deServer1
deServer2
 
Open a command prompt with an account that has administrative rights over the servers that you want to go through.  Run the script using cscript.exe.
C:\scripts>cscript ScheduleTasksInventory.vbs
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Connecting to deServer1
Number of tasks registered: 3
Task Name: At1
User Name:
Task Name: WebTest
User Name: deInfoTech\WebAdmin
Task Name: Note
User Name: SYSTEM
Connecting to deServer2
Number of tasks registered: 1
Task Name: movetoBackup
User Name: SYSTEM
 
The results will be written to ScheduleTasks.txt which is tab delimited.  Below is a sample of the results opened in Excel.
 
Server Name Service Account Task Name
deServer1   At1
deServer1 deInfoTech\WebAdmin WebTest
deServer1 SYSTEM Note
deServer2 SYSTEM movetoBackup
 
Using the Schedule.Service object, it does list out the task created using AT Command but the account used to run the task is missing.  Nevertheless, this does not seem to be a problem because it looks like tasks created using AT Command are running using the NT Authority\System account.  Again, this has saved me the hassle and time needed to go through each server manually.

Monday, November 21, 2011

Windows Service Accounts Inventory

You have a list of service account names and a list of server names.  You need to know which service account is used in which server.  You can logon to each server and go through the Services MMC if there are not too many servers and service accounts.  However, if you have too many servers or service accounts to check, the following vbscript might be of a little help.

You can download a copy of this vbscript from http://www.mediafire.com/?jfh5w4774w6ayru.

On Error Resume Next

Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")

'Open the servers.txt containing the server names for reading
Set objServersFile = objFSO.OpenTextFile("servers.txt", ForReading)

'The results will be written to SvcAcctServers.txt
strFileName = "SvcAcctServers.txt"
Set objResultFile = objFSO.OpenTextFile(strFileName, 8, True, 0)
objResultFile.WriteLine "Server Name" + vbTab + "Service Account" + vbTab + "Service Name"

'Loop through all the server names in the servers.txt file
Do Until objServersFile.AtEndOfStream
    strServerName = objServersFile.Readline

   
    Wscript.Echo "Connecting to " + strServerName
   
    'For each server, connect to the \root\cimv2 WMI namespace
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strServerName & "\root\cimv2")

    'Catch the error connecting to the WMI namespace
    If Err.Number <> 0 Then
        objResultFile.WriteLine strServerName + vbTab + "Error Connecting" + vbTab + "Error"
        Err.Clear
    Else
        'Open the services.txt file containing all the service accounts for reading
        Set objServiceAcctsFile = objFSO.OpenTextFile("services.txt", ForReading)
        Wscript.Echo "Checking " + strServerName + "..."

        'Loop through the services.txt file
        Do Until objServiceAcctsFile.AtEndOfStream
            strServiceName = objServiceAcctsFile.Readline
           
            'Get all the Windows services on the server by quering the win32_Service class
            Set colServices = objWMIService.ExecQuery _
                ("Select * from win32_Service")

            'Loop through all the Windows services
            For each objService in colServices
                'If the service account name of the Windows Service matched the service account name in the services.txt
                If InStr(1,objService.StartName, strServiceName , 1) > 0 Then
                        objResultFile.WriteLine strServerName + vbTab + strServiceName + vbTab + objService.Name
                End If
            Next       
        Loop
    End If
    'Clean up
    objServiceAcctsFile.Close
Loop
'Clean up
objResultFile.Close
objServersFile.Close

You need to two input files to run this script.  The first file is servers.txt which contains the name of all your servers.  The second file is services.txt which contains the name of all the service accounts.

Example of servers.txt and services.txt:

servers.txt services.txt
deServer1
deServer2
deServer3
deServer4
deServer5
deServer6
deServer7
deServer8
ArcSvc
AppsSvc
BackupSvc
MSSQLSvc
SOClusterSvc
SOMSSQLSvc
SFClusterSvc
SFMSSQLSvc

From the command prompt, run the vbscript using cscript.exe.  Make sure that the command prompt is open using an account that has administrative access to the server because the script impersonate the account to connect to the server.

C:\scripts\Services>cscript ServiceAcctsInventory.vbs
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Connecting to deServer1
Checking deServer1...
Connecting to deServer2
Checking deServer2...
Connecting to deServer3
Checking deServer3...
Connecting to deServer4
Checking deServer4...
Connecting to deServer5
Connecting to deServer6
Checking deServer6...
Connecting to deServer7
Checking deServer7...
Connecting to deServer8
Checking deServer8...

C:\scripts\Services>

The results will be written to SvcAcctServers.txt which is tab delimited.  Below is a sample of the results opened in Excel.

Server Name Service Account Service Name
deServer1 ArcSvc AMS
deServer1 ArcSvc MMS
deServer1 ArcSvc StorageNode
deServer3 MSSQLSvc MSSQLSERVER
deServer3 MSSQLSvc SQLSERVERAGENT
deServer3 SFClusterSvc ClusSvc
deServer3 SFMSSQLSvc MSSQLSERVER
deServer3 SFMSSQLSvc SQLSERVERAGENT
deServer5 Error Connecting Error
deServer7 BackupSvc BackupExecAgentBrowser
deServer7 BackupSvc BackupExecDeviceMediaService
deServer7 BackupSvc BackupExecJobEngine
deServer7 BackupSvc BackupExecManagementService
deServer7 BackupSvc BackupExecRPCService

deserver2, deserver4, deserver6 and deserver8 do not use any of the service accounts to run its Windows Services so they do not appear in the results.  There is an error connecting to deServer5 and it is most likely caused by permission issues, WMI service not working or non Windows systems.

Friday, July 01, 2011

Accessing File Share is Very Slow with Windows 7 SP1

A user complained that accessing a file share on a particular server running Windows Server 2003 is extremely slow.  It was so slow that Windows Explorer just hanged!  Accessing other file shares on other servers running Windows Server 2003 and 2008 is working fine.

After some troubleshooting, the problem was resolved by disabling Windows Auto Tuning.

First try this and reboot.

C:\>netsh int tcp set global autotuninglevel=disabled
Ok.

If it still does not solve the problem, try this and reboot.

C:\>netsh int tcp set heuristics disabled
Ok.

Do remember to the command in elevated mode (Run as Administrator).  Otherwise you will receive the following error.

Set heuristics command failed on WSH The requested operation requires elevation
(Run as administrator).

We are not seeing this problem with Windows 7 without SP1.

Wednesday, January 12, 2011

Windows 7 Cannot Access Microsoft Distributed File System (DFS) Share

I have been testing domain based DFS (Windows 2000 Server mode) for the past few days and was hit with an issue which took me 2 days to solve it.  Although the servers are Windows Server 2008 but our domain and forest functional level are still at 2003.

After setting up the DFS share, I was all ready to access the share using my Windows 7 computer.  I typed in the path \\mydomain.com\test\share and received an error message that bothered me for the next 2 days.

image

Now if I used the server name instead of the domain name, it works fine.  Then I tried accessing the \\mydomain.com\test\share share using Windows XP with SP3  and it works.  Tried on Windows Server 2003 and it also works. 

So I thought it is Windows 7 problem so I asked another colleague also using Windows 7 to try it but it works for him!  Then I logged on my Windows 7 and it works as well.  So the problem is not exactly Windows 7.  I started to google, hoping to find someone in the same situation as me.  In fact, I did find a few but none of the solution works for me.  Here are the possible solution I found on my journey to nail down this issue.

A hotfix from Microsoft “You cannot access a DFS share through a mapped network drive on a computer that is running Windows 7 or Windows Server 2008 R2”.

Disable IPv6.  Was already disabled on my computer and the servers.

Turing off UAC “After you turn on User Account Control in Windows Vista, programs may be unable to access some network locations”.  Already turned off.

Lower down the authentication level on Windows 7 http://social.technet.microsoft.com/Forums/en/w7itprogeneral/thread/63b92708-b86d-4526-b8d9-c3c02cfde408.  Our XP and Windows 2003 machines are at the same authentication level as Windows 7.

Flush the cache using the dfsutil.exe (dfsutil /pktflush).

I tried all the suggestion but none solves my issue.  I was pulling my hair on this ( no wonder I am losing so much hair these days).  Now, did I say it does work on my Windows 7 computer using another account but not my account.  But using my account on Windows XP and Windows 2003 is also working.  Hmmm…., could it be Windows 7 plus my account that caused the issue?

Well, it turned out to be the case.  When I looked at the System event log on my Windows 7, I am seeing the following warning.

Log Name:      System
Source:        Microsoft-Windows-Security-Kerberos
Date:          1/11/2011 1:10:58 PM
Event ID:      6
Task Category: None
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      MYWin7.mydomain.com
Description:
The kerberos SSPI package generated an output token of size 13907 bytes, which was too large to fit in the token buffer of size 12000 bytes, provided by process id 952.
 
The output SSPI token being too large is probably the result of the user
justme@mydomain.com being a member of a large number of groups.
 
It is recommended to minimize the number of groups a user belongs to. If the problem can not be corrected by reduction of the group memberships of this user, please contact your system administrator to increase the maximum token size, which in term is configured machine-wide via the following registry value: HKLM\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters\MaxTokenSize.

This link http://technet.microsoft.com/en-us/library/dd348689(WS.10).aspx describes the event and the solution.

One of the workaround stated is to increase the token size all the KDC servers.  However, I did try increasing it on my Windows 7 computer and after that I can access the share.  But it throws another warning in the System event log.

Log Name:      System
Source:        Microsoft-Windows-Security-Kerberos
Date:          1/11/2011 1:16:11 PM
Event ID:      15
Task Category: None
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      MYWin7.mydomain.com
Description:
The kerberos SSPI package generated an output token of size 13906 bytes, which was too large to fit in the token buffer of size 12000 bytes, provided by process id 4.
 
The application needs to be fixed to supply a token buffer of size at least 65535 bytes.

Although it works but the warning makes me feel very uncomfortable.  So I removed the token size modification and reduced the number of group membership for my account.  After doing so, it works like a charm.  No warning of oversized token and accessing to the share is working.

The cause to this issue – Windows 7 plus an account with oversized token! Steaming mad

Sunday, January 09, 2011

Windows XP Mode

If you are having hard time trying to install an application on your Windows 7 machine because the application will only work on Windows XP, then Windows XP mode might come in handy.  Windows XP mode allows you to run your legacy applications which only work on Windows XP in a copy of virtual Windows XP.  Wait a minute, did I say running application in a virtual machine?  Doesn’t we have that all the time?  Okay, the difference is you can run the application which is installed and running in the virtual Windows XP seamlessly in your Windows 7.  Let’s take a look at how it works.

First, we need to download the necessary files to setup Windows XP mode.  You can download those files from http://www.microsoft.com/Windows/virtual-pc/download.aspx.

When Windows XP mode was first released, you need a computer with “Hardware Assisted Virtualization Technology” (HAVT) to get it work.  However, Microsoft removed the restriction in March 2010.  If your computer supports HAVT, then you don’t need Step 4.  My computer doesn’t support HAVT so I need to have all the 3 files.

image

Start by installing the Windows Virtual PC (Windows6.1-KB958559-x86.msu).

image

Click the Close button after the installation has completed.

image

If your computer does not support HAVT, then you need to install Windows6.1-KB977206-x86.msu otherwise you can skip this step.

image

Once the installation of Windows6.1-KB977206-x86.msu has completed, click on the Restart Now button to restart your computer.

image

After you have restarted your computer, you are ready to install Windows XP Mode (WindowsXPMode_en-us.exe) which is a copy of virtual Windows XP.

image

image

image

image

Once the Windows XP Mode setup has completed, you are ready to setup Windows XP Mode (hmm, I thought the setup has completed!).

image

I don’t like the default folder that store the virtual machine files so I changed it to C:\VPC\.  Provide a password for the XPMUser account.

image

image

image image

image

image

image

Okay, we have successfully installed Windows XP Mode.  Now, let’s check out how we can run an application in the virtual Windows XP seamlessly on Windows 7.  I have created a video to demo running the IE6 of the virtual Windows XP on Windows 7.

Using Windows XP Mode to run IE6 on Windows 7

If you install an application in the virtual Windows XP, you do not need to manually create the shortcut as shown in the video.

Hope you enjoy the video Smile

Thursday, December 30, 2010

Error Installing .Net Framework 1.1 on Windows 7

I know the latest version of .Net Framework is 4.0 and I shouldn’t use the older version but I don’t have a choice since the software requires .Net Framework 1.1. The bad news is Microsoft said that .Net Framework 1.1 is not supported on Windows 7 and Windows Server 2008 R2. Here is the verdict.

http://blogs.msdn.com/b/servicing/archive/2010/06/21/supportability-of-net-framework-1-1-on-windows-7-and-windows-server-2008-r2.aspx

When I tried to install .Net Framework 1.1 on my Windows 7 machine, I received error “Application has generated an exception that could not be handled.” True enough, it could not be handled because clicking OK or CANCEL did nothing good.

The good news is there is workaround for this. You need Service Pack 1 for .Net Framework 1.1 to make the installation. Since Microsoft did not provide a slipstream version of .Net Framework 1.1 with Service Pack 1, you will need to do it manually.

Download both the Microsoft .NET Framework 1.1 Redistributable (dotnetfix.exe) and Microsoft .NET Framework 1.1 Service Pack 1 (NDP1.1sp1-KB867460-X86.exe) to a folder (e.g. dotNet11wSP1).

Open a Command Prompt as an Administrator and change directory to that folder (e.g. dotNet11wSP1).

Enter the command dotnetfx.exe /c:"msiexec.exe /a netfx.msi TARGETDIR=C:\dotNet11wSP1" and hit Enter. You will be asked whether you like to install .Net Framework 1.1. Click Yes to continue.

image

Once completed, you will receive the following message. Click OK to close it.

image

You will see 2 additional (Program Files and Win) folders created inside the folder. Do not delete them because they contain files needed for installation later.

Next, enter the command NDP1.1sp1-KB867460-X86.exe /Xp:C:\dotNet11wSP1\netfxsp.msp and hit Enter. You should see a file netfxsp.msp when it has completed.

Enter the command msiexec.exe /a c:\dotNet11wSP1\netfx.msi /p c:\dotNet11wSP1\netfxsp.msp and hit Enter. You will see the following dialog box. When the dialog box disappears, it has completed.

image

Finally, run netfx.msi in the folder to start the .Net Framework 1.1 installation. You shouldn’t see the error message that cannot be handled Smile

Wednesday, December 15, 2010

Burning Disc Image Using Windows 7 Disc Image Burner

Insert a blank DVD or CD disc.
Select the disc image file that you want to burn.
Right click on the disc image file (e.g. ISO file) and select Open with –> Windows Disc Image Burner.

image

Make sure the correct drive is selected for the Disc burner. Click on the Burn button to start the burning.

image