Tuesday, August 12, 2014

SCCM 2012 R2 CU2: OSD fails with error 0x80004005

While appling SCCM OSD image on systems with SSD's you may receive an error stating that the Task Sequence failed with error code 0x80004005.


This error will occur shortly after the partitioning sequence in OSD when it attempts to apply a wim.

One thing to note is that this issue has occurred for me in the following scenario.

  • SSD installed in the system.
  • Network card listed after SSD in the Bios boot order.
  • A Format and Partition sequence similar to the following:


This issue did not occur if there was one primary partition set to 100%.  This issue may also appear if you have an SSD and a HDD with the HDD higher in the boot order in the Bios or with the SSD on a sata channel other than SATA0.  In my case the issue was caused by the nic listed after the SSD hard drive in the bios boot order.

Following are my recommendations to resolve the issue:

  • Ensure SSD is on SATA0
  • If you have an SSD and a HDD in the system make sure the SSD is higher in the boot order.
  • Ensure that the nic is listed before the SSD device in the bios boot order similar to boot the order shown below.

Hopefully this helps.  Please leave a comment or provide feedback if you have any other suggestions that may be helpful to others that run across this issue.

Monday, June 9, 2014

Microsoft SCCM 2012: Office Professional Plus 2013 SP1 (32-bit) Application

This post will focus on creating a package in SCCM for Microsoft Office Professional Plus 2013 SP1 (32-bit).  This package will uninstall previous 32bit Office instances.

Please note that the 32bit Office version will not uninstall previous 64bit instances.  If you have a mixed 32bit/64bit office environment you will need to setup other programs or packages to handle the uninstall of 64bit office.

Visio and Project can be packaged in a similar manner.  If you have a Visio/Project source media that is 32 & 64 bit make sure you choose the setup.exe located inside of the x86 or x64 folder depending on which version of the application you are publishing.

Note:  After installing Office 2013 with Service Pack 1 from the Volume Licensing Service Center (VLSC) with a customized MSP file using the Office Customization Tool (OCT), Lync and OneDrive for Business are not installed.

Please reference the following post if you run into this issue:
http://blogs.technet.com/b/odsupport/archive/2014/03/21/lync-2013-and-onedrive-for-business-are-not-installed-when-installing-office-2013-with-service-pack-1.aspx

To resolve the issue download the updated OCT from here (choose the version that matches your office installation):
http://www.microsoft.com/en-us/download/details.aspx?id=35554

Run the .exe to extract the files to a temporary location.  Once extracted grab the admin folder and copy it over your existing Office 2013 SP1 source admin folder.

Creating an Office Customization .msp file


In order to deploy office silently we will need to create an Office customization file.  This will include out product key as well as many other customizations.

First we need to go to the source where you Office install files are located and launch setup with the following command in order to start the Microsoft Office Customization Tool:

setup.exe /admin

Select Create a new Setup customization file for the following product.

Next we make any Office customizations that we would like to be applied to your Office install.  Following are the customizations I generally make to create a .msp that when applied will perform an install that requires no user interaction (progress bar only) as well as remove some of the initial popups users are prompted with.  In this case the .msp is for a MAK product key.

  • Setup
    • Installation and organization name
      • Organization name: = your organization
    • Licensing and user interface
      • Select Enter another product key
        • Product key: = xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
      • Check I accept the terms in the License Agreement
      • Display level: = Basic
        • Check Suppress modal
        • Check No cancel
    • Modify Setup properties (Add these properties in)
      • AUTO_ACTIVATE = 1 (Activates Office)
      • SETUP_REBOOT = Never (Suppresses Reboot)
  • Features
    • Modify user settings
      • Microsoft Office 2013
        • Privacy
          • Trust Center
            • Disable Opt-in Wizard on first run = Enabled
        • FirstRun
          • Disable First Run Movie = Enabled
    • Set feature installation states (Run from My Computer for all components)
Once you have made all of the changes that you would like to customize your Office installation select File, Save As.  Save the file in the Office\updates folder as customizations.msp.

Creating a SCCM Office 2013 Professional Plus 2013 (32-bit) Application


When creating an application for Office you will first point the application the proplusww.msi, but Office doesn't allow you to install an application directly from that MSI.  You are required to install Office by launching setup.exe.  You will see in the following steps that we will initially point it to the proplusww.msi, then go back in and e

  • In the SCCM Console go to Software Library, Application Management, Applications, Create Application.
  • General section. Select Manually specify the application information.  Next.
    • General Information
      • Name = Microsoft Office 2013 Professional Plus 2013 SP1 (32-bit)
      • Administrator comments = Enter your admin comments here
      • Publisher = Microsoft
      • Software version = 2013 SP1
      • Check Allow this application to be installed from the Install Application task sequence action without being deployed
      • Next
    • Application Catalog
      • Icon.  Browse to the Office Setup.exe and select the Office icon from the list.
      • Check Display as a featured app and highlight in the company portal
      • Next
    • Deployment Types
      • Add
      • General section. Select Manualy specify the deployment type information. Next.
        • General Information
          • Name = Microsoft Office 2013 Professional Plus 2013 SP1 (32-bit)
          • Administrator comment = Enter your admin comments here
          • Languages = English
          • Next
        • Content
          • Content location = location of your source Office file
          • Installation program = setup.exe
          • Uninstall program = setup.exe /uninstall
          • Next
        • Detection Method
          • Add Clause
            • Setting Type = Windows Installer
            • Product code = Browse to the proplusww.msi located in the proplus.ww folder of your Office source media
            • Ok
          • Next
        • User Experience
          • Installation behavior = Install for system
          • Logon requirement = Whether or not a user is logged on
          • Installation program visibility = Normal
          • Next
        • Requirements
          • Free Disk Space of any local drive >=  3072 MB
          • Operating System = Window 7 / Windows 8 / Windows 8.1 / Windows Server 2008 R2 (64-bit) / Windows Server 2012 (64-bit)
          • Total physical memory >= 1024 MB
          • CPU >= 1000 MHz
          • Next
        • Dependencies
          • Next
        • Summary, Next.
        • Completion, Close.
      • Next
    • Summary, Next.
    • Completion, Close.
Now right click on your application and distribute content.  Once the content has been distributed you can now deploy the application to collections.


Wednesday, May 7, 2014

Powershell script to customize windows mouse schemes and pointer options

The following post will show a script that can be used to set the windows mouse pointer scheme as well as the pointer option to enable Show location of pointer when I press the CTRL key in the Default user profile.

This script came about after a request I received from a faculty member to make some accessibility changes in one of the labs they were using.  Initially I looked to see if there was a solution in group policy but didn't find one there.  However, I figured it should just be a matter of finding the correct registry keys to make the changes.

After doing some searching I found that the mouse pointer schemes are held in the HKCU\Control Panel\Cursors location in the registry.  I then changed the scheme on a test box and adjusted my script to match the scheme I wanted to distribute.

The setting for the pointer option I wanted to change was located in the HKCU\Control Panel\Desktop\UserPreferencesMask key.  This is a binary key that is responsible for multiple settings.  An example of the default key is 9E 1E 07 80 12 00 00 00.  The highlighted section of the example key shows which value changes when the pointer option for Show location pointer when I press the CTRL key is select.  Once selected the value of that section changed from 1E to 5E.

One quick note about my script is that this script only performs this action on the Default user profile so any new user will receive these changes.  If you want to perform this on a system that may contain existing users you have two choices.

  1. Create a logon script that sets the settings in the HKCU when the user logs in.
  2. Edit the powershell script to first list all user profiles on the system and then do a foreach to mount each profile and apply the appropriate settings.  The benefit of this method is that it can be distributed and applied without a user being logged into the system; however, precautions will need to be taken in those cases where a user is logged into a system and the profile may be locked.

Powershell script to load the Default user profile, change mouse scheme, and enable Show location pointer when I press the CTRL key.

<#
Description: This script will import the Default user hive (ntuser.dat).
Then it will apply registry keys to set the mouse pointer scheme and
enable "Show location of pointer when I press the CTRL key".

Created By: Michael J. Wolf
Date Created: 2014/05/07
#>

#Load Default user hive to HKU\hive
New-PSDrive -PSProvider registry -Root HKEY_USERS -Name HKU
reg load HKU\hive "C:\Users\Default\ntuser.dat"

#Set Mouse Pointer Scheme to Windows Black (extra large)
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name "(Default)" -Value "Windows Black (extra large)" -PropertyType String -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name AppStarting -Value %SystemRoot%\cursors\wait_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name Arrow -Value %SystemRoot%\cursors\arrow_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name Crosshair -Value %SystemRoot%\cursors\cross_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name Hand -Value "" -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name Help -Value %SystemRoot%\cursors\help_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name IBeam -Value %SystemRoot%\cursors\beam_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name No -Value %SystemRoot%\cursors\no_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name NWPen -Value %SystemRoot%\cursors\pen_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name "Scheme Source" -Value 2 -PropertyType DWord -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name SizeAll -Value %SystemRoot%\cursors\move_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name SizeNESW -Value %SystemRoot%\cursors\size1_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name SizeNS -Value %SystemRoot%\cursors\size4_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name SizeNWSE -Value %SystemRoot%\cursors\size2_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name SizeWE -Value %SystemRoot%\cursors\size3_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name UpArrow -Value %SystemRoot%\cursors\up_rl.cur -PropertyType ExpandString -Force
New-ItemProperty -Path "HKU:\hive\Control Panel\Cursors" -Name Wait -Value %SystemRoot%\cursors\busy_rl.cur -PropertyType ExpandString -Force

#Enable Pointer Option: Show location of pointer when I press the CTRL key
New-ItemProperty -Path "HKU:\hive\Control Panel\Desktop" -Name UserPreferencesMask -Value  ([byte[]](0x9E,0x5E,0x07,0x80,0x12,0x00,0x00,0x00)) -PropertyType Binary -Force

Start-Sleep -Seconds 2

#Unload Default user hive
reg unload HKU\hive

If you are using SCCM and wish to create a package to distribute this script you can reference my post on Microsoft SCCM 2012: Creating a powershell script package.

Microsoft SCCM 2012: Creating a powershell script package

The following post will show you how to create a SCCM 2012 package that runs a powershell script.

I have referenced this in previous posts but wanted to break this out specifically because I find myself referencing this process in many posts.  My future posts will just reference this process in an effort to keep posts to the point.

Creating the powershell script package

  • In the SCCM Console go to Software Library, Application Management, Packages.  Click on Create Package.
  • Package
    • Name = Powershell Script Package Name
    • Description = Package Description
    • Manufacturer =
    • Language = English
    • Version = Version
    • Check This package contains source files.  Browse to the Source folder that contains the powershell script you created.
    • Next.
  • Program Type
    • Select Standard Program, Next.
    • Standard Program
      • Name = Powershell Script Program Name 
      • Command line = powershell -ExecutionPolicy ByPass -File PowershellScriptName.ps1
      • Startup folder =
      • Run = Normal
      • Program can run = Whether or not a user is logged on
      • Next.
    • Requirements
      • Estimated disk space = Unknown
      • Maximum allowed run time = Unknown
      • Next.
  • Summary.  Next.
  • Close.
Right click on your package and distribute it to your distribution point.  After that you should be ready to go to deploy it to collections or call it from other package like your Java install package as you will see in the next post.

Tuesday, April 29, 2014

Microsoft SCCM 2012: Java 7 Runtime (All Versions) Uninstall Package

This post will show you how to create an uninstall package for Java 7 that will uninstall all versions of Java 7 up to version 7 Update 55.  This package will call on a powershell script to handle the uninstall process.  This package will be referenced in an upcoming post and is a critical component to successfully install Java from an extracted MSI (resolves msi repair/reinstall corruption).

Java 7 Uninstaller Powershell Script

The first step in the process is to create a powershell script that will look into the registry to see which versions of Java are installed and then run an uninstall command for any version of Java 7 that is installed. 

In this case I only have the script looking for Java 7 and will create seperate uninstallers for other major Java releases.  This will allow me flexibility in those cases where I need to keep a previous major version installed for application compatibility but want to uninstall another version.  With that said, there is nothing keeping you from editing this script and adding in the proper values for Java 6, 8, etc. and having a single script that uninstalls those instances as well.

Following is a brief description of what the script does:
  1. Kill processes that may be tied to Java.  This will resolve some setup failure issues that occur if the processes are left running.
  2. Populate an array with each Java version product code.  This is where you will define new versions of Java that come out.
  3. For each code in the array check if it exists in the registry.
    1. If the product code exists perform and uninstall of Java based on that product code.
For any version of Java 7 you will find a corresponding uninstall key in the registry path HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ followed by a product code GUID.  In the case of Java 7 the product code looks like:

{26A24AE4-039D-4CA4-87B4-2F86417004FF}

I have highlighted the section of the key above that is modified with subsequent version releases.  You can easily determine the next key by modifying the highlighted values accordingly.
  1. The 6417004 in the key can be either 32 or 64 depending on whether it is referencing the 32 bit instance of Java or the 64 bit instance of Java.
  2. The internal version number for Java 7 is version 1.7.0.  This can be found in the following portion of the highlighted code 6417004.
  3. The update revision is reference in the following portion of the highlighted code 6417004.
So, in the example above you can see that the key represents the 64bit version of Java 7 (1.7.0) Update 4.

Following is the powershell script that I use.  There isn't any error catching in the script which would be handy and probably a focus on a future script update so please provide feedback.

<#
Java 7 Uninstaller

Description: This script will kill any Java dependent processes.
It will then proceed to run though an array of known Java product codes to check if they exist on the system.
If a Java instance is located this script will uninstall that instance of Java.

Written by Michael J. Wolf
Date: 2014/04/05
#>

#Kill Processes
Stop-Process -Name iexplore* -Force
Stop-Process -Name firefox* -Force
Stop-Process -Name chrome* -Force
Stop-Process -Name javaw* -Force
Stop-Process -Name jqs* -Force
Stop-Process -Name jusched* -Force

#Uninstall Java

#Java 7 Product Code Array
$JavaPCode = "{26A24AE4-039D-4CA4-87B4-2F83217000FF}", <# Java 7 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417000FF}", <# Java 7 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217001FF}", <# Java 7u1 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417001FF}", <# Java 7u1 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217002FF}", <# Java 7u2 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417002FF}", <# Java 7u2 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217003FF}", <# Java 7u3 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417003FF}", <# Java 7u3 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217004FF}", <# Java 7u4 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417004FF}", <# Java 7u4 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217005FF}", <# Java 7u5 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417005FF}", <# Java 7u5 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217006FF}", <# Java 7u6 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417006FF}", <# Java 7u6 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217007FF}", <# Java 7u7 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417007FF}", <# Java 7u7 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217009FF}", <# Java 7u9 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417009FF}", <# Java 7u9 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217010FF}", <# Java 7u10 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417010FF}", <# Java 7u10 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217011FF}", <# Java 7u11 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417011FF}", <# Java 7u11 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217013FF}", <# Java 7u13 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417013FF}", <# Java 7u13 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217015FF}", <# Java 7u15 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417015FF}", <# Java 7u15 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217017FF}", <# Java 7u17 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417017FF}", <# Java 7u17 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217021FF}", <# Java 7u21 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417021FF}", <# Java 7u21 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217025FF}", <# Java 7u25 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417025FF}", <# Java 7u25 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217040FF}", <# Java 7u40 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417040FF}", <# Java 7u40 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217045FF}", <# Java 7u45 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417045FF}", <# Java 7u45 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217051FF}", <# Java 7u51 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417051FF}", <# Java 7u51 64bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F83217055FF}", <# Java 7u55 32bit #>`
             "{26A24AE4-039D-4CA4-87B4-2F86417055FF}" <# Java 7u55 64bit #>

