Get SCCM site roles using Powershell

You can run the following on the site server to find out the servers holding each SCCM role: $SMSProvider = get-wmiobject sms_providerlocation -namespace root\sms -filter “ProviderForLocalSite = True” $SiteCode = $SMSProvider.SiteCode $ProviderMachine = $SMSProvider.Machine get-wmiobject -Class SMS_SystemResourceList -NameSpace root\sms\site_$SiteCode -Computername $ProviderMachine | format-list RoleName,ServerRemoteName,SiteCode

Haven’t been able to blog lately

I haven’t been able to blog lately. I have started my new job as a SCCM specialist. I know this blog is mainly focusing SCCM, SCOM and Powershell and so far I have not posted anything SCCM related. So hopefully I will start posting more SCCM related topics.

Updated: Enhanced SCOM Alerts Notification Emails script

I have previously posted the Enhanced SCOM Alerts Notification email scripts back in July 2010. I’d like to thank everyone who have tested it and provided feedbacks. You made me aware there are few issues and bugs with the script. Since I have just resigned and my new job won’t start in few weeks time, I have spent the last couple of days updating the script. This is what I’ve done: 1. Removed GetNetbiosName function Few people advised there are often this function running into errors.  I realised I originally wrote this function because one of my previous employers required

PowerShell Function: Validate Subnet Mask

This is a function I wrote couple of days ago for the Windows Build Scripts which I blogged yesterday. I think it is pretty cool so I’d like to blog this function individually: It checks the following: – if subnet mask is in numeric and consists 4 sections separated by “.” – If each section is ranged between 0 and 255 – convert it to binary format and make sure it is a valid subnet mask (first part consists all “1”s and second part consists all “0”s). So here’s the usage: This function can be downloaded HERE

PowerShell: OS Build Script for Windows Server 2008, 2008 R2 and Windows 7

Background: Around 2 years ago, I originally written a set of script to configure newly built Windows 2008 servers using PowerShell when my previous employer started to deploy their very first Windows 2008 server. These set of scripts were the very first scripts I’ve ever written in PowerShell. Over the time, I have updated them many times and now they also support Windows 2008 R2 and Windows 7. You can download the scripts HERE. Purpose: This set of build script is designed to automate the process of building a Windows server (version 2008 and above). It is designed for environments

Mailbox Archive Tool for Microsoft Exchange Servers

This is another GUI tool based on PowerShell I’ve written in the past. A company I worked for needed a tool for Service Desk people to archive users’ mailboxes into PST file. I’m not an Exchange engineer, they told me they used to use ExMerge in Exchange 2003 environment but since upgraded to Exchange 2007,  they were no longer able to do so under a GUI interface because ExMerge was replaced by a PowerShell cmdlet “Export-MailBox”. So I wrote this mailbox archive tool. it basically archives a mailbox into a PST file (with the option to whether delete mailbox after

Balancing Number of SCOM Agent Per Management Server using PowerShell

I came across a situation yesterday in one of the clients SCOM environment: They currently have a single SCOM management group setup as the following: all SCOM management servers (including the root management server) are located on the same segment of the network. internal agents (from the same forest) are reporting to management server #1 and #2. External agents (from different forests) are reporting to management server #3 and #4 through firewall. SCOM is not integrated to AD – Therefore primary and failover management servers are not automatically assigned to agents. I needed to achieve: agents are evenly distributed to

Passed MCTS SCCM exam yesterday

In the last couple of weeks, I’ve been refreshing my memory on SCCM since I haven’t worked on it for almost 4 month… Yesterday, I passed Microsoft 70-401 (SCCM) exam with the score of 976/1000. Pretty disappointed that didn’t get 1000 though… Oh well, there are some SCCM work coming up at work, can’t wait to get started!

Get Powershell Execution Policy on remote machines

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 the setting from the remote registry. The usage is: Get-RemoteExecutionPolicy <machine name>.

Passed MCTS SCOM Exam (70-400) today!

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!

%d bloggers like this: