Powershell: Prevent Users To View and Change Input or Config Files That Are Used by a Script
Often, I use .xml or .ini files to store settings that a PowerShell script uses. When I distribute my scripts to end users, sometimes, I want to make sure users cannot manually view or change the content of these config files. Below is what I did to achieve the goal: Create a password protected zip [...]
Using SCOM PowerShell Snap-in and SDK client with a PowerShell Remote Session
Recently, I’ve been working on a utility based on PowerShell scripts using WinForms GUI to perform some SCOM tasks (i.e. create maintenance window, approve manually installed agents, adding network devices, etc.). Since this script is going to be widely used in the organisation when it’s completed, I’ve always kept in mind that when users run [...]
Disabling Auto Discovery in SCDPM 2010
System Center Data Protection Manager is not something I normally play with. Recently, I’ve been dobbed in to troubleshoot an issue with remote sites network performance at work and the issue ended up was caused by Auto Discovery in DPM 2010. So basically, DPM has this built-in function called “Auto Discovery” which queries the domain [...]
PowerShell Script: Remove All Packages From A SCCM Distribution Point
Often, SCCM administrators found packages still assigned to distribution points that no longer exist. There are scripts available to remove these “orphaned” package distributions via SMS Provider. i.e. This one called DPClean.vbs from TechNet Blog: Removing a retired DP from all your packages. It was written for SMS 2003. I’m not sure if SMS 2003 [...]
PowerShell Script: Get SCCM Management Point server name from AD
I wrote this function as a part of a script that I’m working on. it searches AD for the management point server name for a particular SCCM site: Note: This function uses another function called Get-AllDomains, which I’ve blogged before here: http://blog.tyang.org/2011/08/05/powershell-function-get-alldomains-in-a-forest/ So make sure you include BOTH functions in your script.
PowerShell Script: Calculate First and Last IP of a Subnet
I just wrote this script to calculate the first and last IP of a subnet based on any given IP (within the subnet) and it’s subnet mask: Syntax: .\Get-NetworkStartEndAddress.ps1 “IP address” “Subnet Mask” Download here: Get-NetworkStartEndAddress.ps1
SCCM Health Check Script Updated: Version 3.5
I have just updated the SCCM Health Check Script to from version 3.3 to 3.5 Version 3.4 was finished a while back but I never got time to publish it in this blog. I only emailed 3.4 to few people who contacted me from my blog. Now that I’ve updated it again to 3.5, I [...]
PowerShell Script: Convert To Local Time From UTC
I wrote this function in the script from my previous post “SCOM MP Authoring Example: Generate alerts based on entries from SQL Database (Part 2 of 2)”. It comes handy sometimes so I thought I’ll blog it separately as well. In PowerShell Datetime object, there is a ToUniversalTime() method that converts local time to UTC [...]
SCOM: Using PowerShell to update SMTP server address in SMTP notification Channels
I’ve been asked a question on how to bulk update SMTP server addresses in SMTP notification channels using PowerShell. Here’s the script to run in OpsMgr Command Shell: