Get your “machines per day” average

Hi Folks,

Nothing to do with SCCM but this script could be useful for those of you migrating.

This script returns the average number of machines to migrate per day based on a deadline.

<Start of script>

$today = Get-Date
$i = 0
$numberOfMachines = 6000
$endOfPeriod = Get-Date ‘dd/MM/yyyy’

for ($d=$today;$d -le $endOfPeriod;$d=$d.AddDays(1)){
    if ($d.DayOfWeek -notmatch “Sunday|Saturday”)
    {
        #if the day of the week is not a Saturday or Sunday
        #increment the counter
        #Write-Host $d.DayOfWeek $i
        $i++
    }
}

Write-Host “Remaining days : $i”
Write-Host “Remaining machines : $numberOfMachines”
Write-Host “Average required : ” -NoNewline
Write-Host $([math]::round($numberOfMachines/$i,0)) -ForegroundColor red -BackgroundColor black

<End of script>

Categories: PowerShell, SCCM2007, SCCM2012, Task Sequence | Leave a comment

A year of posts, a year of reading

Thank you for coming over.

Categories: Uncategorized | Leave a comment

Time to celebrate… or not !?

Hi Folks,

After almost a year, my blog went over the 1000 views.

image

In the meantime, as you can see on the screenshot below, no one has ever commented my blog !

How comes? I guess this blog helped one of you at least once, deserving a simple “thanks”, no?

Hope this shout out will be heard.

RatiX.

Categories: Miscellaneous | 2 Comments

PowerShell script to install SCCM 2012 SP1 prerequisites

Hi Folks,

I started to work on a script to automate the installation of SCCM prerequisites.

The script is now in v0.2 and performs the following actions :

– check OS version ( 2008 R2 or 2012 )
– install .Net Framework 3.5
– install IIS
– install WSUS on demand ( 2012 only )
– download and install ADK on demand

There are only few parameters yet but I hope to get feedback from you guys and improve it.

Parameters :

– “-ADKOnline” : specify an online ADK installation ( download to temp folder and installation )
– “-ADKOffline” : specify path to local folder

– “-dotNetPath” : path to sxs folder in case of 2012

This script is provided “AS IS” and can be copied, improved and shared again and again as soon as you give me feedback ! I’m counting on you.

Download the script here : http://sdrv.ms/102ZLSM

RatiX

Categories: Infrastructure, PowerShell, SCCM2012 | Tags: | Leave a comment

Connect to SCCM using PowerShell

Hi Folks,

You might know that now you can access to your SCCM site using PowerShell trough the SCCM console. To do so, right click on the “Application Menu” on the upper left and choose  “Connect via Windows PowerShell :

image

Simple, isn’t it?

But, how would you do when you try to connect remotely from a computer without the console installed?

First of all, you must create a folder called Configuration Manager in “C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules” and copy all the content from “<cm12 adminconsole installation folder>\bin” to the previously created folder.

image

Then, Run as Administrator PowerShell (x86)

Import the Configuration Manager :

Import-Module ConfigurationManager

Connect to your site :

cd <yourSiteCode>: (do not forget the trailing colon)

image

Here you go! Now you are connected, it’s time to create your own script and automate your administration !

RatiX

Categories: PowerShell, SCCM2012 | Leave a comment

Cannot download package with antivirus

Hi Folks !

I faced an interesting issue when downloading packages on SCCM clients when the computer running an antivirus software ( here it is kapersky but the issue might be faced with others ).

I wasn’t able to successfully complete the package download. When reviewing the so-called CAS.log on client side, I found the following error :

image

Right after the download completes, the hash is calculated and compared to the one from SCCM. If there is a mismatch then the download is set to “failed”.

After turning off the antivirus, I re-downloaded the same package and…. Voilà ! Now it works.

image

I then configured antivirus exclusions on “c:\windows\ccmcache

I do not know much about the “how” but I suspect a corruption while downloading the package with the “realtime scan” of the antivirus.

RatiX

Categories: SCCM2012, Software Distribution | Leave a comment

Creation automation of “System Management” container

Hi folks,

What more boring than creating the “System Management” container and setting the permissions accordingly over and over again?

Going at your mother-in-law’s? Ok, this is not the purpose here.

Let’s get back to our deployment boring matter.

Here is a powershell script to create and set permissions on the newly created container.

