Skip to main content

Posts

Showing posts from May, 2011

Managed Deletion Protection on OUs, User, and Group objects with PowerShell

Below is a working PowerShell function that will help you enable/disable Deletion Protection on organizational units, user and group objects.  I included online help in this one so just dot source it or put it in a module to use it.  Once loaded, just type Get-Help Set-Deletion Protection –Full to see the entire help file and examples on how to use it. There are actually two functions here.  The first supports the second. <# .SYNOPSIS Confirms if a module is available. .DESCRIPTION Confirms if the provided parameter is available on the local client.     .PARAMETER ModuleName   The name of the module who’s presence is being checked.         .EXAMPLE    Confirm-Module ActiveDirectory            Checks to see if the ActiveDirectory module is     present on the local machine      ...

What is the actual initial file size of a dynamically expanding VHD?

In class I miss quoted Microsoft.  In Microsoft’s’ documentation, the actual wording is “the initial size of the .vhd file is only about 3 MB.”  So I created 4 dynamically expanding VHD files.  Their maximum sizes are 1GB, 10GB, 100GB, and 2TB.  Below is a screen shot of their initial sizes:

Configuring VLANs in Hyper-V

The VLAN ID feature in Hyper-V allows you to support 802.1Q standards for VLAN Tagging. In short, it allows you to isolate hosts on the same physical network.   In the Hyper-V world, we can utilize VLAN IDs in two ways. We can isolate certain computers on the network or we can isolate VMs inside our hosts. First and foremost, your routers need to support and be configured with the VLAN identifiers. For the External and Internal virtual network configurations, you can isolate traffic to and from your host using a VLAN ID. You can do this for management purposes. As a result, only data tagged for the host VLAN will make it to your VMs. The other method is to configure the NICs of the VMs with a VLAN ID themselves. This is available in all three virtual network profiles. When used with the External profile, your VMs will only be able to communicate with VMs and physical host on your network with a matching VLAN ID.   Here is how you configure a virtual network with a VLAN...

PowerShell Switch Parameter

One of the things that I’ve noticed in the PowerShell cmdlets are parameters without values.  These switches alter the way that the cmdlet functions without providing any input.  This is the switch parameter functionality.  Here is how it works.  When you declare a parameter as a switch parameter, its value is set to $False.  Using what ever logic you like, you can test to see if the condition became $True.  That means the user executed the function and specified the switch.  Let’s look at a simple example: function Test1 ([ Int32 ] $Value , [ switch ] $Add5 ){ if ( $Add5 -eq $True ) { $Value += 5 } Write-Host $Value } In the function Test1, we have two values, a number and the switch parameter called $Add5.  This function is simple.  You provide it a number and it displays the number.  If you add the –Add5 parameter, it adds 5 to the number you provided.  Here is an example: PS C:\Users\Jason> test1 5 5...

How many processors can Windows Serer 2008 R2 support?

According to Microsoft , Windows Server 2008 R2 can support up to 256 logical processors.  Just to get a visualization, I found an image of task manager with this configuration. Here is the next question.  What application can cause such a high processor utilization?