Search This Blog

Sunday 19 August 2007

Blogger Doesn't Do Code Redux

Apparently using the PRE tag should work. Let's see.

$Username = "USERID"
$DS_Search = new-object System.DirectoryServices.DirectorySearcher
$DS_Search.Filter="(sAMAccountName=$Username)"
$User=$DS_Search.FindOne()
foreach ($item in $User.Properties["memberof"]) {
if ($item -match "Domain Administrators") {
"$Username is a Domain Administrator"
}
}

Well what do you know - it works. Time to fix all the old posts now...

No comments: