You are browsing the archive for Uncategorized.

Avatar of alkin

by alkin

Part 2: Add Locations to OpsMgr Agents with PowerShell

1:50 pm in Powershell, SytemCenter, Uncategorized by alkin

In my previous post I explained how to do a bulk import of locations.

Now that we have all the locations we want into OpsMgr we can associate agent-managed computers, management servers, or resource pools with a location using teh set-scomlocation CMDLET.

The Set-SCOMLocation cmdlet associates one or more agent-managed computers, management servers, or resource pools with a location. This cmdlet removes a current association, if one exists. The Web Application Availability Monitoring Summary Map Dashboard displays state information for agents, management servers, and resource pools associated with a location. You can remove an association by using the Remove-SCOMLocation cmdlet.

The following script will add location coordinates to a list of servers retrieved from a CSV file. You can download the CSV file here.

# //***************************************************************************
# // ***** Script Header *****
# //
# // Solution:
# // File:      AddlocationstoAgents.ps1
# // Author:    Alexandre Verkinderen
# // Purpose:   Add locations to Agents from Excel
# //
# //
# // ***** End Header *****
# //***************************************************************************
# //----------------------------------------------------------------------------
#//
#//  Global constant and variable declarations
#/
#//----------------------------------------------------------------------------

$list = Import-Csv -Path "C:\temp\Servers.csv"

$MS = "MOM4"

Import-Module OperationsManager
#Connect to OpsMgr Management GroupStart-OperationsManagerClientShell -ManagementServerName: $MS -PersistConnection: $true -Interactive: $true

#//----------------------------------------------------------------------------
#//  Main routines
#//----------------------------------------------------------------------------

#Get all agents
$computers = get-scomagent

#Get all Locations
$Locations = Get-scomlocation

foreach ($entry in $list)
{

$name = $entry.Server
$Loc = $entry.Location

#Filter agents by name
$agent = $computers | where { $_.displayname -like "*$name*" }

#Filter agents by Location
$location = $Locations | where { $_.displayname -like "*$Loc*" }

#Set location
Set-SCOMLocation –Location $Location –Agent $agent

write-host server $name is in $loc

}

Hope this helps.

Alexandre Verkinderen

Avatar of alkin

by alkin

Part 1: Bulk import server locations with PowerShell

2:47 pm in Powershell, SytemCenter, Uncategorized by alkin

For a recent project I had to specify the longitude and latitude for all my  servers (about a 1000)  to be able to show them on a map.

In OpsMgr 2012 you can now use the the following new PowerShell CMDlets:

  1. The New-SCOMLocation cmdlet creates a location. You can associate agent-managed computers, management servers, or resource pools with a location by using the Set-SCOMLocation cmdlet. The Web Application Availability Monitoring Summary Map Dashboard displays the items that you associate with a location.
  2. The Set-SCOMLocation cmdlet associates one or more agent-managed computers, management servers, or resource pools with a location. This cmdlet removes a current association, if one exists. The Web Application Availability Monitoring Summary Map Dashboard displays state information for agents, management servers, and resource pools associated with a location.

So In part 1 of this blog series I’m going to create a PowerShell script to bulk import my  locations and then in part 2 a second script to bulk associate servers to a certain location. Lastly I’m going to utilize all those locations and GPS coordinates in a map.

The following PowerShell script will add the Longitude and Latitude coordinates of about 790 cities from a CSV file. You can download the CSV file from here.

# //***************************************************************************
# // ***** Script Header *****
# //
# // Solution:
# // File:      Addlocations.ps1
# // Author:    Alexandre Verkinderen
# // Purpose:   Add locations from excell
# //
# //
# // ***** End Header *****
# //***************************************************************************
# //----------------------------------------------------------------------------
#//
#//  Global constant and variable declarations
#/
#//----------------------------------------------------------------------------

$list = Import-Csv -Path "C:\temp\Locations.csv"

$MS = "SCOMSERVER4"

Import-Module OperationsManager
#Connect to OpsMgr Management GroupStart-OperationsManagerClientShell -ManagementServerName: $MS -PersistConnection: $true -Interactive: $true

#//----------------------------------------------------------------------------
#//  Main routines
#//----------------------------------------------------------------------------

foreach ($entry in $list)
{

$name = $entry.Name
$Long = $entry.Long
$Lat = $entry.Lat
#Set location
New-SCOMLocation –DisplayName $Name –Latitude $Lat –Longitude $Long

write-host Location $name added

}

Stay tuned for part 2.

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

Avatar of alkin

by alkin

Powershell Deployment Toolkit failed missing port for sql server

8:28 pm in Uncategorized by alkin

During the validation of PDT I received the following errory saying that the port was missing for my new SQL instances:

clip_image002

To fix this just add Port="number" in the SQL instance section like shown below:

image

Thanks for Damian Flynn to point this out to me.

Hope this helps,

Alex

Avatar of alkin

by alkin

Best of MMS 2013

12:18 pm in Uncategorized by alkin

Don’t miss the best System Center event in Belgium of the year! http://scug.be/events/

 

 

Seats are limited so hurry!

Alex

Avatar of alkin

by alkin

How to change SCOM reporting to use Kerberos instead of NTLM

12:06 pm in Uncategorized by alkin

One of the Domain admins at one of my customers was complaining about all the NTLM request generated by the scom server to the reporting server. One of the issues with NTLM is that you need to re-authenticate every time, with Kerberos you receive a ticket that is valid for a longer period of time (by default 10hours). You can find more info about NTLM VS Kerberos here: http://blogs.technet.com/b/authentication/archive/2006/04/07/ntlm-s-time-has-passed.aspx 

 

All the SQL servers at this customer are configured to use Kerberos but apparently when the SCOM reporting is being installed and modifying the RSReportServer config file it will change the authentication method as well back to NTLM!! Although Microsoft is recommending Kerberos over NTLM for almost 10 years now, new products like SCOM 2012 are still using NTLM!!

 

To change the report server authentication settings, edit the XML elements and values in the RSReportServer.config file.

You can find the file in the following location: C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer

 

clip_image002

Change the setting from RSWindowsNTLM to RSWindowsNegotiate

clip_image004

 

Important note Important

Using RSWindowsNegotiate will result in a Kerberos authentication error if you configured the Report Server service to run under a domain user account and you did not register a Service Principal Name (SPN) for the account. Make sure to create the SPN for the SQL reporting service as described here: http://blogs.technet.com/b/stefan_stranger/archive/2012/07/31/opsmgr-2012-what-should-the-spn-s-look-like-visual-representation.aspx

 

Thanks,

Alex


Avatar of alkin

by alkin

Installing hyper-v inside a vm on Windows Server 2012

4:07 pm in Uncategorized by alkin

 

For a test setup I needed to install a Hyperv inside a vm running Windows server 2012. I did some googling and found the following post http://www.aidanfinn.com/?p=10175 from Aidan saying that its possible on Win 2008.

So I wanted to give it a try but it failed saying that a Hypervisor was already running

 

image

Apparently in Windows 2012 Microsoft wont let you install the Hyper-V role inside a VM. Bummer!

So I gave it another try using Powershell and hoping to bypass the validation check by using the following command: “Install-WindowsFeature –Name Hyper-V -ComputerName hyperv01-IncludeManagementTools –Restart” but it failed as well, with same error!

The only solution was to ping my good friend Mike Resseler who told me to try the following powershell command:

“DISM /Online /Enable-Feature /FeatureName:Microsoft-Hyper-V" which let me install Hyperv just fine!

image

and the following will enable the Hyperv Management console: “DISM /Online /Enable-Feature /FeatureName:Microsoft-Hyper-V-Management-Clients

Thanks,

Alex

Avatar of alkin

by alkin

SPF examples

10:49 pm in Uncategorized by alkin

Microsoft just released  samples to extend the service managemetn portal and service management API; http://www.microsoft.com/en-us/download/details.aspx?id=36787&WT.mc_id=rss_allproducts_cloudservice

This download contains documentation and samples for the following:

  • Applying a custom theme to the Tenant portal + a sample theming kit
  • Creating a custom Tenant portal
  • Creating a custom Resource Provider + a sample Resource Provider that works with GoDaddy
  • Extending the Usage Endpoint + a sample billing adapter that works with Zuora

Alex

Avatar of alkin

by alkin

Extended network device monitoring list updated

12:45 pm in Uncategorized by alkin

Microsoft just released and updated list of devices that can be monitored by Operations Manager 2012. OpsMgrr 2012 can monitor network devices that support SNMP, and can provide port monitoring for devices that implement interface MIB (RFC 2863) and MIB-II (RFC 1213) standards. You can find more info about those RFC here http://en.wikipedia.org/wiki/Management_information_base .

 

Thanks,

Alexandre

Avatar of alkin

by alkin

testsd

9:14 am in Uncategorized by alkin

Visit Us On TwitterVisit Us On Linkedin