Archive for category SCCM 2012

Enable Wake-On-LAN via CLI

The following will allow you to enable Wake-On-LAN for your network card interface. I’ve only test this on a Windows 7 system, and it’s been working properly in my environment.

By default, my systems have the following configuration:

After running the script, this is how it should look like:

Here’s the code, just copy the code and save with either a .BAT or .CMD extension.

REM ********************************
REM ***** DESCRIPTION **************
REM ********************************
REM ***** Identify network card and write its name
REM ***** to file C:\Users\Default\AppData\Local\Temp\adapters.txt
REM ***** Name of network card is based on the following
REM ***** keywords: gigabit network connection ethernet
REM ********************************
REM ********************************
REM ***** -devicequery Return a list of devices that meet the specified criteria
REM ***** wake_from_any Return all devices that support waking the system from any sleep state.
REM ********************************
REM ***** /I (or /i) Specifies that the search is not to be case-sensitive
REM ********************************
REM ***** Note: this is one long command line (word wrapping may show it as two lines)
POWERCFG -devicequery wake_from_any | FINDSTR /i "gigabit network connection ethernet" > C:\Users\Default\AppData\Local\Temp\adapters.txt

REM ********************************
REM ***** DESCRIPTION **************
REM ********************************
REM ***** Enable WoL on device with the following
rem ***** keywords in its name: gigabit network connection ethernet
REM ********************************
REM ********************************
REM ***** -deviceenablewake Enable the device to wake the system from a sleep state
REM ********************************
FOR /F "tokens=*" %%i IN (C:\Users\Default\AppData\Local\Temp\adapters.txt) DO POWERCFG -deviceenablewake "%%i"

Leave a comment

SCCM 2012 – Software Center Options

The original information came from this source, I’m just adding a few more screenshots for my benefit.

The following script will allow you to change a particular setting found in SCCM 2012’s Software Center.

In Software Center, under the Options tab, and under the Computer maintenance heading, there is a setting – Automatically install or uninstall required software and restart the computer only outside of the specified business hours – that can be set to True (checked) or False (unchecked) by using this script.
Use the following code to obtain the current status of the option. This code you’ll use as the Discovery script.
$getStatus = Invoke-WmiMethod -Namespace "Root\ccm\ClientSDK" -Class CCM_ClientUXSettings -Name GetAutoInstallRequiredSoftwaretoNonBusinessHours -ComputerName $env:ComputerName -ErrorAction STOP

If ($getStatus.AutomaticallyInstallSoftware -eq "True")
Write-Host "Compliant"
Write-Host "Non-Compliant"
Here’s how you’ll add this code to a Configuration Items object.
Next, we’ll need to add the code to make the change or Remediation script
Invoke-WmiMethod -Namespace “Root\ccm\ClientSDK” -Class CCM_ClientUXSettings -Name SetAutoInstallRequiredSoftwaretoNonBusinessHours -ArgumentList @($TRUE) -ComputerName $env:ComputerName -ErrorAction STOP
Here’s how you’ll add this code to a Configuration Items object.
Next, we need to configure a Compliance Rule for the Configuration Item.
Now, as the final portion, we need to create a Configuration Baseline based on the Configuration Item created here and then deploy the Configuration Baseline.


Deploy Pervasive SQL v10 SP3 Using SCCM 2012

Here are the steps to deploy Pervasive SQL v10 SP3 client to your Windows 7 machines using Microsoft’s SCCM 2012.

  1. Create an application package, and you’re going to use SetupWorkgroup_x86.exe
  2. Use the following installation parameters: SetupWorkgroup_x86 /s /v/qn
    1. Type it as shown above. There is no space in /v/qn
  3. For the Uninstall program, look at the screenshot below. You can leave it blank for now, but go back and the proper information once the wizard is complete.
  4. In the Detection Method section, you’re going to look for the MSI file PervasivePSQLv10WGE_x86.msi; this file is also located in the same folder as the setup file in step 1.
These steps worked in my environment.

Leave a comment

MS SQL Server 2008 R2 Native Client – Deployment

In order to deploy Microsft SQL Server 2008 Native Client, follow these steps.

  1. Download it from here
  2. Once you get the MSI, create an application in SCCM 2012
  3. In the Programs tab, you’re going to use the following syntax to execute the MSI: msiexec /i “sqlncli_x64.msi” /q IACCEPTSQLNCLILICENSETERMS=YES
  4. Done
Note: Any time you use the /q parameter you must include IACCEPTSQLNCLILICENSETERMS=YES to accept the terms. This parameter only works for the client, as the title of this document reads.

1 Comment

Deploy AutoDesk DWG TrueView 2013 using SCCM 2012

These are the steps I took to deploy AutoDesk DWG TrueView 2013 using System Center Configuration Manager 2012 (SCCM 2012).

These steps are for deploying DWG TrueView 2013 x64 to Windows 7 Enterprise x64 machines. Make sure you download the correct version of DWG that meets your needs. Download link for DWG TrueView 2013 is here.

For starters, make sure you meet the application requirements.
  1. Microsoft .NET Framework 4 SP1 (or update 1)
  2. VC++ redistributables: 2005 SP1, 2008 SP1 and 2010 SP1
  3. DirectX
Now, since I’m using SCCM 2012, I created a Software Update Group (SUG) to deploy .NET 4 SP1 and all VC++ redistributables.
For .NET Framework 4 you can select the following Microsoft’s articles ID from All Software Updates node in SCCM: 2656405, 2656351(2 updates), 2604121 (3 updates), 2656405, 2487367, 982671 (this is the actual framework) and 2487367. You can add all these updates, put them in a SUG and deploy this to your clients before attempting to deploy DWG TrueView.

As for VC++ redistributables , some are already installed since the SCCM client requires some of these to work properly, so just check your client testing machine and deploy the one(s) missing.

Now, to create the application in SCCM 2012.

  1. In the Create Application Wizard, select Manually specify the application information
  2. In the General section, fill in the proper fields for this application
  3. In the Application Catalog section, fill in the proper fields for this application
  4. In Deployment Types section, click on Add
  5. In the Create Deployment Type Wizard, select Script Installer (Native), and make sure that Manually specify the deployment type information has been selected
  6. In General Information section, fill in the proper fields for this application
  7. In Content section, browse to the network location where you saved DWG TrueView installer files
  8. In the Installation program field, type: setup.exe /w /t /l /q setup.ini  (do not type any quotes!)
  9. In the Uninstall program field: I’m still trying to research how to create an uninstall command for DWG TrueView
  10. In the Detection Method section, click on Add Clause
  11. In Setting Type field, select Windows Installer
  12. In Product Code type: {5783F2D7-B028-0409-0100-0060B0CE6BBA}  (you get this product code from an MSI located in \x64\dwgviewr\dwgviewr.msi)
  13. In the User Experience section, for Installation behavior, select Install for system
  14. For Logon requirement, select Whether or not user is logged on
  15. The next sections can be customized to meet your needs
These steps worked for my environment.

To-do: I still need to figure out how to un-install DWG TrueView 2013. At this point, only the deployment works properly.

From step 8
From steps 11 and 12

Remove TrueView 2013 Desktop Shortcut

This is an optional step, so follow it if you want to remove the desktop shortcut created by setup.exe.

Previously in Step 8, we used setup.exe command line to create the application package. You’re going to create a batch file (INSTALL.CMD) and type its name in this field replacing the entire setup.exe command line.

Here’s how batch file INSTALL.CMD should look like:

REM Install DWG TrueView 2013
setup.exe /w /t /l /q setup.ini

REM Delete desktop shortcut created by SETUP.EXE for all users
del /q c:\users\public\desktop\dwgtru~1.lnk

Note: If a user is logged on while the application is being installed, the user will see the icon for a few seconds while setup.exe finishes and passes control back to the batch file.
There is a setup.ini file which contains CREATE_DESKTOP_SHORTCUT=YES – changing this line to NO did not work for me, that’s why I decided to use the batch file installation approach.

Leave a comment

OS Deployment – Computer Name from Asset Information

In a previous blog post, I modified a script to prompt to a computer’s name during a SCCM 2012 OS Deployment.

This new modified script basically takes the asset information (this isn’t the Asset Tag!) from our DELL computers and uses this information as the new computer name for the device being imaged.

Note: For DELL devices, you need to download DELL’s asset utility to assign an asset number/name to your devices. Sometimes this is automatically done by DELL when companies request it.
Link to updated script is here.

I’m going to over some of the more important details about this script.

Section 1

‘ Win32_SystemEnclosure is the class that contains the SMBIOSAssetTag property
‘ SMBIOSAssetTag property holds the Asset Tag information for the system
Set colSMBIOS = objWMIService.ExecQuery(“Select * from Win32_SystemEnclosure”,,48)

This is the WMI class (Win32_SystemEnclosure) that actually has the information that I’m looking for – the asset information.

Tip: Open a Command Prompt and type wmic then type SystemEnclosure. Now scroll to the right and you’ll see SMBIOSAssetTag column, and below it you should see the asset information assigned to this device. Again, although this labeled as SMBIOSAssetTag, it doesn’t make reference to DELL’s asset tag information, rather to the asset information that you assign using DELL’s utility.

Section 2

‘ Retrieve Asset Tag value from SMBIOSAssetTag
For Each ObjSMBIOS in colSMBIOS
sBiosAssetTag = ObjSMBIOS.SMBIOSAssetTag

The information retrieved is a data collection, so we’re going to use a For..Next loop to retrieve only the data we need, in this case – SMBIOSAssetTag. This information is assigned to our variable sBIOSAssetTag

Section 3

If sBiosAssetTag = “” then
MsgBox “Asset tag has not been set!” & vbCr & “Go back and run DELL’s asset utility.” & vbCR & “Reboot to restart process…”, 0, “Missing Information”

‘ Clean up code to make sure that we log the error message
bExitCode = False
End If

I want to make sure that I, in fact, have assigned an asset information to this device. In the event that I’ve forgotten to run DELL’s asset utility, this section will notify me of such event.

Section 4

‘ We’re converting the name to all uppercase and assign it to OSDComputerName variable
oTaskSequence(“OSDComputerName”) = UCase(sBiosAssetTag)

In my case, I’m converting the value of of sBIOSAssetTag variable (which is a string) to all uppercase, then, this is assigned to our Configuration Manager/TS WMIC variable OSDComputerName.

That’s pretty much it.

1 Comment

Create New Local Administrator From Command Line

The following command line tools will allow you to:

  1. Create a new local user account
  2. Set the account from step 1 to password never expire
  3. Add the account from step 1 to the local “Administrators” group

net user /add

wmic useraccount where “Name=’‘” set PasswordExpires=false
net localgroup Administrators %computername%\ /add
I used these commands during a Task Sequence in SCCM 2012.

1 Comment

Create A Device Collection To Query For A Specific Computer Model And BIOS

Leave a comment

Configuration Manager 2012 RCx Definitions

Leave a comment

Create a DELL BIOS Package for Deployment to a Collection

Leave a comment