Tuesday, March 19, 2013

The user profile service failed the logon user profile cannot be loaded


The user profile service failed the logon user profile cannot be loaded



Remedy:

1, Copy C:\users\default folder (Hidden) on the server which has no problem to somewhere (i.e. desktop) and rename it to default2.
2, Copy default2 folder to C:\users\ on the server which has a problem.
3, go to registry (regedit) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\Default and change the pass to %SystemDrive%\User\Default2.
4, Reboot the server.

For windows 2008, reboot is not required.

Tuesday, March 12, 2013

Issue: Two node windows 2003 cluster and the cluster service on the node is failing to start. One of the node is already evicted and the cluster service is failing on the second node.



Issue: Two node windows 2003 cluster and the cluster service on the node is failing to start. One of the node is already evicted and the cluster service is failing on the second node.

 Sample Troubleshooting

  • ·         We started off by starting the cluster service with the /FQ switch and it started without any errors and we were able to bring all the resources to online state.
  • ·         As navigated through the resources, we identified that the disk resources are coming from the VERITAS volume manager.
  • ·         Asked to engage Symantec on to the call as the disk resources was having issues while trying to come online.
  • ·         The snippet of the cluster log which indicated the failure of the disk resource which is coming from “Volume Manager Disk Group”

#########################################
000004b4.0000174c::2012/06/19-15:38:13.729 ERR  Volume Manager Disk Group : LDM_RESOnlineThread: CheckQuorumPath() failed! dwStatus = 1008.
000004b4.0000174c::2012/06/19-15:38:13.729 INFO Volume Manager Disk Group : LDM_RESOnlineThread: RESOURCE IS PUT ONLINE SUCCESSFULLY
000006c0.000007b4::2012/06/19-15:38:13.901 INFO [FM] FmpCleanupGroupsPhase1: Group is not quiet, wait
000004b4.0000174c::2012/06/19-15:38:14.119 ERR  [RM] Exception. Code = 0xc0000005, Address = 0x0000000077EE4AD2
000004b4.0000174c::2012/06/19-15:38:14.119 ERR  [RM] Exception parameters: 0, 46, 0, 11c
000004b4.0000174c::2012/06/19-15:38:14.119 INFO [RM] GenerateMemoryDump: Start memory dump to file C:\WINDOWS\Cluster\resrcmon.dmp
#########################################
  • ·     Symantec  article http://www.symantec.com/business/support/index?page=content&id=TECH126532 which helped in resolving the issue.
  • ·         After installing the hotfix and rebooting the cluster node, the cluster service was able to come online without any issue.
  • ·         Reconfigured the cluster to make use of the new Disk group that Ian created and pointed cluster to make use of it.
  • ·         Moved the cluster core resources to the new group that was created.
  • ·         Added the second node to the cluster and tested a couple of failover which were successful.
  • ·         Application team tested a couple of failovers and they were successful.


Unable to start the cluster service


Check the following

•    Symptom - Unable to start the cluster service on 2nd node.

•    Possible Cause - NoLMHash Policy was enabled and the password was less that 15  characters.

•    Resolution - Suggested either to disable the policy or change the password to more than 15 characters which resolved the issue

More information http://support.microsoft.com/kb/299656


Check MSDTC error is there or not, if yes rebuild MSDTC
  
RESOLUTION: 

%windir%\system32\msdtc.exe -uninstall
msdtc –remove
msdtc –resetlog
Renamed C:\Windows\dtcinstall.log to dtcinstall.log.old

Removed the Enable COM+ and Enable DTC from Add removed Windows components. Deleted the MSDTC keys and restarted the server.

Thursday, February 28, 2013

Send you the HTML file in email body through PowerShell

 This script will not send as a attachment, it will send you the HTML file in email body.


