search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Windows Powershell, Windows Server | No Comment | 1,913 views | 16/08/2009 20:11

I wrote this to get some information from Active Directory. I think it is pretty good for Active Directory management.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function Get-ADInfo
{
    $ADDomain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
    $ADDomainName = $ADDomain.Name
    $Netbios = $ADDomain.Name.Split(".")[0].ToUpper()
    $ADServer = ($ADDomain.InfrastructureRoleOwner.Name.Split(".")[0])
    $FQDN = "DC=" + $ADDomain.Name -replace("\.",",DC=")
 
    $Results = New-Object Psobject
    $Results | Add-Member Noteproperty Domain $ADDomainName
    $Results | Add-Member Noteproperty FQDN $FQDN
    $Results | Add-Member Noteproperty Server $ADServer
    $Results | Add-Member Noteproperty Netbios $Netbios
    Write-Output $Results
}

Usage sample:

$FQDN = (Get-ADInfo).FQDN
$Netbios = (Get-ADInfo).Netbios

As you see, I used “Add-Member” to help you to get what you really need.


Posted in Hayattan | No Comment | 1,779 views | 09/08/2009 19:58
Go get your guns and your switchblade knives and cut it up
And kill the ones who speak if they speak of us
cause they’ll never really tame us
[x2]

You’re so outa’ control, You’re so outa’ control
you gotta’ be more in control, you gotta’ be more in control
You’re so outa’ control, You’re so outa’ control
be more in control, be more in control

Go get your guns and your switchblade knives and cut it up
And watch the flash of the blade as it grinds right to our bones without a sound
So cut it like a DJ, cut it while it’s hot
And cut it while you still remember
how all the DJs cut, how all the DJs cut, cut me a slice of your tracks now

You’re so outa’ control, You’re so outa’ control
you gotta’ be more in control, you gotta’ be more in control
You’re so outa’ control, You’re so outa’ control
be more in control, be more in control
[x2]

Go get your guns and your switchblade knives and cut it up
And kill the ones who speak if they speak of us
cause they’ll never really tame us
[x3]

You’re so outa’ control, You’re so outa’ control
you gotta’ be more in control, you gotta’ be more in control
You’re so outa’ control, You’re so outa’ control
be more in control, be more in control
[x2]

I love this song..