Sep
12

Set Folder security through RES workspace manager using Icacls

Set Folder security through RES workspace manager using Icacls

Folder security for applications can always be a challenge, when working in a business environment. Users often don’t have all the local access, so during a package process you have to know where and what kind of permissions an application requires.

With this knowledge I faced the following challenge:
“What if your virtualized application needs extra permissions on a local folder and you also need to access this folder from outside of the bubble?”

 Of course there are several ways to do this, but I want to share a solution which I implemented at a customer. A solution I think is very easy to change and to manage.

 Within RES Workspace manager I created a Managed Application with the following settings:

Properties – General Tab:

Title Set local Permissions
Description Icacls to set local file permissions
Command-line C:\Windows\System32\icacls.exe
Parameters “C:\Program Files\Foldername\*” /grant domain\security-group:(F) /T

managed-app
Properties – Setting Tab:

Check at least the following:

-          Application is enabled
-          Do not show in “New Applications”
-          AutoLaunch ALL users
-          Hide application  managed-app-settings

Access Control:

Add the proper security group  managed-app-access

Security – Dynamic Privileges Tab:

Set Access token to: “Add administrator rights”  managed-app-security

That’s it! Every time the user logs on, the permissions will be set on the proper file/folder.

For more info about Icacls.exe, visit: cacls – Wikipedia, the free encyclopedia

Sep
06

Rename computername during SCCM Tasksequence

Rename computername during SCCM Tasksequence

At one of my customers I was responsible for deploying computers using SCCM 2007 R2.
The customer asked me to add computers to SCCM using a continuous number, but during the deployment the computers must be renamed to identify if it’s a laptop or a desktop.
e.g. for a laptop: LT000001

To fix this issue and rename the computers I created a VBScript, called Computername.vbs

Computername.vbs
First I’ve set the variables for the script, where I use the TaskSequence variable to receive the computername from the SCCM-database.

Set oShell = CreateObject(“Wscript.Shell”)
Set oTSEnv = CreateObject(“Microsoft.SMS.TSEnvironment”)
strMachineName = lcase(oTSENV(“_SMSTSMachineName”))
strComputer = “.”

 Then I added an option to set the continuous number if the deployment was executed by Task Sequence Media (e.g. USB-stick).

If left(strMachineName,6) = “minint” Then strMachineName = inputbox(“Please enter your computernumber (Last 6 digits of the serial, or the 6 digits of your CI-Code)”,”Computer Name”,,30,30)

The customer used Fujitsu hardware and for laptops they only used “Lifebook”-computers. So I used the following check to identify if the hardware was a laptop or a desktop.

Set objWMIService = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2″) 
Set colItems = objWMIService.ExecQuery(“Select * from Win32_Computersystem”) 
For Each Item In colItems
            strModel = UCase(item.model)
            If left(strModel,8) = “LIFEBOOK” then
                        strType = “LT”
            Else
                        strType = “PC”
            End If
Next

 Now the renaming can begin, this is the easy part. :-)

oTSEnv(“OSDComputerName”) = UCase(strType & strMachineName)

Of course you can add more conditions to the script, but the most important part of the renaming is when and how you run the script.
To run the script I added a Command Line-job where I selected the package-name and in the Command Line-box I added the name of the script: 
Task Sequence Command Line

Then I made sure this script runs BEFORE you apply the Operating System: 
Task Sequence
That’s it! With these settings you can rename your computer during deployment.
I hope this article will help you in your SCCM environment! If you have any additional comment, please let me know!

Bad Behavior has blocked 15 access attempts in the last 7 days.