#Search registry for each value in the JavaPCode array.
Foreach ($PCode in $JavaPCode) {
    #If product code exists uninstall Java with that product code.
    If (Test-Path ("hklm:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $PCode)){
       Start-Process -FilePath "msiexec.exe" -ArgumentList (" /x " + $PCode + " /qn /norestart") -Wait -Passthru
    }
}

Creating the SCCM Java 7 Uninstaller package

  • In the SCCM Console go to Software Library, Application Management, Packages.  Click on Create Package.
  • Package
    • Name = Java 7 Uninstaller
    • Description = This application will uninstall all versions of the Java 7 Runtime
    • Manufacturer =
    • Language = English
    • Version = 7
    • Check This package contains source files.  Browse to the Source folder that contains the powershell script you created above.
    • Next.
  • Program Type
    • Select Standard Program, Next.
    • Standard Program
      • Name = Java 7 Uninstaller
      • Command line = powershell -ExecutionPolicy ByPass -File JavaUninstaller.ps1
      • Startup folder =
      • Run = Normal
      • Program can run = Whether or not a user is logged on
      • Next.
    • Requirements
      • Estimated disk space = Unknown
      • Maximum allowed run time = Unknown
      • Next.
  • Summary.  Next.
  • Close.
Right click on your package and distribute it to your distribution point.  After that you should be ready to go to deploy it to collections or call it from other package like your Java install package as you will see in the next post.


 

Friday, April 4, 2014

Microsoft SCCM 2012: Creating a SAS 9.X (32Bit/64Bit) Activation/Renewal Package

This post shows how to create a SAS 9.X package that is used to activate or renew a SAS 9.X installation.

Please reference the following article which provides details about silently renewing SAS 9.1/9.2/9.3/9.4 in a Windows 7 environment:

Please note that the process is the same for SAS 9.1/9.2/9.3/9.4 32Bit and 64Bit.  The only difference is the path to the sasrenew executable.  I will denote path differences in the sasrenew.exe path quick reference section of this post.

Creating the SAS Activation/Renewal Package (9.2 32Bit)

  1. Go to Software Library, Application Management, Packages.
  2. Select Create Package
    1. Package
      1. Package Name = SAS 9.2 32Bit Renewal (2014-2015)
      2. Description = I usually put the license expiration and a few details here.
      3. Manufacturer = SAS
      4. Language = English
      5. Version = 9.2
      6. Check This package contains source files
      7. Your source will be the sid_files folder of your SAS software depot which should contain you sid.txt license file.
      8. Next.
    2. Program Type
      1. Select Do not create a program.  We will be creating 3 programs for this package in a bit.
      2. Next.
    3. Next
    4. Close
    5. Distribute the package to distribution point.
  3.   Creating a program for the system profile folder (SAS versions < 9.4)
    1. Select the package you just created and choose create program.
    2. Program Type
      1. Select Standard program, Next.
      2. Standard Program
        1. Name = SAS system profile folder
        2. Command line = cmd.exe /c "mkdir %windir%\system32\config\systemprofile\Documents\"
          1. This directory is needed for sasrenew to work when installed under system account credentials.  Please reference the SAS KB article referenced in the beginning for details.  If you do not create this directory you have a few more options.
            1. Change your sasv9.cfg -SASUSER path to a location where system credentials have access.
            2. Create a command line task sequence that references this package and performs a run as with an administrative account that has rights to the -SASUSER path.
        3. Program can run = Whether or not a user is logged on
        4. Next.
      3. Requirements
        1. Estimated disk space = Unknown
        2. Maximum allowed run time = Unknown
        3. Next.
      4. Next
      5. Close
  4. Creating a program to copy the sid to the sasrenew directory on the endpoint.
    1. Select the package you just created and choose create program.
    2. Program Type
      1. Select Standard program, Next.
      2. Standard Program
        1. Name = SAS sid file copy
        2. Command line = xcopy ".\*" "C:\Program Files\SAS\SASFoundation\9.2(32-bit)\core\sasinst\sasrenew" /E /C /Y
      3. Program can run = Whether or not a user is logged on
      4. Next.
    3. Requirements
      1. Check Run another program first
        1. Package = SAS 9.2 32Bit Renewal (2014-2015)
        2. Program = SAS system profile folder
      2. Check Always run this program first
      3. Estimated disk space = Unknown
      4. Maximum allowed run time = Unknown
      5. Next.
    4. Next
    5. Close
  5. Creating a program to activate/renew SAS
    1. Select the package you just created and choose create program.
    2. Program Type
      1. Select Standard program, Next.
      2. Standard Program
        1. Name = SAS 9.2 32Bit Activation
        2. Command line = "C:\Program Files\SAS\SASFoundation\9.2(32-bit)\core\sasinst\sasrenew\sasrenew.exe" -s "datafile:C:\Program Files\SAS\SASFoundation\9.2(32-bit)\core\sasinst\sasrenew\sid.txt"
      3. Program can run = Whether or not a user is logged on
      4. Next.
    3. Requirements
      1. Check Run another program first
        1. Package = SAS 9.2 32Bit Renewal (2014-2015)
        2. Program = SAS sid file copy
      2. Check Always run this program first
      3. Estimated disk space = Unknown
      4. Maximum allowed run time = Unknown
      5. Next.
    4. Next
    5. Close
  6. Deploy the SAS 9.2 32Bit Activation program to your collection(s).  There is no need to deploy the other programs, they will launch automatically when your main program sees the requirement to run the other two programs first.

Confirming SAS validation data and expiration

After you run this package on an endpoint you can confirm the SAS expiration by performing the following:
  1. Open SAS 9.2
  2. In the Editor type in the following
    1. proc setinit;
    2. alias;
    3. run;
  3. In the menu click submit (run icon)
  4. Validation data will appear in the log window

Sasrenew.exe path quick reference

  • SAS 9.2 32Bit
    • C:\Program Files\SAS\SASFoundation\9.2(32-bit)\core\sasinst\sasrenew
  • SAS 9.2 64Bit
    • C:\Program Files\SAS\SASFoundation\9.2\core\sasinst\sasrenew
  • SAS 9.3 32Bit
    • C:\Program Files\SASHome\x86\SASRenewalUtility\9.3
  • SAS 9.3 64Bit
    • C:\Program Files\SASHome\SASRenewalUtility\9.3
  • SAS 9.4 32Bit
    • C:\Program Files\SASHome\x86\SASRenewalUtility\9.4
  • SAS 9.4 64Bit
    • C:\Program Files\SASHome\SASRenewalUtility\9.4

Tuesday, March 25, 2014

Microsoft SCCM 2012: Creating a file copy Task Sequence

If you need to copy a set of files to a location on a workstation you can accomplish this by setting up a package containing your source files, then setting up a Run Command Line Task sequence to copy the contents of your package to the location you want the files to reside on your system.

The first step is to create a source only (non-program) package with the following steps
  1. Go to Software Library, Application Management, Packages, and select Create Package.
  2. Provide a Name for your package (Description, Manufacturer, Language, and Version are optional).
  3. Place a check in "This package contains source files".
  4. Browse to your source files folder and click ok when finished.
  5. Click Next.
  6. Select the option "Do not create a program"
  7. Click Next, Next, Close.
  8. Select your new package and be sure to Distribute Content to your distribution point(s).
Next we will create a Task Sequence to copy the contents of the package to a destination on the endpoint.  This process will utilize the Run Command Line task as well as a method where you can place multiple commands into one command line as reference in the previous post.

  1. Go to Software Library, Operating Systems, Task Sequences.  Here we can create a new task sequence or edit an existing task sequence and make the following changes.
  2. In the task sequence select Add, General, Run Command Line.
  3. Provide a name for your Run Command Line task.
  4. In the command line you will perform a command similar to the following to make a directory if it doesn't exist and then perform then copy the files (if the directory already exists no make directory is needed).
    1. cmd.exe /c md C:\Windows\Temp\FileCopyExample & cmd.exe /c xcopy ".\*" C:\Windows\Temp\FileCopyExample /y /e
  5. Place a check in Package, then browse to the package you created in the first step.
  6. Click Ok to save and close the task sequence

The Task sequence can now be deployed to collections where it is needed.

Monday, March 24, 2014

Microsoft SCCM 2012: Running multiple commands from a Run Command Line Task Sequence

In SCCM 2012 Task Sequences there is an option to Run Command Line as shown in the following picture:


This is generally used when a command needs to be run during the post Setup Operating System area of a Task Sequence.  In most of the examples I have seen people have created a separate Run Command Line task for each command they want to execute.  This will work, but I wanted to clean things up a bit and thought there must be a way to perform more than one command in a command line.

This is where the & operator comes in.  When you used the & operator of the cmd.exe command you can add multiple commands to the same line.  Following is an example of how to configure your Run Command Line to perform multiple commands in one Run Command Line.


In general the format is as follows:
cmd.exe /c somecommand1 & cmd.exe /c somecommand2 & cmd.exe /c somecommand3 & etc...

I will have other followup posts in the near future with examples of this method.  If you have other tips and tricks with the Run Command Line please feel free to post them in the comments.