Posts RSS Comments RSS 253 Posts and 411 Comments till now

Archive for the 'All' Category

Started a new series on SearchWindowsServer

I started a monthly column on http://searchwindowsserver.techtarget.com

Here is the first article: What makes Windows PowerShell unique?

Powershell v2 Download

Click to Download

Cheesy Christmas Tree Script

I had a few minutes tonight so I decided to have a little fun. I am stopping now before this becomes a new project 😉

Below is the code:

$colors = "cyan","Green","Yellow","Red","magenta","white"

Clear-Host

Write-Host

while($true)
{
    $oldpos = $host.ui.RawUI.CursorPosition
    Write-Host "        *" -ForegroundColor ($colors | get-random)

    # Row One
    Write-Host "       *" -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"        -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"        -ForegroundColor ($colors | get-random)

    # Row Two
    Write-Host "      *" -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random)

    # Row Three
    Write-Host "     *"  -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random)

    # Row Four
    Write-Host "    *"   -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random)

    # Row Five
    Write-Host "   *"    -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random)

    # Row Six
    Write-Host "  *"     -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random)

    # Stump
    Write-Host "       ***       " -fore DarkGreen
    Write-Host "       ***       " -fore DarkGreen

    $host.ui.RawUI.CursorPosition = $oldpos
    sleep .40
}

Write-Host

IN Progress: AD replication test script

Almost done with my new and improved AD replication script. If you are interested in giving it a shot drop me a line via the contact form or just leave a comment.

NOTE: It does make a canary change in AD. It sets the value of wWWHomePage on the Users container to a datetime stamp.

I will be a guest on Powerscripting Podcast (come listen live)

Details here:
Powerscripting Podcast

BSonPosh Module goes Beta (2)

I released a private beta a little bit back but this is an open beta (and there is a whole bunch more in it.)

How to Install
————–

  • Download: BSonPosh Powershell Module
  • Extract ZIP to your module folder $Env:PSModulePath. I found it better use the global module path (although it requires admin rights.)
  • Import-module bsonposh

Report bugs (please)
—————————

  • via Discussions
  • via Wave located here http://bsonposh.com/bug-report-page ( requires Google wave account )
  • via Contact form http://bsonposh.com/contact-me

A little taste of the 88 cmdlets
——————————

  • Get-CPU
  • Get-DiskSpace
  • Get-LocalGroupMember
  • Get-OSVersion
  • Get-RebootTime
  • Get-Uptime
  • Get-WindowsUpdate
  • Get-SysInternals
  • Get-Routetable

Even added a whole suite of Registry functions
———————————————

  • Get-RegistryHive
  • Get/Set/New-RegistryKey
  • Get/Set/New-RegistryValue
  • Remove-RegistryKey
  • Remove-RegistryValue
  • Test-RegistryKey
  • Test-RegistryValue

Hope you find use for these and please provide feedback. Thanks!

Powershell v2 is yours!

Windows Management Framework, which includes Windows PowerShell 2.0, WinRM 2.0, and BITS 4.0, was officially released to the world this morning. IT Professionals can now easily manage their Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 machines through PowerShell remoting.

Click this link for the list of packages for each OS: Description of the Windows Management Framework on Windows XP, Windows Server 2003, Windows Vista, and Windows Server 2008

Powershell v2 Officially GA… XP/2003 just around the corner.

Well… yesterday was the day! With the GA (general availability) of Windows 7 Powershell v2 became official. To celebrate the Powerscripting Podcast guys had a launch party and it was awesome. The Distinguished Engineer formally known as Snover was there and let us in on some juicy info. I strongly recommend downloading the podcast when it become available… good stuff!

p.s. Look for XP/2003 release of Powershell v2 in the coming weeks (yes.. I said WEEKS!!!)

BSonPosh Module goes beta

I am releasing a beta of my BSonPosh module. This is a early release and may have some bugs that need to be tweaked. It may also be missing some functionality and help files. If you would like participate in the beta send me an email via my contact form and I will shoot you a copy.

I am looking for any feedback. Specifically if you think any thing is missing 🙂

Here is a list of the functions/cmdlets provided by the module:

—————————————-
ConvertTO-DistinguishedName
ConvertTo-DNSName
ConvertTo-Name
ConvertTo-NetbiosName
ConvertTo-Sid
ConvertTo-UACFLag
Format-XML
Get-ADACL
Get-ADSchema
Get-ADSchemaClass
Get-ADSchemaProperty
Get-Assemblies
Get-BSonPosh
Get-DC
Get-DCConnectionObject
Get-Forest
Get-RebootTime
Get-Routetable
Get-SiteLink
Get-SysInternals
Get-TraceFile
Get-Uptime
Get-WindowsUpdate
Import-BSonPosh
Invoke-uac
Invoke-WhoAmI
New-ADACE
Resolve-Host
Select-LargeFiles
Set-ADACL
Set-DCConnectionOption
Set-SiteLink
Start-TS
Test-ADReplication
Test-Host
Test-LdapFilter
Trace-LDAP
update-Gac

List of All Domain Controllers in Your Domain

The Scripting guys have a post over here: Hey, Scripting Guy! Can I Obtain a List of All Domain Controllers in My Domain?

That is one way but IMO this is easier and more DC specific data

[DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().DomainControllers

On a side note: The AD Replication Module will have a cmdlet so you will be able to just do this:

Get-ADRDomainController -domain MyDomain

« Prev - Next »