Few PowerShell Functions Around Windows Security

As parts of the PowerShell project that I’m currently working on, with the help with other people’s contribution in various forums and blogs, I have produced few PowerShell functions around Windows security: Validate Credential Usage: Get Current User Name Usage: Check If Current User has Local Admin Rights Usage: Check if a user is a member of a group Usage: Get Local Machine’s SID Usage: Check If an account is a domain account (as opposed to local account) Note: This function also requires the Get-LocalMachineSID function listed above Usage:

My Observation on SCCM Clients BITS Settings

Yesterday, while we were reviewing the SCCM (2007 R3) client BITS settings at work, we (my team) have some interesting findings with SCCM client’s BITS settings. We found when the BITS bandwidth throttling settings are configured for a SCCM primary site. SCCM clients get the policy and write the settings into Windows local policy: SCCM Computer Client Agent BITS Settings: BITS Settings from SCCM Client’s Windows local policy (Local Policy –>Computer Configuration –>Administrative Templates –>Network –>Background Intelligent Transfer Service (BITS) –>Limit the maximum network bandwidth for BITS background transfers): As you can see, the SCCM site setting is identical to

Changing Display Language on Windows 7 Home and Professional Editions

I bought a laptop for other family members yesterday, it comes with Windows 7 Home Premium. I needed to change the display language from English to Chinese because the main user of this laptop does not speak English. I thought it was a no brainer as I’ve done it before, all I had to do was to load another language pack in “Regional and Language” in Control Panel. However, I was wrong. apparently this function is available in Windows 7 Ultimate and Enterprise editions. I didn’t really want to use Windows Anytime Upgrade to upgrade it to Ultimate just so

Failed to run PowerShell script via Task Scheduler on a 64 bit Windows

I came across a situation the other day that on a Windows Server 2008 R2 box, when I created a Scheduled Task to run a Powershell script, it runs OK using “C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe” (64 bit PowerShell) but fails with error code (0x1) if I use “C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Powershell.exe” (32 bit Powershell) I have done the following steps to help me troubleshoot the issue. 1. I have changed the scheduled task to “Run only when user is logged on” so a command prompt was shown when the task runs. I screen captured the output: It looks like the PowerShell Execution Policy is preventing the

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

%d bloggers like this: