Tuesday, December 20, 2016

SCCM Client Installation Error Codes

2 – The system cannot find the file specified.

5 – Access denied.
52 – You were not connected because a duplicate name exists on the network. Make sure there is not a duplicate name in DNS and that 2 machines don’t have the same IP in DNS.
53 – Unable to locate – http://support.microsoft.com/kb/920852 – cannot connect to admin$ – Computer Browser not started – add File/print sharing to Exceptions in Firewall – turn file and print on.
58 – The specified server cannot perform The requested operation
64 – The specified network name is no longer available. Source: Windows
67 – network name cannot be found. 
86 – network password is not correct? Machine Name <> resolved name.
112 – Not enough disk space
1003 – Cannot complete this function.
1053 – The service did not respond to the start or control request in a timely fashion.
1068 – The dependency service or group failed to start
1130 – Not enough server storage is available to process this command. Source: Windows
1203 – The network path was either typed incorrectly, does not exist, or the network provider is not currently available. Please try retyping the path or contact your network administrator.
1208 – An extended error has occurred. Source: Windows
1396 – Logon Failure: The target account name is incorrect. (NBTSTAT -a reverse lookup, duplicate IP address)
1450 – Insufficient system resources exist to complete the requested service. Source: Windows
2147749889 – Generic WMI failure (Broken WMI)
2147749890 – not found – Source: Windows Management (WMI) – try repair WMI
2147749904 – Invalid class – Source: Windows Management (WMI)
2147749908 – Initialization failure – Source: Windows Management (WMI)
2147942405 – Access is Denied (Firewall rule? / MacAfee-HIPS?)
2147944122 – The RPC server is unavailable. (Dcom is miss-configured for security . http://support.microsoft.com/kb/899965 )
2148007941 – Server Execution Failed

Clean up old IIS logs PowerShell script

$LogPath = "C:\inetpub\logs" 
$maxDaystoKeep = -30 
$outputPath = "c:\CleanupTask\Cleanup_Old_logs.log" 
  
$itemsToDelete = dir $LogPath -Recurse -File *.log | Where LastWriteTime -lt 
((get-date).AddDays($maxDaystoKeep)) 
  
if ($itemsToDelete.Count -gt 0){ 
    ForEach ($item in $itemsToDelete){ 
        "$($item.BaseName) is older than $((get-date).AddDays($maxDaystoKeep)) 
and will be deleted" | Add-Content $outputPath 
        Get-item $item | Remove-Item -Verbose 
    } 
} 
ELSE{ 
    "No items to be deleted today $($(Get-Date).DateTime)"  | Add-Content $outputPath 
    } 
   
Write-Output "Cleanup of log files older than $((get-date).AddDays($maxDaystoKeep)) 
completed..." 
start-sleep -Seconds 10

SCCM Software Update Troubleshooting - Client Logs

We all know SCCM can be your best friend, and your worst nightmare. Today I had to compile a list of client logs to check for a friend of mine, and thought I’d share. These should get you 95% of the way on your troubleshooting (from the client side anyways). Remember to always use CMTrace as your SCCM log viewer, it just makes your life easier.
All of these listed directly below, should be located in C:\Windows\CCM\logs on your client.
  • UpdatesDeployment.log 
    • Provides information about the deployment on the client, including software update activation, evaluation, and enforcement. Verbose logging shows additional information about the interaction with the client user interface.
  • UpdatesHandler.log
    • Provides information about software update compliance scanning and about the download and installation of software updates on the client.
  • ScanAgent.log
    • Provides information about the scan requests for software updates, what tool is requested for the scan, the WSUS location, and so on.
  • WUAHandler.log
    • Provides information about when the Windows Update Agent on the client searches for software updates.
  • UpdatesStore.log
    • Provides information about the compliance status for the software updates that were assessed during the compliance scan cycle.
You can also reference C:\Windows\WindowsUpdate.log which is a windows native log and not to SCCM, but is updated with actions taken by SCCM in regards to updates.

SCCM 2012 troubleshooting Full version

1. Client may not send/receive any policies and will not run any advertisements.
Finding the Issue: There are few log files which you should look into,
CCMSETUP.LOG – This log file will have the details about the client installation
ClientLocation.Log – It helps to find out if the client is assigned to the SCCM site or not.
LocationServices.Log – It records if the client is communicating with the Distribution point or management point to receive policies.
Open Configuration Manager Properties, switch to Actions tab and check if you are able to see at least 5 policy agents displaying which means the client is healthy.
2.  Client fails to send inventory data to configuration manager site or fails to send status messages to the server
Cause: This issue may occur if the WMI of the client computer is corrupt or not working.
Solution: Check all the services which are required for the communication with the server, .eg:
• Computer browser
• Windows installer
• SMS agent host
• BITS
• WMI
All the above mentioned services should be automatic mode and started.Then try repairing the WMI. To repair WMI follow the steps below,
Step 1:
%windir%\system32\wbem\winmgmt /clearadap
%windir%\system32\wbem\winmgmt /kill
%windir%\system32\wbem\winmgmt /unregserver
%windir%\system32\wbem\winmgmt /reserver
%windir%\system32\wbem\winmgmt /resyncperf

SCCM 1610 Upgrade Guide

The third upgrade for SCCM Current Branch is now available. This post is a complete step-by-step SCCM 1610 upgrade guide. If you’re looking for a complete SCCM installation guide, see our blog series which covers it all. You can’t install this upgrade if you are running SCCM 2012. You need to be at least at SCCM 1511.
Installing SCCM upgrades is very important to your infrastructure. It adds new feature and fixes lots of issues, which some of them are important.

New Update and Servicing Model

If you’re not familiar with the new SCCM servicing model, read our New Update and Servicing section of the 1602 upgrade post which explain it all.
Similar to SCCM 1606, if you need to make a new SCCM installation, you can’t install SCCM 1610 directly. You need to install SCCM 1511 (or 1606) first and then apply SCCM 1610 from the console. SCCM 1606 is the baseline version if you’re starting from scratch.
*If you are running SCCM 1511, 1602 or 1606, the latest updates will be replaced by SCCM 1610 in the SCCM Console after installation. If you are on SCCM 1511, you won’t be able to install 1602 or 1606 after 1610. You can skip all previous versions and install SCCM 1610 directly which contains all 1602 and 1606 fixes and features.

SCCM 2012 Client Cache Managing

By default Configuration Manager 2012 client stores deployed packages in %windir%ccmcache folder and default disk space for cache folder is 5120 MB.
All deployed packages and also software updates will be keep in these default folder unless you specify custom location with installation options.
Regarding TechNet article please note that:
  • Do not encrypt cache folder. Configuration Manager cannot download content to an encrypted folder.
  • For the required programs, client does not automatically retry to download the content. You must redeploy the package.
  • For the required applications, client automatically retries to download the content when it next downloads its client policy.
One of the main concern about client cache is auto-empty mechanism. There are several scripts around the web that deletes client cache but be aware that client will not be notified so will try to use cached content if installation is not succeed yet.
If you configure the package properties with the option to persist content in the client cache, client does not automatically delete package content from cache.
Likewise you can specify following properties to configure caching options on clients:
  • DISABLECACHEOPT – If set TRUE, disables the ability of end users to change the client cache folder settings using Configuration Manager in Control Panel.
  • SMSCACHEDIR – Specifies the location of the client cache folder.
  • SMSCACHESIZE – Specifies the size of client cache folder in megabyte.
Please note that if you use SMSCACHESIZE option and the package would cause the folder to exceed the maximum size, package download fails.

Sunday, May 8, 2016

PowerShell script SCCM 2012 Agent Install - remotely

$CM12MP='MP.contoso.com'
$CMSiteCode='SR1'
$ErrorActionPreference = "SilentlyContinue"
try
{
#Get ccm cache path for later cleanup...

Restart Computers Remotely via PowerShell

To restart a remote computer, you need to run the command with credentials that have the right privileges to remotely shut down a computer, typically an admin account. Assuming my current credentials were adequate, I could easily reboot the computer SERVER01:
PS C:\> Restart-Computer Server01 -whatif
What if: Performing operation "Restart-Computer" on Target " (Server01)".
although I didn't really; I took advantage of the -WhatIf parameter to verify my command. This is especially helpful if I'm rebooting a bunch of servers:
PS C:\> restart-computer "server01","server02","server03" -whatif
By the way, here's how you could shut down a list of computers:
PS C:\> restart-computer (get-content c:\work\computers.txt)
Because the cmdlet is using WMI objects and methods under the hood you can specify alternate credentials, either a saved credential object or a user name:
PS C:\> restart-computer (get-content c:\work\computers.txt) -credential "mycompany\administrator"
I'll get prompted for the password, but then this credential will be used for every computer in the list.
The Restart-Computer cmdlet will fail, if a logon session is detected. PowerShell will raise an exception. However, you can force a reboot using -- what else? -- the -force parameter. Be aware this will force applications to close with the potential loss of unsaved work.
Another option for rebooting or even logging off is to use the Win32_OperatingSystem WMI Class and the Win32ShutDown method. I recommend using Invoke-WMIMethod because it supports -WhatIf and -Confirm. I found it just as easy to pipe a WMI object from Get-WMIObject to Invoke-WMIMethod:
PS C:\> Get-WmiObject win32_operatingsystem -ComputerName Quark | Invoke-WMIMethod -name Win32Shutdown
The Win32Shutdown method can accept parameters. The default is 0 which means do a simple logoff. But if the user has open files or if the default method fails, you can always resort to a forceful logoff:
PS C:\> Get-WmiObject win32_operatingsystem -ComputerName Quark | Invoke-WMIMethod -name Win32Shutdown -ArgumentList @(4)

Friday, May 6, 2016

SCCM 2012 error codes & description (full list)


131072512 131072512 0x07D00200 The client is successfully assigned with Group Policy Site Assignment
131073314 131073314 0x07D00522 No more data
131073589 131073589 0x07D00635 Scan was skipped because history was valid
-2016278002 2278689294 0x87D20A0E Shutdown received while compressing
-2016278003 2278689293 0x87D20A0D Unexpected error while compressing
-2016278004 2278689292 0x87D20A0C Already compressed
-2016278005 2278689291 0x87D20A0B Failed to create file header while compressing
-2016278006 2278689290 0x87D20A0A Failed to create file while compressing
-2016278007 2278689289 0x87D20A09 Failed to create folder while compressing
-2016278008 2278689288 0x87D20A08 Invalid compressed header in file
-2016278009 2278689287 0x87D20A07 Invalid compressed file
-2016278010 2278689286 0x87D20A06 Failed to compress header
-2016278011 2278689285 0x87D20A05 File is no more there to compress
-2016278012 2278689284 0x87D20A04 Invalid destination for compression
-2016278013 2278689283 0x87D20A03 Invalid source for compression
-2016278014 2278689282 0x87D20A02 Compression destination not found
-2016278015 2278689281 0x87D20A01 Compression source not found
-2016278267 2278689029 0x87D20905 SEDO lock request timed out
-2016278268 2278689028 0x87D20904 SEDO lock not found

Microsoft System Center Operations Manager 2012 Setup and Config