Month: November 2013

  • Alcohol calculator

    Calculate the amount of pure alchohol in litre you consume per year. All forms needs to be filled in. [void][reflection.assembly]::LoadWithPartialName(“System.Windows.Forms”) $Form = New-Object ‘System.Windows.Forms.Form’ $Calculate = { [double]$Result = 0 [double]$beer = $BeerTextBox.Text [double]$wwine = $WhiteWineTextBox.Text [double]$rwine = $RedWineTextBox.Text [double]$spirit = $SpiritTextBox.Text $result = ($beer*0.5*0.05)+($wwine*0.7*0.08)+($rwine*0.7*0.13)+($spirit*0.7*0.4) $ResultBox.Text = $Result } $Form.Size = “300,300” $BeerLabel = New-Object…

  • Get startpage

    Invent startpage set in IE for XP and Windows7 clients. Needs a list of computers and collects the startpage in a CSV file. [cmdletbinding()] Param( $Computers, $output, $Progress, [Switch]$Loop ) $ErrorActionPreference = “SilentlyContinue” If(Test-Path -Path $Computers -PathType Leaf){ [Array]$Script:computers = Get-Content $Computers } $ComputerCount = $Computers.Count $Script:Database = @{} Function Get-Startpage{ Param( $output, $Progress )…

  • Access CSC

    this is used to quickly gain access to a users client side cache without ruining sync. Used for backup issues and other stuff. $comp = ‘computer1’ # Replace with computer $FQDN = ‘your.domain.com’ # Replace with FQDN $UserID = ‘user1’ # Replace with the useraccount to gain access Function ConvertTo‐Base64($string) { $bytes = [System.Text.Encoding]::Unicode.GetBytes($string); $encoded…

  • Add users as local admin on select computers

    This is used to add users as local admin on a select group of clients. Needs a input file specified or default to input.txt in same folder. It converts Administrator SID to friendlyname to account for things such as foreign characters. It uses WMI to invoke a client side script to be run under admin…