Zobrazují se příspěvky se štítkemSite. Zobrazit všechny příspěvky
Zobrazují se příspěvky se štítkemSite. Zobrazit všechny příspěvky

neděle 16. října 2011

Primarní networkadapter

get-wmiobject win32_networkadapter -filter "adaptertype like ‘%ethernet%’ AND Speed>0"
nebo
get-wmiobject win32_networkadapter -filter "netenabled=’true’"
get-wmiobject win32_networkadapterconfiguration -filter "IPEnabled=’True’"

pátek 9. září 2011

HOSTS

Function Get-HostsFile {

.SYNOPSIS

    Retrieves the contents of a hosts file on a specified system.

.DESCRIPTION

    Retrieves the contents of a hosts file on a specified system.

.PARAMETER ComputerName

    The computers to access.

.NOTES

    Name: Get-HostsFile

    Author: Boe Prox

    DateCreated: 15Mar2011

    1.1 - 2011-03-17 - Jason Archer

        Improved pipeline support (and fixed positional usage).

        Added custom object creation and incremental output (better performance and cleaner code).

        For local host, use local path.

        Added error messages for error conditions.

    1.0 - 2011-03-15 - Boe Prox

        Initial release.

.LINK

    http://boeprox.wordpress.com

.EXAMPLE

    Get-HostsFile "server1"

    Description

    -----------   

    Retrieves the contents of the hosts file on 'server1'.

#>

[CmdletBinding()]

Param(

    [Parameter(Position = 0, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)]

    [ValidateNotNull()]

    [string[]]$ComputerName = "localhost"

)

Begin {

    $PSBoundParameters.GetEnumerator() | Foreach-Object { 

        Write-Verbose "Parameter: $_"

    }

}

Process {

    Write-Verbose "Starting process of computers"

    ForEach ($c in $ComputerName ) {

        Write-Verbose "Testing connection of $c"

        If (Test-Connection -ComputerName $c -Quiet -Count 1) {

            Write-Verbose "Validating path to hosts file"

            if ($c -eq "localhost") {

                $root = "C:"

            } else {

                $root = "\\$c\C`$"

            }

            If (Test-Path "$root\Windows\system32\drivers\etc\hosts") {

                Switch -regex -file ("$root\Windows\system32\drivers\etc\hosts") {

                    "^#\w+" {

                    }

                    "^\d\w+" {

                        Write-Verbose "Adding IPV4 information to collection"

                        $new = $_.Split("") | Where-Object {$_ -ne ""}

                        If ($new[2] -eq $null) {

                            $notes = $null

                        } Else {

                            $notes = $new[2]

                        }

                        New-Object PSObject -Property @{

                            ComputerName = $c

                            IPV4 = $new[0]

                            IPV6 = $null

                            Hostname = $new[1]

                            Notes = $notes

                        }

                    }

                    Default {

                        If (!("\s+" -match $_ -OR $_.StartsWith("#"))) {

                            Write-Verbose "Adding IPV6 information to collection"

                            $new = $_.Split("") | ? {$_ -ne ""}

                            If ($new[2] -eq $null) {

                                $notes = $null

                            } Else {

                                $notes = $new[2]

                            }

                            New-Object PSObject -Property @{

                                ComputerName = $c

                                IPV4 = $null

                                IPV6 = $new[0]

                                Hostname = $new[1]

                                Notes = $notes

                            }

                        }

                    }                       

                }

            } ElseIf (Test-Path "$root\WinNT\system32\drivers\etc\hosts") {

                Switch -regex -file ("$root\WinNT\system32\drivers\etc\hosts") {

                    "^#\w+" {

                    }

                    "^\d\w+" {

                        Write-Verbose "Adding IPV4 information to collection"

                        $new = $_.Split("") | ? {$_ -ne ""}

                        If ($new[2] -eq $null) {

                            $notes = $null

                        } Else {

                            $notes = $new[2]

                        }

                        New-Object PSObject -Property @{

                            ComputerName = $c

                            IPV4 = $new[0]

                            IPV6 = $null

                            Hostname = $new[1]

                            Notes = $notes

                        }

                    }

                    Default {

                        If (!("\s+" -match $_ -OR $_.StartsWith("#"))) {

                            Write-Verbose "Adding IPV6 information to collection"

                            $new = $_.Split("") | ? {$_ -ne ""}

                            If ($new[2] -eq $null) {

                                $notes = $null

                            } Else {

                                $notes = $new[2]

                            }

                            New-Object PSObject -Property @{

                                ComputerName = $c

                                IPV4 = $null

                                IPV6 = $new[0]

                                Hostname = $new[1]

                                Notes = $notes

                            }

                        }

                    }                       

                }       

            } Else {

                ## TODO: Could use the properly localized path not found error

                Write-Error "Unable to locate host file on computer: $c"

            }

        } Else {

            ## TODO: Could use the properly localized can not locate host error

            Write-Error "Unable to locate computer: $c"   

        }

    }

}

}

