Monday, July 14, 2014

Windows Updates On Server Core Machine!!!!!

Hi Guys ,
One day i got a request to install the patches on Server Core machine... and i was shocked to see that request because i have never done this in past, So i started searching in Google and was very scared because most of the post were scripts. As i was working in production environment there was "BIG NO" to execute any script in environment as it was not tested , so after digging further i came across below 5 Methods that executed in environment based on your choice. I selected "OPTION 3" that was SConfig.
Method #1 - Manually Install Updates
In order to install updates you need to configure the Server Core machine to automatically download and install updates:
At a command prompt:
  • To verify the current setting, type:
cscript scregedit.wsf /AU /v
  • To enable automatic updates, type:
cscript scregedit.wsf /AU 4
  • To disable automatic updates, type:
cscript scregedit.wsf /AU 1
Problem with this setting is that you have no control over what updates are being downloaded and installed. Therefore, if you do not wish to enable auto updates, you can manually download each update from the Windows Update site, transfer them to the Core machine, and then manually installing them using msiexec.exe or wusa.exe:
Msiexec (command-line options)
Description of the Windows Update Stand-alone Installer (Wusa.exe) and of .msu files in Windows Vista and in Windows Server 2008



Method #2 - Install from Script
You can also use the following script sample from MSDN:
Searching, Downloading, and Installing Updates: http://msdn.microsoft.com/en-us/library/aa387102(VS.85).aspx
Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()
WScript.Echo "Searching for updates..." & vbCRLF
Set searchResult = _
updateSearcher.Search("IsInstalled=0 and Type='Software'")
WScript.Echo "List of applicable items on the machine:"
For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
WScript.Echo I + 1 & "> " & update.Title
Next
If searchResult.Updates.Count = 0 Then
WScript.Echo "There are no applicable updates."
WScript.Quit
End If
WScript.Echo vbCRLF & "Creating collection of updates to download:"
Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")
For I = 0 to searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
WScript.Echo I + 1 & "> adding: " & update.Title
updatesToDownload.Add(update)
Next
WScript.Echo vbCRLF & "Downloading updates..."
Set downloader = updateSession.CreateUpdateDownloader()
downloader.Updates = updatesToDownload
downloader.Download()
WScript.Echo  vbCRLF & "List of downloaded updates:"
For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
If update.IsDownloaded Then
WScript.Echo I + 1 & "> " & update.Title
End If
Next
Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")
WScript.Echo  vbCRLF & _
"Creating collection of downloaded updates to install:"
For I = 0 To searchResult.Updates.Count-1
set update = searchResult.Updates.Item(I)
If update.IsDownloaded = true Then
WScript.Echo I + 1 & "> adding:  " & update.Title
updatesToInstall.Add(update)
End If
Next
WScript.Echo  vbCRLF & "Would you like to install updates now? (Y/N)"
strInput = WScript.StdIn.Readline
WScript.Echo
If (strInput = "N" or strInput = "n") Then
WScript.Quit
ElseIf (strInput = "Y" or strInput = "y") Then
WScript.Echo "Installing updates..."
Set installer = updateSession.CreateUpdateInstaller()
installer.Updates = updatesToInstall
Set installationResult = installer.Install()
'Output results of install
WScript.Echo "Installation Result: " & _
installationResult.ResultCode
WScript.Echo "Reboot Required: " & _
installationResult.RebootRequired & vbCRLF
WScript.Echo "Listing of updates installed " & _
"and individual installation results:"
For I = 0 to updatesToInstall.Count - 1
WScript.Echo I + 1 & "> " & _
updatesToInstall.Item(i).Title & _
": " & installationResult.GetUpdateResult(i).ResultCode
Next
End If
Copy the text found in the script, save it as WUA_SearchDownloadInstall.vbs in the system32 folder, and run:
cscript WUA_SearchDownloadInstall.vbs
Very cool indeed.




Method #3 - Use SCONFIG
As noted on my "Manage Windows Server 2008 R2 Core with SCONFIG" article, SCONFIG is a very nice tool that is now built into R2, that you can use to manage many aspects of the Server Core machine. One of these features is the ability to control the Windows Updates settings, and then use it to download updates and either selectively install them, or install them all at once.
To run SCONFIG simply enter sconfig.cmd in the command prompt window, and press Enter.
First, enable Automatic Updates by typing "5" and pressing Enter.
Type "a" and press Enter.

Next, type "6" to get SCONFIG to search and download missing updates.
You'll be able to install all missing updates, or just the recommended ones.




Method #4 - Visual Core Configurator 2008
Visual Core Configurator 2008 is a nice GUI-based tool created by Guillermo Musumeci. The tool is free to use, and can be obtained here:
After downloading the tool, either copy the files to the Server Core machine, or if it's a virtual machine, use the ISO file download instead.
Run the tool.
Press on the "Windows Update" icon.
Press on the "Search for updates" button.
Select the updates you want to download and install, and press on the "Download and Install Updates" button.




Method #5 - Install Using Core Configurator 2.0
On of the first 3rd-party GUI tools for Server Core, this tool is free to use, and can be obtained here:
Run Start_Coreconfig.wsf to start the tool.
The latest version of Core Configurator needs .NET Framework and PowerShell, which it will automatically install once the tool is executed.
You will be prompted to join the customer Experience Improvement Program. Accept or decline.
Press the "Control Panel" button.
Press the "Windows Updates" button.
First, you can configure the Auto Updates settings.
Then, press on the "Check for updates" link and press the "Download updates" button.
You can now select which updates to install.


Hope This Will Help!!!
Amarpal Singh Sandhu

Friday, June 27, 2014

Setup is unable to connect to SQL Server Port 1433

Hi All,

I was trying to install System Center 2012 SP1 Configuration Manager on Server 2008 R2 OS. During the installation i encountered an issue with SQL Server connectivity. I was quite surprised to see this error because I installed the SQL on same server where I was installing the SCCM2012. I followed all the steps that were given in document. To find out what was wrong I started checking the reasons that were suspected On the Database Information wizard screen.




Setup is unable to connect to SQL Server with the connection information provided.  Verify the following:
1.  The SQL Server and instance names are entered correctly
2.  The specified SQL Server instance is not configured to use dynamic ports
3.  If a firewall is enabled on the SQL Server, inbound rules exist to allow connections to the correct ports
4.  The account used to run Setup has permissions to connect to the specified SQL Server instance

As you can see it has given me few details to check with. And then I started checking everything 1 by 1.
For the first issue, I was sure that it could not be the issue because I used the default instance and not the custom one, so now one down…
For the second issue, SQL Server instance is not configured to use dynamic ports  Smile what that means!! Lol  This was the issue…. I will talk about in next step
For the third issue I have manually created Firewall Port exception. Also SQL Server was the same server on which I was installing sccm 2012 so big no to this point.
For the last issue I have used the default system account that SQL Server 2012 configured so this was also ruled out.

Now, let’s come back to Point 2 i.e. The specified SQL Server instance is not configured to use dynamic ports. In this example, this is the reason we are getting the error when using the Named Instance. Also “Named pipes” was disabled I enabled it as well. J to avoid further MP communication issue J

Here is the Resolution :

1.      Open the SQL Server Configuration Manager console

3.      In SQL Server Configuration Manager, expand SQL Server Network Configuration. Click on Protocols for SCCM(SCCM is your Named Instance)
In the right side pane, right click on the TCP/IP (Status Enabled) and click on Properties




5.  In that click on IP Addresses tab. Scroll down to the bottom & make a change to IPALL. TCP Dynamic Ports -> Blank. TCP Port -> 1433 (as this is our default port for SQL Server Database Connection). Click on Apply.



6.  And notice that you need to restart SQL Server (SCCM) Service..



7.        To restart a service. Click on SQL Server Service. Right click on Instance Name: SQL Server (SCCM) and click on Restart. Wait for few seconds.




After that setup SCCM 2012 installed and I was happy to see the 2012 console. J

Hope This Will Help!!!
Amarpal Singh

Monday, May 19, 2014

Date Conflict For Many Optional Applications In Software Center changes to 4/10/1998

There was interesting issue with ConfigMgr 2012 SP1 CU3 client. Many Optional applications in Software Center changes to 4/10/1998 for ‘Available After’

This issue was posted on several forums but there is not solution yet why is this happening.

After working with Microsoft, found the root cause but no permanent solution, instead we have temporary workaround to fix this issue.

Issue:

Applications appear as Old date (1998) in Software Center for ‘Available After’ which is unclear to end users about the application availability and they tend to ignore it.

During the Deployment Microsoft office project professional 2007 application, the available after date shows as 4/10/1998.Why is this?

 And when we deployed the test project professional application, it show correct date .why?

This is not application issue nor is client issue nor Server issue then where the problem,


Basic Troubleshooting:

Ø  The first thing that comes in mind is, check the Scheduled date for the Deployment, what date it is specified? You are wrong. The scheduled date is correct but it will not display here.

Ø  2nd is to look at wmi, application information is stored in “root\ccm\clientsdk” namespace.Startdate for the specific application show wrong Date.

Ø  3rd to look is, run the policy spy and check the properties for the problem package using the application assignment ID,you will see correct date which was scheduled in application deployment but why is this showing as 1998 on client machine?

Ø  4th to look at all the logs (especially policyagent.log, DCMagent.log, ccmstatestore.log) but they don’t reveal much information.

After doing lot of troubleshooting on the client, found the issue is causing because of Task Sequence .Confused?

Root Cause:

Applications which are deployed to clients are also part of Task Sequence as referenced packages, the two deployments causing the clients to go back to old Date.

More explanation:
Assume Task sequence (TS1) which is used to deploy OS is targeted to Collection (coll1) as Optional (not mandatory).This task sequence has many actions for applications For Ex: MS project professional (app1)
So the clients which are part of Collection coll1 (considering the cm12 client is installed) will have information about App1 which used in the Task sequence (TS1).

I also created deployment for App1 and targeted to MS office project collection (coll2) with available option (not required).

So far, No confusions. One TS to coll1 and one application (App1) to coll2.

After the deployment is done, if you look at the software center, if it will show wrong date (1998), then client is not synced correctly and this is happening because of 2 deployments, one from Task Sequence and other from Application Deployment.

To confirm this tested by creating few deployments for the applications used in Task sequence and deployed to test collection (for the clients who are part of TS), i see the same behavior.


Workaround: Do not use the same application which is referenced in Task sequence for the application deployment. Recreate the application used in Task sequence and deploy to clients that will show the right information for ‘available after’.

Thursday, May 15, 2014

SCCM 2012 R2 – Remove Expired Updates

Hi All,
Every time i need to remove an expired update from a baseline is always the same…select the baseline, show members, and select the updates I want to remove…edit membership…
This action takes time, imagine that you need to do it once a month (yes, patch Tuesday). But, if you have many sw update groups?!?!? Yes, you’ll spend bit of time doing it.



Based on this, we can use PowerShell script as well as a console extension that will allow you to remove all expired updates from a SW update group.
To do it, download the RemoveExpiredUpdates  zip file, extract and add the files to the following places:  https://onedrive.live.com/redir?resid=AAD3278AFCB4BCA2%21271
1.    RFL-SUP Deployment Group.xml file  to <CM12R2Console Installation Path)\XmlStorage\Extensions\Actions\2853886b-cce5-4ed4-af43-df69efb2e7d8
And
2.     <CM12R2Console Installation Path)\XmlStorage\Extensions\Actions\bb1a22d4-816f-438c-b6e7-51cbc210112f (change the CM12R2Console to the path of the console )

3.    RemoveExpiredUpdates.ps1 to C:\Scripts\CM12R2Console on the same computer where you installed the CM12 R2 Console
Note: the RFL-SUP Deployment Group.xml has the same name as the href=”http://thedesktopteam.com/blog/raphael/sccm-2012-r2-sw-update-group-to-baseline/” target=”_blank”>SW Update Group to Baseline and can easily be replaced as it contains both actions. if you have not downloaded the SW Update Group to baseline, i suggest you to do it now

Once you have done it, restart the console and you’ll see a new action group called RFL Systems and once you right click any software update group, you’ll also be able to see the action (see below screenshot)



When you click, a PowerShell screen will be shown and the baseline will be created




And no worries, if there is nothing to remove, it will not do anything
  
­
You can view what port the SSB is using by running the following query on the SCCM SQL server.

SELECT name, protocol_desc, port, state_desc FROM sys.tcp_endpoints WHERE type_desc = ‘SERVICE_BROKER’
Hope This Will Work!!
Regards,
Amarpal

SCCM 2007 Distribution Point converts, but content fails

The issue is, in general, very straight forward.  The customer had several existing System Center Configuration Manager 2007 distribution points (DPs) which they wanted to upgrade to be System Center 2012 Configuration Manager DPs as part of their migration from the old product to the new.  The DP migration job ran and converted over the DP but none of the content was successful in conversion, which was really the point of the conversion in the first place.

Before I get into the gory details let me say that I have had numerous customers convert DPs and content, so why this failure occurred I don’t know.  It might have been something in the environment, it might have been a product defect, or it might have been a solar flare at the wrong time causing an electrical disruption.  In any case, the solution was so easy once we figured it out that we never bothered to spend time trying to find root cause.

The early symptom of the problem was a 2389 status message that indicated a failure to connect to the DP.  The logs seem to indicate some kind of WMI failure, which may not really be the problem.  After a bit of other troubleshooting steps we managed to follow these fairly easy steps to resolve it:

1.    Open up SQL Server Management Studio

2.    Run the following query against your ConfigMgr database, where <ServerName> is the FQDN name of the DP you are having problems with

select * from DistributionPoints  where ServerName = ‘<ServerName>’

3.    Make note of the corresponding DPID for your problem (in this example I will call it 123)

4.    Using the DPID returned form the query create an empty DPU file with the DPID as the file name
example:  123.dpu

5.    Put the file in the \Microsoft Configuration Manager\inboxes\distmgr.box

That’s it.  You should start seeing the content converted on the DP.  One query…, one DPU file…, problem solved!

Hope This Will Help !!!

Regards
Amarpal