0

Get Powershell Execution Policy on remote machines

Posted by Tao Yang on 27/07/2010 in PowerShell |

Today I’ve been asked how to inventory PowerShell execution policies on all servers in a domain. I originally thought I can ultilise RemoteIn as PowerShell V2 should be deployed on all servers. then I realised WSMan wasn’t configured on the srevers so I couldn’t use “New-PSSession” cmdlet… Therefore, I wrote a function called Get-RemoteExecutionPolicy.  It retrieves [...]

Tags: ,

0

Passed MCTS SCOM Exam (70-400) today!

Posted by Tao Yang on 23/07/2010 in Others |

Today I passed Microsoft exam “70-400 Microsoft System Center Operations Manager 2007, Configuring” with a score of 975/1000. The transcript indicated I answered one question wrong in relation to “Deploying and COnfiguring Management Packs”. I’m wondering which one I answered wrong… Overall, pretty easy exam. What’s next? Got spend some time to prepare SCCM exam!

Tags: ,

80

ENHANCED SCOM Alerts Notification Emails!

Posted by Tao Yang on 19/07/2010 in PowerShell, SCOM |

17/08/2012: The version 2 of this script has just been released: http://blog.tyang.org/2012/08/16/scom-enhanced-email-notification-script-version-2/ 29/01/2012: The command notification channel setup section of this blog has been updated. More details of the change can be found HERE: http://blog.tyang.org/2012/01/29/command-line-parameters-for-scom-command-notification-channel/ Please Note: This post and associated script has been updated on 30/09/2010. Even though SCOM is a great product, I personally believe [...]

Tags: , , ,

3

PowerShell Script: Mass-Mailer

Posted by Tao Yang on 08/07/2010 in PowerShell |

Today a colleague asked me to write a script to send out a email to a large group of people but have the phrase “Dear <person’s name”>” in the beginning of email body. I quickly wrote this script. Here are the steps you need to take before executing it: 1. Zip and place the Mass-Mailer [...]

Tags: , ,

0

How To Write to SCOM Operations Manager Event Log Using PowerShell and MOM.ScriptAPI

Posted by Tao Yang on 07/07/2010 in PowerShell, SCOM |

The following commands can be executed using the normal PowerShell console. SCOM PowerShell snapin is not required. $momapi = New-Object -comObject "MOM.ScriptAPI" $momapi.LogScriptEvent("test",9999,2,"this is a test")   This is the log:   Detailed documentation of MOM.ScriptAPI can be found on MSDN.

Tags: ,

4

Broken SCOM Web Console URLs?

Posted by Tao Yang on 06/07/2010 in SCOM |

I come across a situation where when i click on the web console URL from a SCOM notification email such as this one: http://<SCOM Web Server>/default.aspx?DisplayMode=Pivot&AlertID=%7b07aac5b0-4cf8-411f-b5a0-cb0075dc0f31%7d I get a HTTP 500 error: I had to change the URL from http://<SCOM Web Server>/default.aspx?DisplayMode=Pivot&AlertID=%7b07aac5b0-4cf8-411f-b5a0-cb0075dc0f31%7d to http://<SCOM Web Server>/default.aspx?DisplayMode=Pivot&AlertID={07aac5b0-4cf8-411f-b5a0-cb0075dc0f31} to make it work. It’s quiet painful as %7b [...]

Tags: , , ,

1

SCOM Console Crashes

Posted by Tao Yang on 06/07/2010 in SCOM |

When I connect SCOM console to one of my clients SCOM 2007 R2 environment, under Authoring Pane, if I change the display scope of Monitors or Rules to “View all target” and select everything: the console crashes. – Maybe there are too many objects for it to handle. After the crash, when I re-launch the [...]

Tags: ,

0

PowerShell Script: Test-SMTP

Posted by Tao Yang on 05/07/2010 in PowerShell |

I wrote this simple script last week to test SMTP server by sending a testing email. Usage: .\Test-SMTP.PS1 -smtp smtp.xxxx.com -port 25 -from test@xxxx.com -to recipient@xxxx.com If the email is successfully, the recipient will receive an email similar to this: The email contains the following information: Originating Computer: Where the script was run from SMTP [...]

Tags: ,

16

PowerShell Script: Setting NTFS Permissions in Bulk

Posted by Tao Yang on 01/07/2010 in PowerShell |

Today I wrote this PowerShell script to apply a same set of NTFS permission for a particular user or group to a list of folders. It reads the list of folders from a file that is specified from a parameter, apply the permission which is also specified  from parameters. The useage is as follow: .\BulkSet-NTFSPermissions.ps1 -FolderListFile x:\xxxx\xxxx.txt -SecIdentity [...]

Tags: ,

Copyright © 2010-2013 Tao Yang's System Management Blog All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.2, from BuyNowShop.com.