pátek 10. června 2011

Vypnutí sitových adaptérú –různé způsoby

Další tip který vyšel na powertips

Ruzne zpusoby vypnuti network adapteru

GET-WMIOBJECT WIN32_NETWORKADAPTER | foreach { $_.Disable() }

Vypne všechny sitove  adaptersy - Physical, Logical, všechny a  GET-WMIOBJECT WIN32_NETWORKADAPTER | foreach { $_.Enable() }

všechny povolí

Filtr na fyzicke neboli where { $_.PhysicalAdapter –eq $TRUE}  a přikaz níže zakáže pouze fyzicke adaptery

GET-WMIOBJECT WIN32_NETWORKADAPTER | where { $_.PhysicalAdapter –eq $TRUE} | foreach { $_.Disable() }

Co se týče filtrace tak fantazii se meze nekladou…

neděle 5. června 2011

Restart sitovky

ipconfig /release

ipconfig /renew

arp -d *

nbtstat -R

nbtstat -RR

ipconfig /flushdns

ipconfig /registerdns

Spustitt powershell jako spravce

sobota 2. dubna 2011

Powershell a HTML 5

V jednom postu byl zminěn koncept integrace powershellu a HTML5,našel jsem tam mimo jine toto  

                   iex (New-Object Net.WebClient).DownloadString("http://bit.ly/e0Mw9w")  

vložte do powershellu a budete překvapeni stejně jako já.

pondělí 7. března 2011

Powershell a Nmap

Dnes jsem při upravování výstupu pro netstat v powershellu  narazil v jine souvislosti na zajimavý ps1 script pro nmap.

http://blogs.sans.org/windows-security/2009/06/11/powershell-script-to-parse-nmap-xml-output/

Jeden z možných vystupů ktere exportuje potom vypadá takto

nmap2

úterý 1. února 2011

Powershell rozdilný výstup auditu

Další variantou jak najednou ziskat zakladní informace o PC a dal s nimi pracovat je vystup ogv.

Spuštění potom můžeme řešit přes ps1,execute in powershell a –NOEXIT,nebo přes dejme tomu vytvořeni funkce a spouštění scriptu nazvem funkce až ho chceme spustit,nebo cestou ke scriptu.Každopaádně admin mode bych preferoval.Na videu je varianta kdy udělame ps1 script obsahujici jenom přikazy a spouštime zadáním cesty k němu.

Varianta dvě zkopirujeme do okna powershellu nasledující

function audit
{Get-process|select-object *|ogv 
Get-WmiObject Win32_Process | ForEach-Object { $ownerraw = $_.GetOwner(); $owner = '{0}\{1}' -f $ownerraw.domain, $ownerraw.user;  $_ | Add-Member NoteProperty Owner $owner -PassThru } | Select-Object Name, Owner|ogv
Get-service|select-object *|ogv
Get-WmiObject Win32_Service | sort -property Name | select Name, State, ProcessId, Description, StartName |ogv
get-wmiobject Win32_QuickFixEngineering | sort -property HotFixID | select -property HotFixID, Description|ogv
get-wmiobject Win32_Desktop | sort -property Name | select Name, BorderWidth, Caption, CoolSwitch, CursorBlinkRate, Description, DragFullWindows, GridGranularity, IconSpacing, IconTitleFaceName, IconTitleSize, IconTitleWrap, Pattern, ScreenSaverActive, ScreenSaverExecutable, ScreenSaverSecure, ScreenSaverTimeout, SettingID, Wallpaper, WallpaperStretched, WallpaperTiled|ogv
get-wmiobject Win32_Environment | sort -property Name | select -property Name, Status, SystemVariable, UserName|ogv
get-wmiobject Win32_StartupCommand | sort -property Name | select -property Name, Location, Command|ogv
get-wmiobject Win32_BootConfiguration | select -property Name, BootDirectory, Description, LastDrive, ScratchDirectory, TempDirectory|ogv
get-wmiobject Win32_LogonSession | sort -property LogonId | select -property LogonId, LoginType, AuthenticationPackage, Description, InstallDate, StartTime|ogv
Get-EventLog -list|ogv
get-wmiobject Win32_ComputerSystem | select Name, Description, @{Label="DNS Host Name"; Expression={$_.DNSHostName}}, Domain, Manufacturer, Model, @{Label="# Processors";Expression={$_.NumberOfProcessors}}, @{Label="System Type";Expression={$_.SystemType}}, @{Label="Physical Memory";Expression={"{0,12:n0} MB" -f ($_.TotalPhysicalMemory/1mb)}}|ogv
get-wmiobject Win32_BIOS | select Name, Manufacturer, ReleaseDate, SerialNumber|ogv
get-wmiobject Win32_PhysicalMemory | select @{Label="Device Location";Expression={$_.DeviceLocator}}, DataWidth, @{Label="Capacity";Expression={"{0,12:n0} MB" -f ($_.Capacity/1mb)}}, PartNumber, SerialNumber, Speed|ogv
get-wmiobject Win32_IP4RouteTable | sort Destination | select Destination, Mask, NextHop, Age |ogv
get-wmiobject Win32_NetworkAdapterConfiguration | sort Description | select Description, DHCPEnabled, IPEnabled, ServiceName, SettingID|ogv
get-wmiobject Win32_NetworkAdapter | sort Name | select Name, Manufacturer, PhysicalAdapter, ServiceName, PNPDeviceID|ogv
get-wmiobject Win32_NetworkClient | select Name, Description, Manufacturer, Status|ogv
get-wmiobject Win32_NetworkLoginProfile -filter "NOT Name LIKE 'NT AUTHORITY%'" | sort Name | select Name, Comment, NumberOfLogons, LastLogon|ogv
get-wmiobject Win32_NetworkProtocol | sort Name | select Name, Description|ogv
get-wmiobject Win32_Printer | sort Name | select Name, Comment, DriverName, Location, Network, PortName, ShareName|ogv
get-wmiobject Win32_PrintJob | select Document, @{Label="Status";Expression={$_.JobStatus}}, Owner, @{Label="Pages";Expression={$_.TotalPages}}, @{Label="Submitted";Expression={[System.Management.ManagementDateTimeconverter]::ToDateTime($_.TimeSubmitted)}}|ogv
get-wmiobject Win32_PrinterDriver | sort Name | select Name, DriverPath|ogv
get-wmiobject Win32_DiskPartition | sort Name | select Name, @{Label="Size";Expression={"{0,12:n0} MB" -f ($_.Size/1mb)}}, @{Label="Primary?";Expression={$_.PrimaryPartition}}, @{Label="Boot?";Expression={$_.BootPartition}}|ogv
get-wmiobject Win32_LogicalDisk | select Name, Description, FileSystem, @{Label="Size";Expression={"{0,12:n0} MB" -f ($_.Size/1mb)}}, @{Label="Free Space";Expression={"{0,12:n0} MB" -f ($_.FreeSpace/1mb)}}, ProviderName|ogv
get-wmiobject Win32_MappedLogicalDisk | select Name, Description, FileSystem, @{Label="Size";Expression={"{0,12:n0} MB" -f ($_.Size/1mb)}}, @{Label="Free Space";Expression={"{0,12:n0} MB" -f ($_.FreeSpace/1mb)}}, ProviderName|ogv
get-wmiobject Win32_DiskDrive | sort Name | select Name, Model, MediaType, InterfaceType, Partitions, @{Label="Size";Expression={"{0,12:n0} MB" -f ($_.Size/1mb)}}|ogv
get-wmiobject Win32_Share | sort Name | select Name, Path, Status|ogv
Get-Content $env:windir\windowsupdate.log -encoding utf8 | Where-Object { $_ -like '*successfully installed*'} | Foreach-Object { $infos = $_.Split("`t"); $result = @{}; $result.Date = [DateTime]$infos[6].Remove($infos[6].LastIndexOf(":")); $result.Product = $infos[-1].SubString($infos[-1].LastIndexOf(":")+2);  New-Object PSobject -property $result  }|ogv
Get-Alias | Group-Object Definition|ogv

Odentrujeme a napišeme audit.

Video

Audit2

Další variantou je použit Powershell ISE,pro něj addon ISE MENU CREATOR a viz. obrazky niže.

Nedefinujeme si klavesovou zkratku a pouštime potom prostě klavesovou zkratkou.

psisemenu

psise1

čtvrtek 11. listopadu 2010

Powershell networktools script

Pěkný scriptík powershellu z tipy dne na kterem zaroven budeme demonstrovat výstup ogv,viz formatování výstupu,roura, |ogv.

scriptík si pokud ho budeme použivat častěj rovnou upneme k powershellu a spouštime jako upnutý.

Viz pinned script

samozřejmě opět ůpravám se meze nekladou a výstup ogv nám v takovém připadě umožnuje vyhledávání a interaktivní filtraci v datech ktere jsme do výstupu poslali.

Obsah scriptu

function Return-DropDown {
$Choice = $DropDown.SelectedItem.ToString()
$Address = $Address.Text
#$Form.Close()
if ($choice -eq "ping")
{
write-host "PING $address"
Test-Connection $address | Out-gridview
write-host
}
elseif ($choice -eq "nslookup")
{
write-host "NSLOOKUP $address"
nslookup $address | Out-gridview
write-host
}
elseif ($choice -eq "BIOS")
{
write-host "BIOS of $address"
Get-WmiObject win32_bios -ComputerName $address | Out-gridview
write-host
}
elseif ($choice -eq "Services")
{
write-host "Services of $address"
Get-WmiObject win32_service -ComputerName $address | Out-gridview
write-host
}
elseif ($choice -eq "Programs")
{
write-host "Programs installed on $address"
Get-WmiObject win32_product -ComputerName $address | Out-gridview
write-host
}
elseif ($choice -eq "RemoteUninstall")
{
$objForm = New-Object System.Windows.Forms.Form
$objForm.Text = "Data Entry Form"
$objForm.Size = New-Object System.Drawing.Size(300,200)
$objForm.StartPosition = "CenterScreen"

$objForm.KeyPreview = $True
$objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter")
{$y=$objTextBox.Text;$objForm.Close()}})
$objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape")
{$objForm.Close()}})

