You are browsing the archive for 2013 December.

Avatar of alkin

by alkin

Install OpsMgr Agent remotely with Powershell

1:59 pm in Powershell, SytemCenter by alkin

As you are aware by now I’m creating a series of Powershell automation activities to automate some System Center installation tasks. Below you can find a Powershell script that will connect to the Opsmgr server remotely (so you dont need the OpsMgr powershell snappin installed locally) deploy the scom agent and enable agent proxiyng on them.


#=======================================================================
#
# NAME: Opsmgr 2012 Agent Install
#
# AUTHOR: Alexandre Verkinderen
# DATE  : 10/23/2013
#
# Requirements: FIrewall needs to be disabled
#
# COMMENT: This script is designed to install OpsMgr 2012 agents.
# The following serfvers  need agents instaled using default options: Install-SCOMAgent <a href="http://technet.microsoft.com/en-us/library/hh920243.aspx:">http://technet.microsoft.com/en-us/library/hh920243.aspx:</a> DC01, SCVMM01
#=======================================================================

#Variables
$MS = "SCOM01.contoso.com"

#Connect remotely to the SCOM server
Invoke-Command -ComputerName $MS -ScriptBlock {

#Variables
$MS = "SCOM01.contoso.com"
$AgentList = @("dc01.contoso.com")
$Password = ConvertTo-SecureString "Passw0rd!" -AsPlainText -Force
$username = "contoso\administrator"
$InstallAccount = New-Object System.Management.Automation.PSCredential($username,$Password)

#Import PowerShell Modules
import-module OperationsManager

#Connect to OpsMgr Management Group
New-SCOMManagementGroupConnection -ComputerName $MS

#--------------------------------------------------------------
#OpsMgr Agent Installation
#-----------------------------------

Foreach($Agent in $AgentList)
{

Install-SCOMAgent -Name $Agent -PrimaryManagementServer (Get-SCOMManagementserver -Name $MS) -ActionAccount $InstallAccount
write-host $Agent "Installed"

}

#----------------------------------
#Sleep so the agent install can finish before enabling agent proxying
#-------------------------------------

Start-Sleep -s 60

#----------------------------------------------
#enabling agent proxying for vmm and AD management pack
#-------------------------------------------------

#Enable Agent Proxying
Get-ScomAgent | where{$_.ProxyingEnabled.Value -eq $False} | Enable-SCOMAgentProxy
}

thanks,

Alexandre Verkinderen

Avatar of alkin

by alkin

Configure users and Roles in App Controller with Powershell

12:41 pm in Powershell, SytemCenter by alkin

I had to configure remotely some users and Roles in App controller with Powershell.  You can find a lot of all App Controller CMDLets here http://technet.microsoft.com/en-us/library/jj899760(v=sc.20).aspx.

Below you can find the Powershell Script used to connect remotely to the app controller server and add users to the appropriate User Roles:


#=======================================================================
 #
 # NAME: Configure App Controller
 #
 # AUTHOR: Alexandre Verkinderen
 # DATE  : 10/29/2013
 #
 # Requirements:
 #
 # COMMENT:
 #=======================================================================

#Variables
 $APPC = "SCVMM01.contoso.com"

Invoke-Command -ComputerName $APPC -ScriptBlock {

#import App Controller module
 Import-Module -Name AppController

#Variables
 $APPC = "<a href="https://scvmm01.contoso.com&quot;">https://scvmm01.contoso.com"</a>
 $User1 = "contoso\developer"
 $User2 = "contoso\endsuer"
 $Password = ConvertTo-SecureString "Passw0rd!" -AsPlainText -Force
 $username = "contoso\administrator"
 $Credentials = New-Object System.Management.Automation.PSCredential($username,$Password)

#Connect to App Controller
 Get-SCACServer -ServerName $APPC -Credential $Credentials

#Retrieve Userroles
 $UserRole = Get-SCACUserRole –Managed | where { $_.Name –eq "Administrators" }

#Add users to Administrator User Role

Set-SCACUserRole -UserRole $UserRole -AddMembers $User1,$User2
 Write-Host $User1 " and " $User2 " added to App Controller" -foregroundcolor green

}

Avatar of alkin

by alkin

SCSM The report server cannot process the report or shared dataset

7:33 am in SytemCenter by alkin

 

I encountered the following issue while trying to run a report from the Service Manager console:

scsm

This was a total new installation (done by the Power Depoloyment Toolkit) and everything was installed fine without any errors so I doubled check my SQL, my datawarehouse server, my SQL reporting Service and by digging deeper and deeper into the reports themself on the SQL report I discovered the following error:

 

image

So that was the culprit!  To solve this issue, open the configuration of each report, go to data sources and select the DWDataMart Data source:

image

 

click OK and now you will be able to run reports again!

 

Thanks,

Alexandre Verkinderen

Avatar of alkin

by alkin

Powershell Deployment Toolkit and WAP

2:50 pm in Azure, SytemCenter by alkin

The latest publicly available PDT version 2.5.270 now includes besides System Center 2012 R2 also Windows Azure Pack.

You can find the new WAP roles in the Variable.xml as shown below:

clip_image002

You will notice that a few roles are missing like the SMA role. You can easily include the SMA Roles

  • System Center 2012 R2 Service Management Automation Web Service Server
  • System Center 2012 R2 Service Management Automation PowerShell Module
  • System Center 2012 R2 Service Management Automation Runbook Worker Server

by just copying the missing roles from the workflow.xml into your variable.xm like this:

<Role Name="System Center 2012 R2 Service Management Automation Runbook Worker Server" Component="System Center 2012 R2 Service Management Automation">

image

Thanks to Rob Willis for pointing this out to me.

Alexandre Verkinderen

Avatar of alkin

by alkin

Poweshell Deployment Toolkit fails for SCCM

6:05 am in Uncategorized by alkin

 

I kept getting errors on the automatic deployment of SCCM with the PDT toolkit. The thing is that SCCM cannot work with Dynamic ports as described here:

So to fix this just change the SQL port in the to a fix port like shown below:

image

Normally PDT is going to verify if all the SQL settings are defined correctly during the pre-install validation except for this one. So if you want PDT to verify that the SCCM instance is not set to a dynamic port you can add:

<SQL>
<Port>True</Port>
</SQL>

…to the <Validation> section of the SC DB role in the variable.xml file

Thanks for Rob Willis to help me with this.

Alex

Visit Us On TwitterVisit Us On Linkedin