Posts

Showing posts from November, 2012

When 2 become 1...

Ok so I am a bit late on this one but like a persistent lover I get there in the end...:) What am I on about?  Powershell and Ops Manager. I just wrote my first PowerShell for Ops Manager and it rocks. Well...not really but I like it and it may save you some time too... How to set the Agent Proxy by PowerShell - would be a better title and probably help people find this! Get-Agent | Where {$_.DisplayName -match "contoso.com"} | foreach{$_.ProxingEnabled = $true;$_.ApplyChanges()} This will enable the Proxy Agent on all machines with contoso.com in the DisplayName. Nice

PowerShell to install SCOM agent...

Well I have been busy! Looking at all the PowerShell I've been pasting together from bits and pieces found around the web (Thanks Google!) it's no wonder that I've been AFK or more correctly AFB for a couple of months. But now back with some PowerShell script-lets under my belt and here's one of them. We have issues *cough* "firewall ports" accessing some of our servers in our remote data centres to push the SCOM agent. We were unable to solve the *cough* "firewall ports" issue so we decided to go round the issue and manually install the agent on each server. I wrote a PowerShell and VBS script to accomplish this.  Here there are.  Nothing fancy and I am sure that things could be done better however this is how we are acheiving bypassing our firewall....errr I mean resolved our issue. The install is silent so you may want to adjust the MSI line and remove /quiet and /qn to help with troubleshooting this script in your environment. Power

Exchange 2010 PowerShell frollicks

I've been busy working on troubleshooting some Exchange 2010 issues, well not really issues with Exchange but issues within our internal processes around Exchange 2010. One of these is how do we work with new starters and how do we process when an employee leaves? This raises a couple of interesting changes in how Exchange 2010 "does things" our old process of dealing with leavers just disabled the AD account, people no longer got email.  This doesn't work in Exchange 2010. I now use an email policy to change the leavers email address to something valid within Exchange however not valid outside, i.e. no MX record point to this domain name. This then leaves all the old emails still valid and assigned to the mailbox.  So I found some nifty (I think) PowerShell to remove all the SMTP addresses from the mailbox except the primary SMTP address. Here you go: # Use this to remove all SMTP email addresses from a mailbox # except for the primary $mailbox = Get-Ma

Exchange 2010 Delegates Redux

So it seems that I am not alone in having issues with migrated accounts, even the might Microsoft themselves have issues here!  This is good as it means they go out and write some mean PowerShell which we can all use! Exchange 2010 is stricter in how it deals with delegates, if the user account cannot be found in AD then Exchange will refuse to show any of the delegates this results in Outlook hanging and eventually timing out when a user attempts to look at the delegates configuration tab. Here's the link to clearing out your old delegates! http://blogs.msdn.com/b/emeamsgdev/archive/2012/08/31/powershell-remove-invalid-delegates-from-mailboxes.aspx This is a really nice and simple method of removing invalid delegates - the nice thing is it adds back all the correct delegates too!