Monday, 11 May 2015

Documenting Task Sequences Automagically


Load PowerShell from the Configuration Manager Console
1. Start by launching the Configuration Manager console. In the upper left corner, there’s a blue rectangle. Click the white arrow in the blue rectangle, and choose “Connect via Windows PowerShell”.

Run This Command
(Get-CMTaskSequence | Where-Object {$_.Name -eq “<Name of the Task Sequence>”}).Sequence | Out-File J:YourFileName1.xml

Follow these Steps 
1. Copy this file to the same folder as your YourFileName1.xml.

3. Open your task sequence in your favourite text editor.

4. After the first line which should look something like this:

<?xml version="1.0"?> or <?xml version="1.0" encoding="utf-8"?>

enter the following as the second line:

<?xml-stylesheet type="text/xsl" href="tsDocumentorv2.xsl" mce_href="tsDocumentorv2.xsl"?>

5. Save your file and open it in Internet Explorer.


The XSL takes care of formatting, indents and sizing.

Wednesday, 6 May 2015

The software change returned error code 0x87D00324 (-2016410844)

The software change returned error code 0x87D00324 (-2016410844)


And the application will be marked as failed in software center.
You may get this error msg for various reasons. Basically the error msg is indicating that the installation is not successful.
Surprisingly if we check AppEnforce.log, it shows looking for exit code:0 which means the installation is successful.


So the application is installed successfully, however the software center showing the deployment as Failed with error code 0x87D00324 (-2016410844).

Now it is time to look at the specified detection rule. If we are using MSI GUID as a product detection rule, make sure that we have correct GUID in the detection clause.
Unfortunately the detection GUID clause is different than the actual installed product GUID. Hence the evaluation of product is failing so the configuration manager flagging the install as failed.


Once I corrected the GUID in detection rule updated the content. Run the machine Policy and Evaluation cycle. As soon as the machine received the new policy, the software center msg changed from Failed to Installed.


Thanks: http://blogs.technet.com/b/cmpfekevin/archive/2013/11/21/import-computer-does-not-show-up-in-collection.aspx

Wednesday, 15 April 2015

Task Sequence Failed with the Error Code 0x80070002

Troubleshooting
Task Sequence Failed with the Error Code 0x80070002 – we see this error usually during the operating system deployment using SCCM 2012 R2. When you deploy the task sequence to a collection and when you boot the computer from the network, during the step “Applying Operating System” you encounter the Error Code 0x80070002. In this situation what one might think would be to check SMTS.log file. I would recommend that but there is something else that you need to check first. Error code 0x80070002 in SCCM 2012 can be interpreted as a network error wherein during the OSD the necessary files are not accessible by the computer where the operating system is being deployed.
In Configuration manager 2012 we do not have an out of the box report which shows the system serial number.


Resolution
To fix the issue Error Code 0x80070002, we have to define the network access account. The Network Access account is used only for accessing the content and not for running the task sequence. This account should have the minimum appropriate permissions on operating system deployment content it needs to access. This account is important because the computer receiving the operating system does not have a security context it can use to access content on the network.

To configure the Network Access Account, open the CM2012 R2 console, click on Administration, expand Overview, expand Site Configuration, click Sites, on the top ribbon click Configure Site Components, click Software Distribution.

Or

The resolution was to change the deployment properties on the Task Sequence from "Access content directly from a distribution Point" to "Download content locally".

Or


I believe that changing the operating system package properties under Data Access to "Copy the content in this package to a package share on distribution Points" would have been the other solution to this problem.

Sunday, 12 April 2015

SCCM 2012 Reporting – Creating Custom reports using SQL Query


In Configuration manager 2012 we do not have an out of the box report which shows the system serial number.


This step by step guide will show you how to setup your custom report using existing SQL Query.
Open SCCM console and open the Monitoring > Overview > Reporting> Right click the “Reports” node and click onCreate Report.

Open SCCM console and open the Monitoring > Overview > Reporting> Right click the “Reports” node and click onCreate Report.


Click on SQL- Based Report


Click to Browse the category to save the report in 


Click OK and then Click Next till you reach  summary page and then close after the report is created.
When you finish the report the SQL Server Report Builder should now open.


We’ll start this report by creating a “Table or Matrix” so click on that icon. 
We now need to enter in a dataset for the report to use so leave the “Create a dataset” selected and click Next. 
You’ll now be prompted by a “Choose a connection to data source” page. 
Click next whilst the highlight is on the server that hosts your reporting point.

If you already see data source connection, just hit Test Connection to verify it If not, then click Browse Enter in the credentials that have access to the SCCM database and click Next.


You’ll now hit the “Design a query”  Click on Edit as Text in the top left corner.


Paste your query and hit red color Exclamation Mark just next to import

