Archive

Posts Tagged ‘#SCCM’

Regional Settings depending on first 3 letter in computername in a task sequence.

January 31, 2013 Leave a comment

Hello.

So i wanted to set regional settings depending on the first 3 letter in the computer name when i deploy it, the best way i found was to use a XML and set it with the control.exe command for example control.exe intl.cpl,, /f:”%temp%\Denmark.xml”

This way i can set keyboard layout, location and format.

this is what the task sequence looks like.

Image

And under Options of each group i have a WMI query to check the first 3 letter in the name

SELECT * FROM Win32_ComputerSystem WHERE Name Like “XXX%”

i Created 2 files, one XML file containing the country codes and one cmd file that copies the file locally and then executes it, for some reason just a “Run Command” step did not work.

the cmd is very simple, it copies the xml file from the DP to the temp folder. and then runs the control.exe command notice the dp0 has no \ as it is already included in the variable.

copy %~dp0Sweden.xml %temp%\Sweden.xml
control.exe intl.cpl,, /f:”%temp%\Sweden.xml”

This is what the step looks like

Capture

The XML file was a little bit trickier as it contains different country codes, the GeoID, sv-SE, and an ID, and you can ofcourse add multiple “InputLanguageID” if you want more keyboard layouts.

<gs:GlobalizationServices xmlns:gs=”urn:longhornGlobalizationUnattend”>
<!– user list –>
<gs:UserList>
<gs:User UserID=”Current” CopySettingsToDefaultUserAcct=”true” CopySettingsToSystemAcct=”true”/>
</gs:UserList>
<!– GeoID –>
<gs:LocationPreferences>
<gs:GeoID Value=”221″/>
</gs:LocationPreferences>
<!– UI Language Prefernces –>
<gs:MUILanguagePreferences>
<gs:MUILanguage Value=”sv-SE”/>
<gs:MUIFallback Value=”en-GB”/>
</gs:MUILanguagePreferences>
<!– system locale –>
<gs:SystemLocale Name=”SV-SE”/>
<!– input preferences –>
<gs:InputPreferences>
<gs:InputLanguageID Action=”add” ID=”041d:0000041d”/>
<gs:InputLanguageID Action=”remove” ID=”0409:00000409″/>
</gs:InputPreferences>
<!– user locale –>
<gs:UserLocale>
<gs:Locale Name=”sv-SE” SetAsCurrent=”true” ResetAllSettings=”true”>
</gs:Locale>
</gs:UserLocale>
</gs:GlobalizationServices>

GeoID you can find here but you need to use a HEX to Decimal converter to get what you want.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd374073(v=vs.85).aspx

And here are the Locale ID:s

http://msdn.microsoft.com/en-us/goglobal/bb895996.aspx

here is a little more info on how to write the XML file

http://msdn.microsoft.com/en-us/goglobal/bb964650

 

When you have created all the XML files and CMD files but them in your source folder and create a package from it. you dont need to create a program.

5

As a last step in the regional settings group i have a rule that sais if the first 3 letters are NOT any of for example XXX, CCC, FFF it will set Swedish

Image

Advertisements
Categories: Uncategorized Tags:

Application Dependencies in SCCM 2012

May 4, 2012 18 comments

A new feature in CM 2012 is the ability to set dependencies on applications. This is something that I have been waiting for and it works really well.

For example this is my deployment for AX 2012 Client.

In this scenario I needed to create 4 different dependencies that would all be installed, this is done by pressing “Add” and then adding a dependency, if you add 2 dependencies under the same group it will be “this OR that” but if you add them in different groups it will be “this AND that”.

You can for example have one group and add different versions of Visual C++ Redistributable if the application does not require the latest version it will check if any of those versions are installed, if any of those versions are installed it will skip it.

If you add 2 dependencies under the same group you can also set priority, if none of the dependencies are installed the application with the highest priority is the first one to be installed, the best way here is to only check “Auto Install” on the application you want to install if the device is not satisfying.

A dependency doesn’t have to be something that the application you are installing requires it can be anything.

I created a bunch of applications in a folder I call “Pre Reqs\Microsoft” with the most common pre requisites like SQL Native Client etc etc, stuff that I can use over and over again.

When you deploy an application that have dependencies linked to it the SCCM Client will check what decencies is already installed, if none are installed it will automatically download them and install.

This also works when doing it via task sequence.

If you check Software Center you will see the number of components it downloads if you have 4 dependencies and 1 is installed it will say downloading 4 components (3 dependencies and the program itself)

One thing to keep in mind is that if a dependency fails to install the whole deployment fails. You can see what dependency failed under deployment monitoring. I had one case where my C++ 2010 was an older version and the deployment failed because a newer version was already installed on the computer.

Categories: SCCM Tags:

SCCM 2012 Content Distribution Settings

April 5, 2012 Leave a comment

Hello.

Im rolling out SCCM 2012 atm in our production enviroment and its going great! Migration jobs are running very smoothly, some hickups but that was expected.

I ran into a problem where my Task Sequences would not run and all the applications i tried to would not install in the client. In SCCM 2007 there where some problems (atleast in my setup) with this in the past, those errors where almost always permission related either with Network access account, IIS settings (Webdav…), or in some cases firewall settings. so naturally that was what i checked first but everything seemed fine. All the packages where green in status and where distributed to the right DP.

BUT! the settings for almost all my packages where “Manually copy the content in this package to the distribution point”
After i changed this to “Automatically…” and updated the DP everything started to run!

Categories: SCCM Tags:

Set screen resolution in WinPE with qres

March 30, 2012 Leave a comment

Hi again.

Setting the right screen resolution in WinPE might seem like an easy task but as i found it its not… i tried all sort of ways, editing the unattend file, setting it with tasksequence variables and whatnot, all of them worked but it was a static value so it would set the same resolution for all models. This is an example of how you could do it, im sure that there are easier ways but i found this to be the best for me.

First download qres from some site, do a quick google search. copy it to you distribution share and create a vbs script with the following code.

On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("localhost")
For Each strComputer In arrComputers
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_DisplayConfiguration", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)

If objItem.PelsWidth <= 800 then
set oShell = CreateObject("WScript.Shell")
oShell.run"qres.exe /x 1024 /y 768"
oShell.run"qres.exe /x 1280 /y 1024"
oShell.run"qres.exe /x 1280 /y 800"
oShell.run"qres.exe /x 1366 /y 768"
oShell.run"qres.exe /x 1400 /y 1050"
oShell.run"qres.exe /x 1600 /y 900"
oShell.run"qres.exe /x 1600 /y 1200"
oShell.run"qres.exe /x 1680 /y 1050"
oShell.run"qres.exe /x 1920 /y 1080"
oShell.run"qres.exe /x 1920 /y 1200"
end if
If objItem.BitsPerPixel < 32 then
set oShell = CreateObject("WScript.Shell")
oShell.run"qres.exe /c:32"
end if
next

I added some standard resolutions for laptops and desktops but if you have more just add them to the script.
Now create a package with all the files and distribute it to you DP.

Open up a task sequence and add a “Run Command line step” and type in the name of the script you just created.
If you want add a Task Sequence Variable “IsVM equals false” this way it wont run if its a VM, i added it becouse it ran and changed the resolution to the highest resolution in the script and blew up the window so big that i couldn´t see the whole desktop.

Now save you Task Sequence and test it out. Make sure you have the correct display drivers in your boot image. in most cases it will work without them but in some cases specially with laptops it wont set the “optimized” resolution if the display driver is not present.

Categories: SCCM Tags:

Deploy .exe files as a MSI deployment type.

March 30, 2012 5 comments

Hello again.

I thought I would write about how to deploy an exe file as a “msi deployment type”. In many cases you don’t have access to a MSI file but still want to deploy it with all the cool features that an msi deployment type has.

First you need to .exe file of the application you want to deploy, put it under a folder in your deployment share.
for example I want to deploy Notepad++ for myself and a couple of colleagues, I could use a msi packager and create a msi package from scratch but that takes time and its such a small application that I just want to deploy to a handful of people in the IT department.

First go to Software Library > Application Management > Applications and if you want to create a new folder called IT.

Software Library

Right click the folder and choose “Create Application”

In the wizard click on “Manually specify the application information” and on the next screen input the application information

On the next screen select your language, Localized application name, User categories and browse to the .exe file to get the icon.

Catalog info

On the next screen press “Add..” this will open up a new window where we need to spevify all the information on the deployment type, so go ahead the choose “Manually specify the deployment type information”

Input a name for the application and choose language.

Now we need to input the installation information, first enter the location of the content. If you press “Browse” you will see that you can only pick MSI files so we need to manually input the installation command, in this case “notepad++.exe /S” if we want we can also specify the uninstall information, this is a little harder to find, in most cases there is a uninstall program in the installation folder, you could also check the registry for an uninstall command. In the screen below there is an error you need to type Uninstall.exe /S for it to uninstall silently.

Now press “Next”

The next step is to input information so that Configuration Manager knows if the application is already installed on the device we deploy to. So go ahead and press “Add Clause…”

In this case we specify a file present on the device if it’s already installed, if this was a MSI file it would import the product code. There is also an option to input registry information. Press OK > Next

Next step is to specify installation behavior. As everyone here want Notepad++ as you can’t live without it I choose “Install for system” and  “Whether or not a user is logged on” the most obvious difference between “Install for system” and “Install for user” is that if you install for system it will show up under Software Center and install for user will show up under the Application Catalog site.

On the next screen you can specify Requirements, I only want to deploy this if the user is a primary user for the device. So press “Add…” if you want to you can also add other requirements such as disk space, operating system, OU or even create your own custom requirement with a registry key, SQL query or LDAP query.

Now press OK > Next

Next screen is for dependencies, as this has no we skip this and press next. This can be very useful if you for example deploy Adobe flash player for Firefox you can here specify that for it to install Firefox has to be present on the device as without it it’s pretty useless.

Click “Next” on Summary, we are not back on the Create Application Wizard so just press “Next” and we are done.

Now all you need to do is distribute the content to your DP and deploy it to a Device, User or Group.

Categories: SCCM Tags: