Skip to content

Instantly share code, notes, and snippets.

View robie2011's full-sized avatar

Robert Rajakone robie2011

View GitHub Profile
@robie2011
robie2011 / shoMyTeamViewerSession.ps1
Created April 30, 2014 13:46
Powershell RegEx Examples
# File: showMyTeamviewerSession.ps1
# Date: 01.03.2013
# Author: Robert Rajakone
# URL: http://tech.robie.ch
# Description: This script extract Teamviewer session connection information from logfile
write-host "Today's Teamviewer Sessions"
# Der Regex-Ausdruck für Extraktion der Daten
$RegexExp = "(\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}\.\d{3})\s*(\d+)\s*(\d+)\s*([\w\d!]*)\s*(.*$)"
set file="%temp%\locale_de-CH.xml"
echo ^<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend"^> ^<!--User List--^> ^<gs:UserList^> ^<gs:User UserID="Current"/^> ^</gs:UserList^> ^<!--User Locale--^> ^<gs:UserLocale^> ^<gs:Locale Name="de-CH" SetAsCurrent="true"/^> ^</gs:UserLocale^>^</gs:GlobalizationServices^>>%file%
control intl.cpl,, /f:%file%
del %file%
@robie2011
robie2011 / Install-SQL2008R2.ps1
Created April 30, 2014 13:52
Powershell Installation Scripts
<#
.SYNOPSIS
Install SQL2008R2 Server
.DESCRIPTION
use Switches to install SQL Server Features easy and silently
.PARAMETER instanceName
Name of SQL Instance
.PARAMETER useGerman
Install German Version of SQL Server (Managementstudio)
.PARAMETER installOnly
@robie2011
robie2011 / diskpart.ps1
Created April 30, 2014 13:57
Powershell Systemadmin Tasks
$DDrive = GWMI -CL Win32_LogicalDisk | Where {$_.DeviceId -Eq "D:"}
if($DDrive){
Echo "ERROR: Es existiert bereits ein D-Laufwerk. Vorgang wird abgebrochen."
Exit
}
$drive = GWMI -CL Win32_LogicalDisk | Where {$_.DeviceId -Eq "C:"}
$sizeGB=$drive.Size/1024/1024/1024
$sizeGB
if([int]$sizeGB -gt 160){
@robie2011
robie2011 / Office2010.cmd
Created April 30, 2014 14:03
Office Installation
start /wait setup.exe /config config.xml
@robie2011
robie2011 / install_new_fonts.vbs
Created April 30, 2014 14:05
Installing new Fonts on Windows with VBS
' http://blogs.technet.com/b/rspitz/archive/2010/09/25/how-to-install-a-font-from-the-command-line-on-windows-7.aspx
strPathFonts = "\\share\fonts"
set Shell = WScript.CreateObject("WScript.Shell")
strWindir = Shell.ExpandEnvironmentStrings("%windir%")
set fso = CreateObject("Scripting.FileSystemObject")
@robie2011
robie2011 / Add_WiFi_Profile.ps1
Created April 30, 2014 14:10
Add new WiFi Profil on Windows (Powershell)
<#
.SYNOPSIS
.DESCRIPTION
This script add WiFi Profile to (first) WLAN Adapter. Password in profile should be in plain text
.PARAMETER <Parameter_Name>
.INPUTS
Path to WiFi Profile
@robie2011
robie2011 / outlook_scan_calendar.ps1
Created April 30, 2014 14:15
Scan Outlook Calendar Entries (Powershell)
clear
$StartDatum = "01.01.13"
$EndDatum = "01.09.13"
$users = @{ "max müller" = @(); "peter pan" = @(); "mitz mausi" = @(); "fun farah" = @()}
$LookupCalender = "Calendar Name"
$usersKW = $users.Clone()
$outHash = $users.Clone()
@robie2011
robie2011 / gist:719507778e703f4e4b16
Created July 17, 2014 07:26
Powershell Ordner rekursiv nach Backupdatei scannen und darstellen
gci C:\backup\folder | %{
# Root Kundenordner
gci $_.fullname| %{
#Client folder
gci $_.fullname | %{
#$_.fullname
# Client/Application/Subfolder
if( $_.name.tolower().contains("sicherung")){
@robie2011
robie2011 / Install
Last active November 28, 2017 10:16
# Chocolately
Run as Admin
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
Untested
choco install chrome
choco install keepass