Select sys.Name0 Machine, CS.UserName0 'User Name',OS.Caption0 OS, OS.CSDVersion0 'Service Pack',CS.Manufacturer0 Manufacturer,CS.Model0 Model,BIOS.SerialNumber0 'Serial Number',RAM.Capacity0 Memory, cs.SystemType0
From v_R_System SYS
  left join v_GS_COMPUTER_SYSTEM CS on sys.Name0=cs.Name0
  left join v_GS_PC_BIOS BIOS on sys.ResourceID=bios.ResourceID
  left join v_GS_OPERATING_SYSTEM OS on sys.ResourceID=OS.ResourceID
  left join v_GS_PHYSICAL_MEMORY RAM on sys.ResourceID=ram.ResourceID
  --Where sys.Name0 = @variable
  order by sys.Name0


On the next screen, you’ll get the ability to lay out how you want your report to look. I’ve selected all the fields from available and drag it over ∑ values box


Click next on Choose the layout page


Click Next and then Finish. You should be back at the report builder screen. You can start modifying the report to look exactly how you’d like


You can always go back to the design by clicking Design if you need to make modifications or add extra information to this report like below.
On the design page if you want to put header click above the report and insert the Text Box and type the report name as you like


If you want to bring the total number of machines on this page, insert new Text box just next to the report header. Right click inside the box click Expression


Paste this query
=Count(Fields!Machine.Value, "DataSet1")
After you adjusting all the fields the way you want and when all this is done, click on Run to view the report



Click on Save icon, you should be able to see the reports under “Site – General” you should now see your new report. This should  appear in the console as well as the web reports.



Thanks this Blog for the solution: http://blogs.technet.com/b/infratalks/archive/2013/09/10/sccm-2012-reporting-get-system-serial-number-amp-create-custom-ssrs-report.aspx

Import Computer Does Not Show Up in Collection


I was recently working with another PFE with a customer that has some pretty strict requirements around OSD collections.
The customer has tiered collections that separate workstations and servers. The 3rd tier of collections (where OSD deployments  are targeted) are each limited to the appropriate All Servers or All Workstation Collection.




When the customer uses "Import Computer Object" feature to stage new devices for OSD.  The 3rd tier collection for OSD Deployment is selected.
The problem is that the object never appears in the collection.
Looking at the OSD Deployment collection membership, the object's Direct membership was added, but because of collection limiting, the object does not exist in the parent collection and thus will never appear as a member of the OSD Build collection.


So how do we solve this problem?  With more collections! We create what I have call the Funnel!


1.     Create a new collection "All Manual Machine Entry Devices"  limited to All Systems.
a.      Create a query rule those shows objects with the manual entry DDR, but only those without a heartbeat.

select
 SMS_R_SYSTEM.ResourceID
 ,SMS_R_SYSTEM.ResourceType
 ,SMS_R_SYSTEM.Name
 ,SMS_R_SYSTEM.SMSUniqueIdentifier
 ,SMS_R_SYSTEM.ResourceDomainORWorkgroup
 ,SMS_R_SYSTEM.Client
from SMS_R_System
where
SMS_R_System.AgentName = "Manual Machine Entry" and SMS_R_System.ResourceId not in (select
           SMS_R_System.ResourceId
           from  SMS_R_System
           where SMS_R_System.AgentName = "Heartbeat Discovery")



2.     Create an include rule on both the All Workstation and All Server Tier 2 collections for the All OSD collection. 


This allows the imported devices to be able to flow down through the limited collections to the 3rd tier collection.  Once the system sends its first heartbeat, it will be removed from the All OSD collection and then flow down into tier 2/3 as appropriate


Thanks: http://blogs.technet.com/b/cmpfekevin/archive/2013/11/21/import-computer-does-not-show-up-in-collection.aspx

SCCM 2012 - Software Center Unable to Download Software 0x87D00607

Whilst performing some application deployment testing to some computers on a new subnet, I came across an error in the Software Center stating that it was Unable to download the software and returned the following useful error:



"The software change returned error code 0x87D00607 (-2016410105)"


   

  
Looking further into the issue I found that this new subnet was not configured within the SCCM boundaries and hence not in a boundary group.

If the network your client is in, does not exist as a boundary and within a boundary group SCCM will not offer any software deployments to that client because it is outside it's scope of management you have defined.



Boundaries are automatically created (if you told SCCM to) from Active Directory sites and the subnets within those sites when you run your discovery methods.



In my case a subnet and AD site did not exist to be automatically created. If it did then I would still need to add it to a boundary group.





1. To resolve this an IP address range needs to be created within:



Adminstration --> Hierarchy Configuration --> Boundaries

 


  
2. Then add that newly created IP address range boundary to your boundary group.


 

  

3. Try installing you software again via the Software Center and it will now succeed.


Thanks: https://www.vmadmin.co.uk/microsoft/64-mssystemcenter/350-sccm2012errorboundary87d00607

Thursday, 5 March 2015

Task Sequence OS Deployment Windows 7– SCCM 2012





