CCMEXEC.COM – System Center blog

CCMEXEC.COM – by Jörgen Nilsson

Browsing Posts published in January, 2012

There was a question on Technet forum a couple of weeks ago so I thought I would post it here as well. It can in some scenarios be useful to set the computers AD description during SCCM OS deployment. I use a script for this which can be used to set the AD description using  a variable like for instance a Computer or Collection variable that can be filled in during the deployment or a value from MDT variables if you like.

This is the script I use:


dim Computerdn, strComputerName

dim Args

Set WshShell = WScript.CreateObject("WScript.Shell")

'----Get Computer DN------

Set objADSysInfo = CreateObject("ADSystemInfo")

ComputerDN = objADSysInfo.ComputerName

strcomputerdn = "LDAP://" & computerDN

Set objADSysInfo = Nothing

'-----Read commandline---

Set args = WScript.Arguments

strdesc = args(0)

Addcompdesc strdesc

Function addcompdesc(strPCdescription)

Set objComputer = GetObject (strComputerDN)

objComputer.Put "Description", strPCdescription

objComputer.SetInfo

end function

Then I run it from a package in the task sequence. It must be run after the “Setup Windows & ConfigMgr” step, so that the computer is restarted after it is joined to the domain.
The account which executes the script must have permissions in the AD to set the AD Description. Just replace the %desc% with the variable you want to use or static value if you want to use that.

ADDesc1

If you want to be prompted for an AD description when the Task Sequence starts create a Collection variable for the OSD Collection with an empty value like this:

ADDesc2

dim Strdomainpath
dim Computerdn, strComputerName
dim Args
Set WshShell = WScript.CreateObject(”WScript.Shell”)
‘—-Get Computer DN——
Set objADSysInfo = CreateObject(”ADSystemInfo”)
ComputerDN = objADSysInfo.ComputerName
strcomputerdn = “LDAP://” & computerDN
Set objADSysInfo = Nothing
‘—–Read commandline—
Set args = WScript.Arguments
strdesc = args(0)
Addcompdesc strdesc
Function addcompdesc(strPCdescription)
Set objComputer = GetObject (strComputerDN)
objComputer.Put “Description”, strPCdescription
objComputer.SetInfo
end function—————————-

When you have a task sequence in SCCM with many steps the monitor goes into power save mode before the installation is complete. In some cases the end-user can believe that the computer installation is finished and closes the lid on the laptop and goes home and the OS installation fails. It is also really annoying when waiting for an installation is complete.

I use the following to simple steps in my Windows 7 deployment task sequence to prevent the computer monitor for entering power save.

The first step simple configures the current power scheme to not turn off the monitor when power is connected, this command must run after the “Setup Windows and ConfigMgr” step so that the computer has restart with the locally installed OS:

sccmpower1

When the installation of the OS is complete i simply restore the Power Scheme back to default by running the following command. When the OS deployment is complete I simply configure the power option either by using Group policy Preferences or Configuration Manager.
sccmpower2

Last week on the 17-18 of January the SCCM Summit 2012 event arranged by Cornerstone took place in Stockholm Sweden. A great event focusing on System Center 2012: Configuration Manager for 1 1/2 days. The event hosted speakers like Johan Arwidmark, Anders Ahl, Niall Brady and Peter Frodin.
I had the great opportunity to deliver three sessions myself:

  • System Center 2012: Endpoint Protection
  • CM 2012 Application Management part 1
  • CM 2012 Application Management part 2

It was great fun and a really great event! Thanks Cornerstone for a great event and thanks to everyone who attended, looking forward to next year!

SCCM_Summit

I wrote a post a year ago or more about how to install the SCCM 2007 Admin Console including R2, this is something I use a lot in my projects as it is more and more to install when installing the Admin Console.
In the example below I install the Admin Console, the required hotfix(kb977384) and R3. If you are using Forefront Endpoint Protection you need to install the FEP Admin UI extensions as well on your client machines which should have the SCCM console locally installed, I will post an example of a script with the FEP integration later on.

When R3 came along the SCCM 2007 R3 requires a hotfix(KB977384) which restarts a lot of services on the computer during installation for instance ccmexec, WMI and so on, if a Task Sequence or application installation runs it will stop and return error.
so I wrote a little vbscript which uses a .MIF file to report the installation status back to the SCCM server. It will report any errors back to the SCCM server so that it is easy to troubleshoot.

The script can be downloaded here: Install

To implement the script do the following:

  1. Copy the needed installation media to a folder with the following sub-folders.
    sccm_adminui_r33Note: to save space I deleted files in the WAIK directory from the Configuration Manager SP2 installation source as these files are not needed to install the admin console.
  2. Save the downloaded vbscript to the folder you just created and rename it to install.vbs.
  3. Create a Unattend.ini file in the ConfigMgr_sp2 folder with the following content, you need to change the server name to your SCCM Primary Site server.

    [Identification]
    Action=InstallAdminUI
    [Options]
    SMSInstallDir=c:\program files\Configuration Manager 2007
    ParentSiteServer=SCCM1
    SDKServer=SCCM1
  4. In SCCM Create a Package with the source folder beeing the folder structure just created.
  5. In the package properties configure the following under the reporting tab: (this is used to match the .mif file generated by the script with the package)
    sccm_adminui_r31
  6. Create a program with the following settings:
    sccm_adminui_r32
  7. If you want to display the installation progress in a cmd windows to the users, configure the program to “Allow users to interact with this program”
  8. Add the package to your Distribution Points
  9. Advertise the program to a test collection and start testing.

I hope this can be useful for more than me.