Participation of the Opalis Community Evaluation Program

Standard

Today my application for the Opalis Community Evaluation Program(CEP) is accepted by Microsoft. I am verry happy being a part of this program. What can you expect from me as being a part of the Opalis CEP program?
Well I hope that I can blog about several topics which are discussed inside the program. My first blog about Opalis will be about installing your own Opalis Test Environment.

More information about the program can be found here

Do you want to know more about Opalis, check one of these movies:

8 Minute Demo – Opalis Product Overview 
Opalis 8 minute video demo: Why Opalis?
Opalis 8 minute video demo: Opalis Incident Remediation
Opalis 8 Minute Video Demo : Opalis CMDB Federation and Event Remediation

SCCM 2007 R2 SP2: Reporting Services Error

Standard

On my SCCM environment I had an error when I want to install and access the reporting services. The reporting services were installed on a dedicated SQL 2008 SP1 Server.

On the SCCM Console I get the following error:

The RPC server is unavailable (Exception from HRESULT:0x800706BA

On the SQL Server where the Reporting Services Site Server were installed I got the following error:

On 13-9-2010 00:00:00, component SMS_SRS_REPORTING_POINT on computer SERVER reported: SRS root folder “Reports” is not present or not properly configured SRS Reporting point server “SERVER”.

The solution for this problem was:

Enable the firewall rule “Windows Management Instrumentation (WMI-In)” and allow the connection on the SQL Reporting Services Server

Powershell script to dynamically create Local Admin Groups

Standard

Last week I was looking for a way to create Local Admin groups for each computer in a OU. First I tried to do this with a batch script. But after some scripting I thought ‘Batch scripting is old, let’s do it with Powershell’. That said, I rewrited the script to powershell and below the result:

$ou    = [ADSI]"LDAP://OU=Computers,DC=DOMAIN,DC=LOCAL"
$ou1   = [ADSI]"LDAP://OU=Security,DOMAIN,DC=LOCAL"
$groupexists  = 0
$groupadded  = 0

foreach ($child in $ou.psbase.Children ) {  
if ($child.ObjectCategory -like '*computer*') {
$name = $child.Name
$groupname    = "LocalAdmin_" + $name
$groupdescription = "Local Administrator Group for " + $name

   foreach ($child1 in $ou1.psbase.Children ) {

  if (($child1.ObjectCategory -like '*group*') -and ($child1.sAMAccountName -eq $groupname) ) {
     $groupexists++
    } else {
     $objGroup = $child1.Create("group", "CN=" + $groupname)
     $objGroup.psbase.InvokeSet("groupType", -2147483648 + 2)
     $objGroup.Put("sAMAccountName", $groupname )
     $objGroup.Put("description", $groupdescription )
     $objGroup.SetInfo()
     $groupadded++
    }
   }
  }
}
write-host 'Total Added Groups :'$groupadded
write-host 'Total Exists Groups :'$groupexists

But the above script was giving me a very annoying error:

Exception calling "SetInfo" with "0" argument(s): "There is a naming violation. (Exception from HRESULT: 0x80072037)" At C:test.ps1:11 char:22 +                 $objGroup.SetInfo <<<< ()     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException     + FullyQualifiedErrorId : CatchFromBaseAdapterMethodInvokeTI

I did some debugging of the error and tried different ways of creating the group. But none of them was resulting in a working group. I decided to fire some ‘googles’ but none of them was resulting in a fix. So my last option was to post te script on the Microsoft Social Technet forum and ask the community to fire on the script. And yes, someone gived me the right direction and it results in a working script. Below you can find the working version:

$ou    = [ADSI]"LDAP://OU=Computers,DC=DOMAIN,DC=LOCAL"
$ou1   = [ADSI]"LDAP://OU=Security,DOMAIN,DC=LOCAL"

$groupexists  = 0
$groupadded  = 0
foreach ($child in $ou.psbase.Children ) {
 if ($child.ObjectCategory -like '*computer*') {
   $name   = $child.Name
   $groupname  = "LocalAdmin_" + $name
   $groupdescription = "Local Administrator Group for " + $name

   Write-Host "Name: $($name)"
   Write-Host "GroupName: $($groupname)"

  If (![adsi]::Exists("LDAP://CN=$groupname,OU=Security,DOMAIN,DC=LOCAL")) {
   $objGroup = $ou1.Create("group", "CN=" + $groupname)
   $objGroup.psbase.InvokeSet("groupType", -2147483648 + 2)
   $objGroup.Put("sAMAccountName", $groupname )
   $objGroup.Put("description", $groupdescription )
   $objGroup.SetInfo()
   $groupadded++
  } else {
   $groupexists++
  }
 }
}
write-host 'Total Added Groups :'$groupadded
write-host 'Total Exists Groups :'$groupexists

Thanks to Boe Prox for giving me the right direction!

SCCM 2007 R2 SP2: Computers/Laptops Collections

Standard

Today I was looking for a way to group my laptops and computers based on Operating System in SCCM. This can be done through query based collections. After some searches I came to the following final query’s which did the job for me:

Computers – Windows XP 

select SMS_R_System.ResourceId, SMS_R_System.ResourceType, SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier, SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client from SMS_R_System inner join SMS_G_System_SYSTEM_ENCLOSURE on SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId where SMS_R_System.OperatingSystemNameandVersion like “%Workstation 5.1%” and SMS_R_System.SystemOUName like “%DOMAIN/OU’s%” and SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes not in (“8″,”9″,”10″,”14”)

Computers – Windows 7

select SMS_R_System.ResourceId, SMS_R_System.ResourceType, SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier, SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client from SMS_R_System inner join SMS_G_System_SYSTEM_ENCLOSURE on SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId where SMS_R_System.OperatingSystemNameandVersion like “%Workstation 6.1%” and SMS_R_System.SystemOUName like “%DOMAIN/OU’s%” and SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes not in (“8″,”9″,”10″,”14”)

Laptops – Windows XP

select SMS_R_System.ResourceId, SMS_R_System.ResourceType, SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier, SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client from SMS_R_System inner join SMS_G_System_SYSTEM_ENCLOSURE on SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId where SMS_R_System.OperatingSystemNameandVersion like “%Workstation 5.1%” and SMS_R_System.SystemOUName like “%DOMAIN/OU’s%” and SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes in (“8″,”9″,”10″,”14”)

Laptops – Windows 7

select SMS_R_System.ResourceId, SMS_R_System.ResourceType, SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier, SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client from SMS_R_System inner join SMS_G_System_SYSTEM_ENCLOSURE on SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId where SMS_R_System.OperatingSystemNameandVersion like “%Workstation 6.1%” and SMS_R_System.SystemOUName like “%DOMAIN/OU’s%” and SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes in (“8″,”9″,”10″,”14”)