SCCM2012R2 OSD Error Download () failed 80072ee2
Resolution:
Create these  Tasksequence Variables right at the top of your Tasksequence:
SMSTSDownloadRetryCount with Value 5
SMSTSDownloadRetryDelay with Value 15
SMSTSMPListRequestTimeout with Value 300






 Restart Windows PE


 Partition Disk


Use MDT 2013 Toolkit



Apply Operating System




















Apply Computer Name


Apply Windows Settings


Apply Drivers 



 Set Operating System

 Apply Client

 Rename Admin Account

Add Local Accounts

Use below Batch to call VB Script to Create Account 

' //***************************************************************************
net user /ADD <USERNAME> <PASSWORD>  /passwordchg:no /comment:"Added through TS"/y
net localgroup Administrators <USERNAME>/add
cscript.exe "%~dp0adminaccount.vbs"
' //***************************************************************************

VB Script
' //***************************************************************************
strComputer = "."
strUser = "<USER>"
Set User = Getobject("WinNT://" & strComputer & "/" & strUser)
Flags = User.Get("UserFlags")
User.put "Userflags", flags OR &H10000
user.setinfo
Set User = nothing
' //***************************************************************************




Method to import Reg


Way to Add Reg

Way to Run Command


Way to Run Attrib Command

Way to Create Folder

 Way to iCACLS


Way to Copy Files

VB Script to copy files
' //***************************************************************************
' // ***** Script Header *****
' //
' // Solution:  File copy relative to script location
' // File:      CopyFiles.vbs
' // Author: Michael Petersen, Coretech A/S. info@coretech.dk
' // Purpose:   Copy x number of files and folsders in a source folder to a target location 
' // Usage: Place script i source folder, and define what to copy using arguments. (FIRST ARGUMENT MUST BE TARGET FOLDER)
' //
' // To copy one or more file(s) and Folder(s)located in the source folder sypplpy TARGET and FILE/FOLDER name(s) (remember extensions on files)
' // - Cscript.exe CopyFiles.vbs "TARGETFOLDER" "FILE1.XXX" "FOLDER1" "FILE2.XXX" "FOLDER2"
' //
' // To copy all files and folders located in the source folder only supply TARGET 
' // - Cscript.exe CopyFiles.vbs "TARGETFOLDER"
' //
' //
' // CORETECH A/S History:
' // 1.0.0     MIP 17/01/2011  Created initial version.
' // Customer History:
' //
' // ***** End Header *****
' //***************************************************************************

Set oFSO = CreateObject("Scripting.FileSystemObject")

Const OverwriteExisting = True

'Get script location
sScriptLocation = Replace(WScript.ScriptFullName,WScript.ScriptName,"")
sSource = Mid(sScriptLocation,1,Len(sScriptLocation)-1)
WScript.Echo "Source is: " & sSource

'Copy files and folders, or entire source
sArgNumber = WScript.Arguments.Count

If sArgNumber <> 0 Then
sTargetFolder = WScript.Arguments.Item(0)
WScript.Echo "Targetfolder is: " & sTargetFolder
'Make sure the taget is not a file
If Not (Left(Right(sTargetFolder,4),1)) = "." then 
'If only TARGET exists ad argument, everything will be copied
If WScript.Arguments.Count = 1 Then 'If only 
oFSO.CopyFolder sSource, sTargetFolder, OverwriteExisting
oFSO.DeleteFile(sTargetFolder & "\" & WScript.ScriptName)
WScript.Echo "All files copied to Targetfolder " &  sTargetFolder
Else  
'If files and folder arguments exist only these will be copied 
For i = 1 To sArgNumber -1
sFileName =  WScript.Arguments.Item(i)
If oFSO.FileExists(sFileName) Then 
WScript.Echo "File: " & SFileName & " Copied to: " & sTargetFolder
oFSO.CopyFile sSource & "\" & sFileName, sTargetFolder & "\" & sFileName, OverwriteExisting
ElseIf oFSO.FolderExists(sFileName) Then
WScript.Echo "folder: " & sFileName & " Copied to: " & sTargetFolder
oFSO.CopyFolder sSource & "\" & sFileName, sTargetFolder& "\" & sFileName, OverwriteExisting
ElseIf (Left(Right(sFileName,5),1)) = "*" Then
WScript.Echo "All : " & SFileName & " files Copied to: " & sTargetFolder
oFSO.CopyFile sSource & "\" & sFileName, sTargetFolder & "\", OverwriteExisting 
Else
WScript.Echo "ERROR - " & sFileName & ": does not exist in the source folder!"
End If  
Next
End If
Else
WScript.Echo "ERROR - " & sTargetFolder & " Is not a valid FolderName. First Argument must be the tagret folder!"
Wscript.Quit(1)
End If
Else 
WScript.Echo "ERROR - No Arguments present!"
Wscript.Quit(1)
End If
' //***************************************************************************