$OKButton = New-Object System.Windows.Forms.Button
$OKButton.Location = New-Object System.Drawing.Size(75,120)
$OKButton.Size = New-Object System.Drawing.Size(75,23)
$OKButton.Text = "OK"
$OKButton.Add_Click({$location=$objTextBox.Text;$objForm.Close()})
$objForm.Controls.Add($OKButton)

$CancelButton = New-Object System.Windows.Forms.Button
$CancelButton.Location = New-Object System.Drawing.Size(150,120)
$CancelButton.Size = New-Object System.Drawing.Size(75,23)
$CancelButton.Text = "Cancel"
$CancelButton.Add_Click({$objForm.Close()})
$objForm.Controls.Add($CancelButton)

$objLabel = New-Object System.Windows.Forms.Label
$objLabel.Location = New-Object System.Drawing.Size(10,20)
$objLabel.Size = New-Object System.Drawing.Size(280,20)
$objLabel.Text = "Name of the application to be uninstalled:"
$objForm.Controls.Add($objLabel)

$objLabel2 = New-Object System.Windows.Forms.Label
$objLabel2.Location = New-Object System.Drawing.Size(10,50)
$objLabel2.Size = New-Object System.Drawing.Size(190,20)
$objLabel2.Text = "Don't be too generic!"
$objForm.Controls.Add($objLabel2)

$objTextBox = New-Object System.Windows.Forms.TextBox
$objTextBox.Location = New-Object System.Drawing.Size(10,80)
$objTextBox.Size = New-Object System.Drawing.Size(260,20)
$objForm.Controls.Add($objTextBox)

$objForm.Topmost = $True

$objForm.Add_Shown({$objForm.Activate()})
[void] $objForm.ShowDialog()

Try{
$app = Get-WmiObject win32_product -ComputerName $Address -ErrorAction SilentlyContinue | Where-Object {$_.name -match $location}
$returnvalue = $app.uninstall() | Select-Object -Property returnvalue -ErrorAction SilentlyContinue

if($returnvalue.returnvalue -eq "0")
{[Windows.Forms.MessageBox]::Show("Installation was successful!")}

else
{[Windows.Forms.MessageBox]::Show("Installation was not successful!")}}

Catch{
if($error[0] -match "The RPC server is unavailable" -or $error[0] -match "null-valued"){
[Windows.Forms.MessageBox]::Show("Computer is unreachable, name is invalid or application does not exist.")}}
}
elseif ($choice -eq "RemoteInstall")
{

$objForm = New-Object System.Windows.Forms.Form
$objForm.Text = "Data Entry Form"
$objForm.Size = New-Object System.Drawing.Size(300,200)
$objForm.StartPosition = "CenterScreen"

$objForm.KeyPreview = $True
$objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter")
{$y=$objTextBox.Text;$objForm.Close()}})
$objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape")
{$objForm.Close()}})

$OKButton = New-Object System.Windows.Forms.Button
$OKButton.Location = New-Object System.Drawing.Size(75,120)
$OKButton.Size = New-Object System.Drawing.Size(75,23)
$OKButton.Text = "OK"
$OKButton.Add_Click({$location=$objTextBox.Text;$objForm.Close()})
$objForm.Controls.Add($OKButton)

$CancelButton = New-Object System.Windows.Forms.Button
$CancelButton.Location = New-Object System.Drawing.Size(150,120)
$CancelButton.Size = New-Object System.Drawing.Size(75,23)
$CancelButton.Text = "Cancel"
$CancelButton.Add_Click({$objForm.Close()})
$objForm.Controls.Add($CancelButton)

$objLabel = New-Object System.Windows.Forms.Label
$objLabel.Location = New-Object System.Drawing.Size(10,20)
$objLabel.Size = New-Object System.Drawing.Size(280,20)
$objLabel.Text = "UNC path for the application to be installed:"
$objForm.Controls.Add($objLabel)

$objLabel2 = New-Object System.Windows.Forms.Label
$objLabel2.Location = New-Object System.Drawing.Size(10,50)
$objLabel2.Size = New-Object System.Drawing.Size(190,20)
$objLabel2.Text = "Eg: \\computername\c$\firefox.msi"
$objForm.Controls.Add($objLabel2)

$objTextBox = New-Object System.Windows.Forms.TextBox
$objTextBox.Location = New-Object System.Drawing.Size(10,80)
$objTextBox.Size = New-Object System.Drawing.Size(260,20)
$objForm.Controls.Add($objTextBox)

$objForm.Topmost = $True

$objForm.Add_Shown({$objForm.Activate()})
[void] $objForm.ShowDialog()

Try{
$returnvalue = (Get-WmiObject -ComputerName $Address -List -ErrorAction SilentlyContinue | Where-Object -FilterScript {$_.Name -eq "win32_product"}).install($location) | Select-Object -Property returnvalue

if($returnvalue.returnvalue -eq "0")
{[Windows.Forms.MessageBox]::Show("Installation was successful!")}

else
{[Windows.Forms.MessageBox]::Show("Installation was not successful!")}
}
Catch{
if($error[0] -match "The RPC server is unavailable" -or $error[0] -match "null-valued"){
[Windows.Forms.MessageBox]::Show("Computer is unreachable, name is invalid or application does not exist.")}}

}
elseif ($Choice -eq "MapNetworkDrive")
{

$objForm = New-Object System.Windows.Forms.Form
$objForm.Text = "Data Entry Form"
$objForm.Size = New-Object System.Drawing.Size(300,200)
$objForm.StartPosition = "CenterScreen"

$objForm.KeyPreview = $True
$objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter")
{$y=$objTextBox.Text;$objForm.Close()}})
$objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape")
{$objForm.Close()}})

$OKButton = New-Object System.Windows.Forms.Button
$OKButton.Location = New-Object System.Drawing.Size(75,120)
$OKButton.Size = New-Object System.Drawing.Size(75,23)
$OKButton.Text = "OK"
$OKButton.Add_Click({$y=$objTextBox.Text;$objForm.Close()})
$objForm.Controls.Add($OKButton)