CD AD:
$GGSMSServers=”your SCCM computer group here”
$ComputerNameSCCM=”SCCMServerName”
$adspath = ([ADSI] »).distinguishedName
$query = New-ADObject -name “System Management” -type container -path “CN=System,$adspath” –passthru
$acl = get-acl $query
$group = new-adgroup $GGSMSServers -groupscope global –passthru
$sid = new-object System.Security.Principal.SecurityIdentifier $group.SID
$objectguid = new-object Guid
$ace1 = new-object System.DirectoryServices.ActiveDirectoryAccessRule $sid, 0xF01FF, “Allow”, $objectguid, “All”
$acl.AddAccessRule($ace1)
set-acl -aclobject $acl $query
Get-ADComputer $ComputerNameSCCM | Add-ADPrincipalGroupMembership -MemberOf $GGSMSServers

Do not forget to run this script from a powershell session where the AD module has been imported.

Enjoy, read & share !

RatiX

Categories: Infrastructure, PowerShell, SCCM2007, SCCM2012 | Leave a comment

Get SQL server version name from version number

Hi Folks,

Sometimes, these DBA guys are not so cool and fun and don’t wanna share much about their instances… I’ve found an easy way to get the SQL server version from version number. You’ll get your version number from the “about” window.

Here is below the link between names and version numbers :

Name Version Number Release Date  Code Name
SQL Server 2012 11.0.2100.60 1 April 2012 Denali
SQL Server 2008 R2 10.50.1600.1 3rd May 2010 Kilimanjaro
SQL Server 2008 10.00.1600.22 6th Aug 2008 Katmai
SQL Server 2005 9.00.1399 Sep. 2005 Yukon
SQL Server 2000 8.00.2039 2000 Shiloh
SQL Server 7.0 OLAP Tools   1999 Palato mania
SQL Server 7.0 1998 Sphinx
SQL Server 6.5 1996 Hydra
SQL Server 6.0   1995 SQL95
SQL Server 4.21   1993 SQLNT
SQL Server 1.1   1991  
SQL Server 1.0   1989  

 

Overview SQL Server version numbers of editions with Service Pack:

 

Name RTM/No SP SP1 SP2 SP3 SP4
SQL Server 2012 11.0.2100.60 11.0.3000.00    
SQL Server 2008 R2 10.50.1600.0 10.50.2500 10.50.4000.0    
SQL Server 2008 10.00.1600.22 10.0.2531.0 10.0.4000.0 10.00.5500  
SQL Server 2005 9.00.1399 9.00.2047 9.00.3042 9.00.4035 9.00.5000
SQL Server 2000 8.00.194 8.00.384 8.00.532 8.00.760 8.00.2039
SQL Server 7.0 7.00.623 7.00.699 7.00.842 7.00.961 7.00.10

If you want to get deeper into SQL, here is how to :

 

Querying for version/edition info

Get the current installed version of SQL Server:

SELECT @@VERSION AS Version

or nicer:

SELECT 
	SERVERPROPERTY('Edition') AS Edition,
	SERVERPROPERTY('ProductVersion') AS ProductVersion,
	SERVERPROPERTY('ProductLevel') AS ProductLevel

shows result like: "9.00.3054.00, SP2, Developer Edition."

or e.g.


or e.g.
select @@microsoftversion / 0x01000000, @@microsoftversion & 0xFFFF

Categories: Infrastructure, SCCM2012, SQL | Leave a comment

Silent installation of SCCM console

Hi Folks,

If you want to deploy the console to all your administators, here is the command line to silently do so :

ConsoleSetup.exe LangPackDir=”LanguagePack” TargetDir=”%programfiles%\Microsoft Configuration Manager\AdminConsole” DEFAULTSITESERVERNAME=”<SCCM FQDN>” ENABLESQM=0 /q

Now, the question is : where to find the sources ?

Here is the answer, get them from :

– The installation CD : SMSSETUP\BIN\I386. Copy adminconsole.msi, ConsoleSetup.exe and LanguagePack folder.

– The installation folder : Tools\ConsoleSetup.

Once you created your application deployment, deploy it to your administrator collection and here you go !

RatiX.

Categories: Infrastructure, SCCM2012, Software Distribution | Leave a comment

Upgrade path to Configuration Manager 2012 SP1

Hi Folks !

It’s been such a long time since I’ve posted something. I have so much to say but too busy yet to write it down on my blog.

I will (hopefully) soon release some new posts about my last nightmares while implementing SCCM 2012.

Anyway ! Here is a link to the upgrade path to SP1 :

Planning to Upgrade System Center 2012 Configuration Manager

And below, the supported configurations for SP1 :

Supported Configurations for Configuration Manager

Enjoy, read & Share !

 

RatiX

Categories: Uncategorized | Leave a comment

Blog at WordPress.com.