Author Archive | Jonathan

Upgrade Sequencing for System Center 2012 R2 stated by Microsoft

This is a reminder post on the Upgrade Sequencing for System Center 2012 R2 posted by Microsoft.

The supported upgrade sequence is the following.

  1. Service Management Automation
  2. Orchestrator
  3. Service Manager
  4. Data Protection Manager (DPM)
  5. Operations Manager
  6. Configuration Manager
  7. Virtual Machine Manager (VMM)
  8. App Controller
  9. Service Provider Foundation
  10. Windows Azure Pack for Windows Server
  11. Service Bus Clouds
  12. Windows Azure Pack
  13. Service Reporting

Read more at Upgrade Sequencing for System Center 2012 R2.

0

Copy files with Robocopy and create a htm report with Orchestrator

This is an example on how to copy files and folders with Robocopy in Orchestrator. At the end the Runbook converts the Robocopy report to a html page so it can be easily read with a web browser.

This is the Runbook.

Copy files with Robocopy and create a htm report with Orchestrator1

The “Run Program” activity “Run Robocopy” looks as the following with the command: C:\Windows\System32\Robocopy.exe “C:\From” “C:\To” /S /E /PURGE /LOG:”C:\tmp\RobocopyLog.txt” /np

Copy files with Robocopy and create a htm report with Orchestrator2

The “Run .Net Script” activity “Convert txt file to htm Properties” is seen below.

Copy files with Robocopy and create a htm report with Orchestrator3

The PowerShell script is borrowed from the site Life of a Geek Admin but I modified it some to fit my needs. Here is how my script looks like.

$SourceFile=”C:\tmp\RobocopyLog.txt”
$TargetFile=”C:\tmp\StatusLog.htm”
$File=Get-Content$SourceFile
$FileLine= @()
Foreach ($Linein$File) {
 $MyObject=New-Object-TypeNamePSObject
 Add-Member-InputObject$MyObject-TypeNoteProperty-NameRobocopy-Value$Line
 $FileLine+=$MyObject
}
$FileLine|ConvertTo-Html-PropertyRobocopy|Out-File$TargetFile
 
When running this Runbook it copies the files and folders from “C:\From” to “C:\To” and then creates a web report that looks as this.Copy files with Robocopy and create a htm report with Orchestrator4

 

0

Show amount of AD Computers and Users with Orchestrator on webpage

This is a simple example on how you can use the “Write Web Page” to show how many computers and users there are in your Active Directory. I used a similar Runbook during a migration project when everybody wanted to get status of the migration. The example is based on three activities and will count computers and users and then add the number to a web page.

The Runbook looks like this.

Show amount of AD Computers and Users with Orchestrator on webpage1

The activity “Run .Net Script” is using commands to count computers and users in Active Directory. The activity then publishes the variables “comptot” and “usertot” to the databus. In the example below I am using the PowerShell module from Active Directory.

Show amount of AD Computers and Users with Orchestrator on webpage2

As for the next activity “Write Web Page” some parameters have been added.

Show amount of AD Computers and Users with Orchestrator on webpage3

The template file “index_template.html” that have been added is seen below.

Show amount of AD Computers and Users with Orchestrator on webpage4

The result when running this Runbook and opening the index.html looks like this.

Show amount of AD Computers and Users with Orchestrator on webpage5

0

Create AD User with Orchestrator by just using “Run .Net Script” activity and AD PowerShell module

I sometimes get the question if it is possible to use a PowerShell module in the out-of-the box activities in Orchestrator. The answer to the question is – yes off course. Just remember to deploy the module to every Runbook server that is going to run the Runbook that is using the module.

I will below show an example where I am creating an AD user by using the “Run .Net Script” activity in Orchestrator together with the “Active Directory module for Windows PowerShell” in Server 2008 R2.

This is a very easy Runbook that only will create an AD User.

Create AD User with Orchestrator by just using Run Net Script activity and AD PowerShell module1

The “Run .Net Script” activity looks like this.

Create AD User with Orchestrator by just using Run Net Script activity and AD PowerShell module2

Remember that the Runbook will execute under the Orchestrator Service account and therefore it will need rights to create the user, in this example. In the “Run .Net Scripts” activity it is not possible to execute the activity under an account other than the Runbook Service account.

Therefore I would recommend, when creating a user by PowerShell, to use an Orchestrator Integration Pack that can execute PowerShell with a user account that only have access to create AD users.

3

Add Service Manager IR, SR or CR with Orchestrator

To add a System Center Service Manager Incident, Service Request or Change Request with Orchestrator you can use the Service Manager Integration Pack activity “Create Object”.

When using the activity I would recommend to add the ID field and put IR{0}, SR{0} or CR{0} in the text box. If IR, SR or CR is not added the ID will be added without prefix.

Below is an example with the ID of an Incident.

Add Service Manager IR SR and CR with Orchestrator

0