Thursday, February 02, 2017

SCCM UEFI OS deployment error 0x80004005

I tried to push Windows 10 through UEFI on SCCM 2016 and got error like this

<![LOG[!sBootDevicePath.empty(), HRESULT=80004005 (e:\qfe\nts\sms\framework\tscore\bootvolume.cpp,34)]LOG]!>
<![LOG[System partition not set]LOG]!>
<![LOG[Unable to find the partition that contains the OS boot loaders. Please ensure the hard disks have been properly partitioned
Unspecified error (Error: 80004005; Source: Windows)]LOG]!>
<![LOG[BootVolume::GetCurrent(pBootVolume), HRESULT=80004005 (e:\qfe\nts\sms\framework\tscore\bootimage.cpp,542)]LOG]!>

The problem was, on "Partition Disk 0 - UEFI" step, I forgot to check "Make this the book disk"

Tuesday, December 13, 2016

How to create a clustered task to repeate

It is not possible to create a task with single trigger with repeat. In stead, you can created multiple triggers. It is not recommended to add it manually using the gui, when the cluster fail over the manually changed/added triggers will be vanished. Always use powershell to insure multiple triggers stay with the task.

In this example I created a resource specific task (R: is clustered disk 2), this task runs on a node where the R: is active.

$action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-executionpolicy bypass -file test.ps1" -WorkingDirectory "R:\scripts"
$triggers = @()
$triggers += New-ScheduledTaskTrigger -Daily -At 04:00
$triggers += New-ScheduledTaskTrigger -Daily -At 08:00
$triggers += New-ScheduledTaskTrigger -Daily -At 15:00
$triggers += New-ScheduledTaskTrigger -Daily -At 22:00
Register-ClusteredScheduledTask –Cluster fileClusterServer –TaskName testTask –TaskType ResourceSpecific –Resource "cluster disk 2" –Action $action –Trigger $triggers



The script below is a bit messy but it creates a clustered task that runs on every hour


$action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-executionpolicy bypass -file test.ps1" -WorkingDirectory "R:\scripts"
$triggers = @()
for ($i=0; $i -le 23; $i++)
{

[string] $j = $i
if ($i -le 9)
{
 
$j = "0"+ $j

}
$taksTriggerTime = $j

$taskTime = $j + ":00"

$triggers += New-ScheduledTaskTrigger -Daily -At $taskTime

}
  
Register-ClusteredScheduledTask –Cluster fileClusterServer –TaskName testTask –TaskType ResourceSpecific –Resource "cluster disk 2" –Action $action –Trigger $triggers  


Note: the resource specific task will run under the system (node), if fail over happens the active node's system account will run the task, folder security will change automagically so you don't have to add all nodes to folder's security tab.
It is not possible to make the task run under some sort of a service account at this point. It runs under only system account.

Friday, October 28, 2016

How to change SCCM reserve disk space for a DP

1) Run SQL query:

select SCR.ID, SCR.Name,SC.NalPath, SCR.Value3 from sc_sysresuse_property SCR join sc_sysresuse SC on SCR.SysResUseID = SC.ID where SCR.name = 'MinFreeSpace' and SC.NALPath like '%%' and SC.RoleTypeID = 3

get SCR_ID

2) Use the returned ID in step 1). Run the below query to update the 'MinFreeSpace' value.
update sc_sysresuse_property set value3 = 'set desired value in MB' where name = 'MinFreeSpace' and ID = ''
Example:
update sc_sysresuse_property set value3 =10240  where name = 'MinFreeSpace' and ID = xxxxxxxxxxxxx

3) Change registry value HKLM\software\Microsoft\SMS\DPreserveddiskspace to match the  number you used on step 2, eg: 10240. 

You don't have to reboot the DP.


Restart the SMS_SITE_Component_Manager service on SCCM site server.

Monday, October 17, 2016

SCOM 2012 r2 console crash after windows patch

After I installed Oct 2016 windows patches
I got this error whenever I tried to open "windows Computers" under "Monitoring"

Application log:
Faulting application name: Microsoft.EnterpriseManagement.Monitoring.Console.exe, version: 7.1.10226.1177, time stamp: 0x5697e092
Faulting module name: ntdll.dll, version: 6.1.7601.23543, time stamp: 0x57d2fde1
Exception code: 0xc000041d
Fault offset: 0x000000000004ef57
Faulting process id: 0x18a0
Faulting application start time: 0x01d228f4261a1d54
Faulting application path: C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\Console\Microsoft.EnterpriseManagement.Monitoring.Console.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: 7a5e2e0a-94e7-11e6-ab30-0050569b0035


SCOM console logs:

Problem signature:
  Problem Event Name: APPCRASH
  Application Name: Microsoft.EnterpriseManagement.Monitoring.Console.exe
  Application Version: 7.1.10226.1177
  Application Timestamp: 5697e092
  Fault Module Name: ntdll.dll
  Fault Module Version: 6.1.7601.23543
  Fault Module Timestamp: 57d2fde1
  Exception Code: c0000005
  Exception Offset: 000000000004eef1
  OS Version: 6.1.7601.2.1.0.272.7
  Locale ID: 1033
  Additional Information 1: 383a
  Additional Information 2: 383a5f09f3fd70a29b8be053663a1d2a
  Additional Information 3: 0ebe
  Additional Information 4: 0ebe29effad583805ef4413487a5a75f

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt


It seems "October 2016 security monthly quality rollup" is causing the issue
KB3192392 for Windows 8.1 and Server 2012 R2
KB3185332 for Windows server 2012
KB3185330 for Windows server 2008 R2

Remove the KB and restart the SCOM server and it will be fixed.

Saturday, October 15, 2016

Clustered task in Windows server 2012 R2 with 0x1 error

I tried to create a clustered task and got 0x1 error, according to M$ it means

0x1: An incorrect function was called or an unknown function was called. (ref: https://support.microsoft.com/en-us/kb/308558)
extra: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383604(v=vs.85).aspx

This is the original script that generated 0x1 error

$action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "runme.ps1" -WorkingDirectory "E:\Shares\scripts"

E: is a clustered disk and I got 0x1 error when I execute the task manually.

Later I found that it has to do with execution policy, so I have changed it to

$action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-executionpolicy bypass -file runme.ps1" -WorkingDirectory "E:\Shares\scripts"

and it ran without error.


Here is the complete script to create the task
$action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-executionpolicy bypass -file runme.ps1" -WorkingDirectory "E:\Shares\scripts"
$trigger = New-ScheduledTaskTrigger -Daily -At 3pm
Register-ClusteredScheduledTask –Cluster filesharecluster –TaskName MyResourceSpecificTask –TaskType ResourceSpecific –Resource "cluster disk 2" –Action $action –Trigger $trigger


and this is what the runme.ps1 looks like, as you can see you can run dos command and powershell

dir c:\ | export-csv "e:\shares\scripts\result.csv"

somehow trying to to run bat file also generated 0x1 error, some suggested that the account that runs the task needs to be in "logon as a batch" job in local security policy but I have not tried it yet.

Friday, July 15, 2016

New-RDSessionDeployment : Validation failed for the "RD Connection Broker" parameter

I had this error when I tried to deploy a RDS 2012 R2



PS C:\Users\admin> New-RDSessionDeployment -ConnectionBroker xxx.test.local -SessionHost xxx.test.local
New-RDSessionDeployment : Validation failed for the "RD Connection Broker" parameter.
xxx.test.local      Unable to connect to the server by using Windows PowerShell remoting. Verify that you can
connect to the server.
At line:1 char:1
+ New-RDSessionDeployment -ConnectionBroker xxx.test.local -SessionHost xxx.te ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-RDSessionDeployment


I googled and googled and found no cure...until I tried this...disable IPv6



 
and tried it again, and it worked. Close the current PowerShell and open a new one after you disabled the IPv6.
 
 
 
 








Tuesday, February 11, 2014

Search query grayed out on in-place hold settings

If you are a domain admin and exchange admin and tried to setup in-place hold setting, you might find the "search query" option is grayed out! You might think "oh no maybe it is the search engine!"
No it is not, you must be a member of "discovery management" group, add your account to be a member of the group, log out form the ECP and log back-in, try to create the in-place hold.

Ok now you done playing with in-place hold and try to delete the in-place hold, and it errors out, and says

Can't remove mailbox search  because there is still at least one mailbox on In-Place Hold.

remove-mailboxsearch will give you the same error, well it has to be disabled first!

Here is a fix:

Set-MailboxSearch   -SourceMailboxes  -InPlaceHoldEnabled $false

If the in-place hold name is "test1" and the last mailbox that are in the in-place hold is "testuser"

Set-MailboxSearch "test1" -SourceMailboxes "testuser" -InPlaceHoldEnabled $false

now remove the in-place hold.


Exchange 2013 disk partition alignment

Visit this page for Exchange 2013 Storage Configuration Options
http://technet.microsoft.com/en-us/library/ee832792(v=exchg.150).aspx


For exchange 2010:
http://exchcluster.blogspot.com/2010/12/disk-partition-alignment-best-practices.html