Thursday, July 24, 2014

Permission to perform this operation was denied (VMWare Convertor)

Encountered an issue while attempting to convert a HyperV server to a vSphere server.
Using the VMWare vCenter converter as per normal, I was faced with a roadblock when I attempted to select the hyperV server for conversion.

Error that was flagged is
"Permission to perform this operation was denied "

In the back of my mind, I was thinking out loud "How could I be denied when I was the domain admin!"
After futile attempts which included running the VMWare convertor as "Administrator", I resorted to the last means which is to turn of the UAC for my account.
After the restart following the change, all works!
Weird but true....

Friday, July 18, 2014

Exchange 2010 Health Check Report

This script is a fast and efficient way of checking if you have any severe issues with your Exchange 2010 setup.
All credits to go to the scripts original author at ExchangeServerPro

All that is need is to download the file from the link above.

The command line in PowerShell to run the script is as follows

Single Server
.\test-ExchangeServerHealth.ps1 -reportmode $true -sendemail $true -server <Exchange Server Name>

Entire Organization
.\test-ExchangeServerHealth.ps1 -reportmode $true -sendemail $true -server *

Servers Starting with perhaps a site with Server Prefixed with "SIN"
.\test-ExchangeServerHealth.ps1 -reportmode $true -sendemail $true -server sin*

The PS script can be downloaded from the link below

The Test-ExchangeServerHealth.ps1 script is run from the Exchange Management Shell. You can use a few builtin parameters to control what it does.
Perform a health check of a single server

Set to $true to generate a HTML report. A default file name
is used if none is specified.

Allows you to specify a different HTML report file name than
the default. Implies -ReportMode

Sends the HTML report via email using the SMTP configuration
within the script. Implies -ReportMode

Only sends the email report if at least one error or warning
was detected.

Writes a log file to help with troubleshooting.
If you use the report mode you’ll get a HTML file containing the health check results, and/or an email to your designated address if you also use the send email option.
For the email functionality to work please update these variables in the script to suit your environment.

# Modify these Email Settings

$smtpsettings = @{
 To =  ""
 From = ""
 Subject = "Exchange Server Health Report - $now"
 SmtpServer = ""

Thursday, July 17, 2014

Useful SCOM 2007 R2 Powershell

Get list Operations Manager Commands

Get list of unavailable/unresponsive agents
Get-Monitoringclass -name "Microsoft.Windows.Computer" | Get-MonitoringObject | Where-Object {$_.IsAvailable -eq $False} | Select-Object DisplayName, IsAvailable | Format-Table

Resolve the healthserviceid to Agent Name
Get-Agent | Where-Object {$ -eq "healthserviceid"} | Select-Object name

Export All Unsealed Management Packs to UnsealedMPBackup Folder
Get-ManagementPack | where {$_.Sealed -eq $false} | Export-Managementpack -path C:\UnsealedMPBackup

Get the Management Server information including the Management Server Action Account identity
Get-ManagementServer | Select-Object DisplayName, IsRootManagementServer, ActionAccountIdentity, HealthState | Format-Table -autosize

Get the User Roles and its Members
Get-Userrole | Select-Object DisplayName, Users

Export all rules in imported management packs to rules.csv
Get-rule | select-object @{Name="MP";Expression={ foreach-object {$_.GetManagementPack().DisplayName }}},DisplayName | sort-object -property MP | export-csv "c:\rules.csv"

Get List of agent managed machines and their ip address
Get-agent | format-list -property, displayname, IPAddress

Enable Agent Proxy for all agents where it is disabled
$NoProxy = get-agent | where {$_.ProxyingEnabled -match "false"}
$NoProxy|foreach {$_.ProxyingEnabled = $true}
$NoProxy|foreach {$_.ApplyChanges()}