This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function export-DGV2CSV ([Windows.Forms.DataGridView] $grid, [String] $File) | |
<# | |
.SYNOPSIS | |
Export basic datagrid to CSV file | |
.PARAMETER grid | |
Datagrid object | |
.PARAMETER file | |
Path to CSV file | |
#> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ---------------------------------------------------------------------------# | |
# Mousewatcher v1.2 | |
# Monitor user activity and shutdown machine if no activity detected. | |
# | |
# 24/05/2010 - Tom Latham | |
# | |
# Explanation: | |
# * Log output of /dev/input/mice to file. Monitor timestamp of file to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (($pshome -like "*syswow64*") -and ((Get-WmiObject Win32_OperatingSystem).OSArchitecture -like "64*")) { | |
write-warning "Restarting script under 64 bit powershell" | |
# relaunch this script under 64 bit shell | |
& (join-path ($pshome -replace "syswow64", "sysnative")\powershell.exe) -file $myinvocation.mycommand.Definition @args | |
# This will exit the original powershell process. This will only be done in case of an x86 process on a x64 OS. | |
exit | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Disable SSH on all hosts in a vCenter | |
//Tom Latham (04/02/2015) | |
//Get all host systems from vCenter | |
var hosts = vCenter.getAllHostSystems(null,null); | |
System.log (hosts.length + " hosts found in " + vCenter.name); | |
var countSSHEnabled = 0; //Count of servers with misconfigured SSH | |
var countSSHRemediated = 0; | |
//Iterate across all hosts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check for a specific patch on remote PCs v1.2 | |
# Tom Latham 04/02/2010 | |
# | |
# Added v1.1: Error messaages | |
# Added v1.2: GUI Inputs | |
# Function to open file dialog box and select a file | |
Function Get-FileName($initialDirectory) | |
{ | |
[void][System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
'---------------- USAGE ------------------------- | |
Dim sComputer : sComputer = "." | |
'---------------- PROGRAM ------------------------- | |
Dim sFileName : sFileName = sComputer & "_" & GetFilename() & ".txt" | |
Dim sData |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Includes: | |
* Connecting to SCCM | |
* Finding folders, packages and machines | |
* Creating software metering rules | |
* Remove machines from collections |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'------------- USAGE -------------------- | |
DeleteFolder("<machine>","\\<machine>\c$\Documents and Settings\xtomlatham") | |
'------------- FUNCTION ----------------- | |
' Attempt to delete specifed folder. Fails on folder not found or deleted. | |
Function DeleteFolder(sComputer, sFolderPath) | |
Dim oFS : Set oFS = CreateObject("Scripting.FileSystemObject") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Including: | |
* Deleting files and folders (incl criteria based - if older than xx days) | |
* Open and save file dialogs | |
* Hard disk usage reports |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$bMouseMove = 0 | |
HotKeySet( "`", "toggle" ) | |
While 1 | |
Sleep(10) | |
If $bMouseMove = 1 Then | |
$bMouseMove = 2 | |
MouseMove(100,100) | |
ElseIf $bMouseMove = 2 Then | |
$bMouseMove = 1 | |
MouseMove(200,200) |
NewerOlder