PowerShell
# Send email as a HTML body. 
$smtpServer = "SMTP Server Name" 
$MailFrom = "DL or Name of the person from where you need to send email" 
$mailto = "DL or Name of the person where you need to send email" 
$msg = new-object Net.Mail.MailMessage  
$smtp = new-object Net.Mail.SmtpClient($smtpServer)  
$msg.From = $MailFrom 
$msg.IsBodyHTML = $true 
$msg.To.Add($Mailto)  
$msg.Subject = "Report-Test." 
$MailTextT =  Get-Content  -Path C:\temp\Reports\Report.html 
$msg.Body = $MailTextT 
$smtp.Send($msg

VMware Power CLI Useful Scripts.


VMware Power CLI Useful Scripts

1. Collect OS information for all the Guest in a V Center.

Get-VM | Select Name,PowerState, @{N="GuestOS";E={($_ | Get-VMGuest).OSFullName}} | Export-Csv -NoTypeInformation -Path "Report.csv"

2. Collect Basic IP Address information for all the Guest in a V Center.

get-vm | select Name,@{N="IP Address";E={@($_.guest.IPAddress[0])}} | out-file ip.txt

3. Find Server Name, Host and CPU information for the Guest OS.

Get-VM | Select-Object Name, VMHost, NumCpu

4. Collect Inventory


@========OS INFO of VM===============================================

foreach ($vmView in (Get-View -ViewType VirtualMachine))
{
    $report += $vmView | Select-Object @{Name="VMHost"; Expression={(Get-View $vmView.Runtime.Host).Name}},
                                       @{Name="VMName"; Expression={$_.Name}},
                                       @{Name="GuestVersion"; Expression={$vmView.Guest.GuestFullName}}
}
$report | Sort-Object VMName -Descending | Export-Csv "vm_GuestVersion.csv" -NoTypeInformation


========================================================================

5. List all ESX host MAC addresses.


get-vmhost | get-vmhostnetworkadapter | export-csv d:\temp\VMHost.csv

6. List all guest VM MAC addresses

get-vm | get-networkadapter | export-csv d:\temp\VMAdapter.csv 

7. Collect Snapshot information's.

Get-VM | Get-Snapshot | Select-Object -Property Name, Description, Created, SizeGB | Format-List *

8. Script Signing.


Get-executionpolicy

Set-ExecutionPolicy AllSigned
Set-executionpolicy unrestricted
Set-executionpolicy remotesigned

9. Connect V-Center using power CLI

Connect-VIServer -User -Password

10. Disconnect V-Center

Disconnect-VIServer -Server  

11Get the VM data with Snapshot, Datastore, Total Disk Size, Cluster Name, OS Name


# To Get the VM data with Snapshot, Datastore, Total Disk Size, Cluster Name, OS Name 
Set-ExecutionPolicy Remotesigned -force 
if (-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) { 
Add-PSSnapin VMware.VimAutomation.Core} 
$VC1 = read-host "Type the VC name" 
$date = Get-Date -DisplayHint DateTime -Format "yyyy-M-d" 
Connect-VIServer -Server $VC1 -WarningAction SilentlyContinue 
Get-VM | Select Name,PowerState, @{N="SnapName";E={ 
($_ | Get-Snapshot).Name}},@{N="Datastore";E={ 
($_ | Get-Datastore).Name}},@{ N="TotalDisk"; E={  
($_ | Get-harddisk | measure-object -property CapacityKB -sum).Sum}},@{N="GuestOS";E={ 
($_ | Get-VMGuest).OSFullName}},@{N="Cluster";E={ 
($_ | Get-Cluster).Name}}| Export-Csv -NoTypeInformation -Path \\xyz\Reports\Report-$VC1-$Date.csv 
Disconnect-VIServer -server $VC1 -Force -Confirm:$false



Monday, December 24, 2012

Capture a complete Windows Memory Dump


Mentioned steps are to configure the machine for a complete memory dump using a keyboard.

1)    Right click Computers and Select Properties.
2)    Select the Advanced system settings.
3)    Click the "Startup and Recovery" – settings button.
4)    Under the "Write Debugging Information" section select: "Complete

        Memory Dump" from the pull-down menu.

5)    If the Complete memory dump option is not available , then we need to
       change a registry setting.
6)    Open the regedit and navigate to :

        HKLM\CurrentControlSet\Control\CrashControl

        Change the value CrashDumpEnabled to 1

7)   Again open Startup and Recovery tab and you will get the option of

       Complete memory Dump.

8)   Uncheck the option of Automatically Restart.
9)  Make sure a check mark is placed on: "Overwrite any existing file"
10)  Make sure that there is a paging file (pagefile.sys) on the System Drive and it should be atleast 1 GB more than the RAM.
         Right click Computer->Properties. Then select Advanced System Settings.

         In the Advanced tab, select Performance and then settings.

         Select Advanced, click Change under Virtual memory.

         Then select Custom size and then set both the initial and final size to the same value.

11)  Also make sure there is more space on the hard drive than the physical RAM to collect the memory dump.
12)  By default the memory dump is saved on the System Root. If we do not have space on the System root , we can change the location to another drives.

After these settings are checked we need to configure the machine for a keyboard initiated memory dump. Depending on the keyboard used the registry changes are different.

For USB keyboard the settings are:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kbdhid\Parameters
On the Edit menu, click Add Value, and then add the following registry value:
Value Name: CrashOnCtrlScroll
Data Type: REG_DWORD
Value: 1
Quit Registry Editor.

For PS2 keyboard:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters
On the Edit menu, click Add Value, and then add the following registry value:
Value Name: CrashOnCtrlScroll
Data Type: REG_DWORD
Value: 1
Quit Registry Editor.


After these settings you can reboot the server and then it is configured for a complete memory dump. The keyboard should be directly attached to the server. When the server is in the hung state, we need to hold the right Ctrl key and press Scroll lock key twice. This will bugcheck the machine with the error code Stop E2 and the dump file would be generated.

Refer to the following article:


Friday, December 21, 2012

Error Message " 0x8004100E" When You Run a Windows Management Instrumentation Script


Error Message " 0x8004100E" When You Run a Windows Management Instrumentation Script

c:\wbemtest 

To check WMI connectivity.

Cause:WMI corruption

Resolution:
             C:\Windows\system32>winmgmt /verifyrepository
             WMI repository is INCONSISTENT

             C:\Windows\system32>winmgmt /salvagerepository
             WMI repository salvage failed
             Error code: 0x8007041B
             Facility: Win32
             Description: A stop control has been sent to a service that other running ser vices are dependent on.

             C:\Windows\system32>winmgmt /resetrepository
             WMI repository reset failed
             Error code: 0x8007041B
             Facility: Win32
             Description: A stop control has been sent to a service that other running services are dependent on. 

IT WORKED.

WMI issue was fixed in the server  after applying following steps.

1.            Change startup type to Window Management Instrumentation (WMI) Service to disabled       
2.            Stop the WMI Service, you may need to stop IP Helper Service first before it allow you to stop WMI Service as it is a  dependency
3.            Rename the repository folder:  C:\WINDOWS\system32\wbem\Repository
4.            Open a CMD Prompt with elevated privileges
5.            Cd windows\system32\wbem
6.            for /f %s in ('dir /b /s *.dll') do regsvr32 /s %s
7.              Set the WMI Service type back to Automatic and restart WMI Service
8.            cd /d c:\  ((go to the root of the c drive, this is important))
9.            for /f %s in ('dir /s /b *.mof *.mfl') do mofcomp %s
10.          Reboot the server

The solution was provided by Microsoft PS.