$CancelButton = New-Object System.Windows.Forms.Button
$CancelButton.Location = New-Object System.Drawing.Size(150,120)
$CancelButton.Size = New-Object System.Drawing.Size(75,23)
$CancelButton.Text = "Cancel"
$CancelButton.Add_Click({$objForm.Close()})
$objForm.Controls.Add($CancelButton)

$objLabel = New-Object System.Windows.Forms.Label
$objLabel.Location = New-Object System.Drawing.Size(10,20)
$objLabel.Size = New-Object System.Drawing.Size(280,20)
$objLabel.Text = "Letter of new Network Drive:"
$objForm.Controls.Add($objLabel)

$objTextBox = New-Object System.Windows.Forms.TextBox
$objTextBox.Location = New-Object System.Drawing.Size(10,40)
$objTextBox.Size = New-Object System.Drawing.Size(260,20)
$objForm.Controls.Add($objTextBox)

$objForm.Topmost = $True

$objForm.Add_Shown({$objForm.Activate()})
[void] $objForm.ShowDialog()

$x = $y

$objTextBox.clear()
$objLabel.Text = "UNC:"
$objForm.Controls.Add($objLabel)
$objForm.Controls.Add($objTextBox)
$objForm.Add_Shown({$objForm.Activate()})
[void] $objForm.ShowDialog()

$map = New-Object -ComObject wscript.network
if($x -match ":"){Try{$map.MapNetworkDrive($x,$y)}Catch{if($error[0] -match "The local device"){[Windows.Forms.MessageBox]::Show("The local device is already in use.")}else{[Windows.Forms.MessageBox]::Show("The network name cannot be found.")}}}
else
{Try{$x = $x+":"; $map.MapNetworkDrive($x,$y)}Catch{if($error[0] -match "The local device"){[Windows.Forms.MessageBox]::Show("The local device is already in use.")}else{[Windows.Forms.MessageBox]::Show("The network name cannot be found.")}}}

}
}

[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")

$Form = New-Object System.Windows.Forms.Form

$Form.width = 300
$Form.height = 250
$Form.Text = "Network Tools"
$Form.maximumsize = New-Object System.Drawing.Size(300,250)
$Form.startposition = "centerscreen"
$Form.KeyPreview = $True
$Form.Add_KeyDown({if ($_.KeyCode -eq "Enter")
{return-dropdown}})
$Form.Add_KeyDown({if ($_.KeyCode -eq "Escape")
{$Form.Close()}})

$DropDown = new-object System.Windows.Forms.ComboBox
$DropDown.Location = new-object System.Drawing.Size(100,10)
$DropDown.Size = new-object System.Drawing.Size(130,30)

ForEach ($Item in $DropDownArray) {
$DropDown.Items.Add($Item)
}

$Form.Controls.Add($DropDown)

$DropDownLabel = new-object System.Windows.Forms.Label
$DropDownLabel.Location = new-object System.Drawing.Size(10,10)
$DropDownLabel.size = new-object System.Drawing.Size(100,20)
$DropDownLabel.Text = "Command"
$Form.Controls.Add($DropDownLabel)

$Button = new-object System.Windows.Forms.Button
$Button.Location = new-object System.Drawing.Size(100,150)
$Button.Size = new-object System.Drawing.Size(100,20)
$Button.Text = "OK"
$Button.Add_Click({Return-DropDown})
$form.Controls.Add($Button)

$address = new-object System.Windows.Forms.TextBox
$address.Location = new-object System.Drawing.Size(100,100)
$address.Size = new-object System.Drawing.Size(100,20)

$Form.Controls.Add($address)

$addresslabel = new-object System.Windows.Forms.Label
$addresslabel.Location = new-object System.Drawing.Size(10,100)
$addresslabel.size = new-object System.Drawing.Size(100,20)
$addresslabel.Text = "Computer"
$Form.Controls.Add($addresslabel)

$authorlabel = new-object System.Windows.Forms.Label
$authorlabel.Location = new-object System.Drawing.Size(160,185)
$authorlabel.size = new-object System.Drawing.Size(200,15)
$authorlabel.Text = "Powered by F. Binotto."
$Form.Controls.Add($authorlabel)

$Form.Add_Shown({$Form.Activate()})
$Form.ShowDialog()

Video