2016年3月29日 星期二

How to give rights to one user for the restart of a service

You can use the sc command to set permissions on a specific service.
The format is a little difficult to understand, but first you will need to find the user or group's SID to use the command (something like "S-1-5-21-....").

sc myserver sdset spooler D:(A;;RPWP;;;place-sid-here)
A couple notes on that command:
  • RP Allows service start
  • WP Allows service stop

2016年3月24日 星期四

Server hang issue

known bug in the symantec driver
refer to Known problem with Symantec orphaning NTFS oplocks: https://support.symantec.com/en_US/article.TECH228086.html 

2016年3月22日 星期二

Place a Group in Maintenance Mode with Powershell

Sample Commandline: GroupatonceMM.ps1 GROUPNAME MMDURATIONINHOURS RMSSERVERNAME

Script name:  GroupatonceMM.ps1 param ($groupName, $MMDuration, $rmsServerName)
#Load the Operations Manager snapin and connect to the Root Management Server
add-pssnapin "Microsoft.EnterpriseManagement.OperationsManager.Client";
Set-Location "OperationsManagerMonitoring::";
$mgConn = New-ManagementGroupConnection -connectionString:$rmsServerName;
if($mgConn -eq $null)
{
[String]::Format("Failed to connect to RMS on ‘{0}’",$rmsServerName);
return;
}

Set-Location $rmsServerName;
$startTime = [DateTime]::Now
$endTime = $startTime.AddHours($MMDuration)
$MonitoringClassCG = get-monitoringclass | where {$_.DisplayName -eq $groupName}
$MonitoringGUID = get-monitoringobject $MonitoringClassCG.Id


New-MaintenanceWindow -startTime:$startTime -endTime:$endTime -reason:"ApplicationInstallation" -comment:"none" -monitoringObject:$MonitoringGUID

2016年3月21日 星期一

Service Management Automation License Expired

Action Plan
==========
To license SMA! With SMA, this is done via PowerShell.
Install the SMA PowerShell Module
You first need to be sure that you have the SMA PowerShell module available on your admin station so that you can run these commands. You can find this in the System Center 2012 R2 - Orchestrator media @ the following location:
SystemCenter2012R2\Orchestrator\SMA\PowershellModuleInstaller.msi
License SMA with PowerShell
Below is an example of how you would apply the System Center license to SMA
#Apply a License to SMA
$WebServiceEndpoint = 'https://staging-sma01.gwpcstaging.com'
$ProductKey = 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX'
Set-SmaLicense -ProductKey $ProductKey -WebServiceEndpoint $WebServiceEndpoint

參考資料
=========

How to capture Service Management Automation ETL Traces and Event log



1.Please collect the event log “Microsoft-ServiceManagementAutomation\Operational”.

2.You can also capture verbose logging as outlined here:
How to capture Service Management Automation ETL Traces

Service Management Automation has an ETL provider allowing the capture of verbose logging.  Follow the steps below on the SMA computer to capture ETL tracing:
  1. Open a Command Prompt using Run as administrator.
  2. Type logman start sma -p {2225E960-DE42-45EA-9940-DB3C9DC96AAF} -o SMAVerboseLog.etl -ets and press Enter.
  3. Reproduce the problem.
  4. Type logman stop sma -ets and press Enter.
  5. Type tracerpt SMAVerboseLog.etl -of xml -o SMAVerboseLog.xml and press Enter.
Review the resulting SMAVerboseLog.xml output file.
More Information
==============
In the example above, the tracerpt application is called to convert the information from the ETL log into a XML format.  Another useful format is EVTX allowing the data to be viewed using Event Viewer.  The value of using the EVTX format is that you can apply filtering such as filtering on Event IDs or filter by only showing errors and warnings etc. 
To use EVTX format, the command would look like tracerpt SMAVerboseLog.etl -of EVTX -o SMAVerboseLog.evtx.  Run tracerpt /? for additional details on options that are available.
 Trace entries each have a level associated to them.  The levels are as follows:
Event Level
Description
1
Fatal events
2
Error events
3
Warning events
4
Informational events
5
Verbose events

2016年3月15日 星期二

Windows Svr 2012,VM failed to be started due to the corruption of the VHD

HP 3PAR StoreServ Storage - HP 3PAR OS 3.1.2 can Improperly Zero Blocks Beyond the Requested Range When Using Windows Server 2012 ODX Commands
http://h20564.www2.hpe.com/hpsc/doc/public/display?docId=emr_na-c04236215

Workaround
===========
Disable ODX on the Windows 2012 or Windows 2012 R2 hosts. To disable ODX, type the following:
Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem -Name "FilterSupportedFeaturesMode" -Value 1
A server reboot is required for all servers in which the registry value is modified.

2016年3月1日 星期二

Why is 2 TB only 1.8 TB ??

Drive that is advertised as a 2000 Gbyte actually contains 2.000.000.000.000 bytes

2.000.000.000.000 / 1024 = 1953125000 kb
1.953.125.000 / 1024 = 1907348,63 Mb
1907348,63 / 1024 = 1862,64 Gb
1862,64 / 1024 = 1,818984375 Tb

2.000.000.000.000/1024/1024/10­24/1024 = 1,81T

Thats why its only 1.81TB

More Information
=============

1 Gbyte = 1024 Mbyte,
1 Mbyte = 1024 Kbyte
1 Kbyte = 1024 byte

SCOM2012- SQL management pack does not function.

Cause
======
advapi32.dll version is 6.1.7601.22137

Resolution
==========
Applied the hotfix for fixing a deadlock in Advapi32.dll wich affect SCOM:
http://support2.microsoft.com/kb/2878378/en-us