Swiss Army knife of this and that

Remotely Reboot Computer

; ----------------------------------------------------------------------------
;Password Needed To Use Command
; ----------------------------------------------------------------------------
$password = inputBox("Enter Password", "Please enter Password", "", "", -1, -1, 0, 0)
 
;Cancel Button Pushed
IF @error = 1 then
    MsgBox(0, "Sorry", "Good Bye")
    Exit
Endif
 
IF $password = "akm" then
;    MsgBox(4096, "Thanks", "Access Granted")
else
    MsgBox(0, "Sorry", "Access Denied")
    Exit
EndIf
 
; ----------------------------------------------------------------------------

Encrypt and Decrypt String

Script that does a basic encryption and decryption using AutoIt

#include <GuiConstants.au3>
#include <String.au3>
;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000
GuiCreate("Encryption Tool", 392, 247, 400,226)
$Button2 = GuiCtrlCreateButton("Cancel", 304, 192, 73, 25)
$GroupBox1 = GuiCtrlCreateGroup("Sting Encryption Tool", 8, 8, 369, 177)
$Label1 = GuiCtrlCreateLabel("Username", 24, 32, 48, 13)
$Label2 = GuiCtrlCreateLabel("Password", 24, 56, 46, 13)
$Label3 = GuiCtrlCreateLabel("Encyption Password", 24, 104, 96, 13)

Check Drive Space - Write To Log File

Script looks at all drives and writes the current free space to log file.

#include <file.au3>
 
_diskcheck()
 
Func _diskcheck()
	$var = DriveGetDrive( "all")
	If Not @error Then
		For $i = 1 To $var[0]
			$d_filesys = DriveGetFileSystem($var[$i])
			If $d_filesys = "UDF" Then
				;do nothing
			ElseIf $d_filesys = "1" Then ;no media
				;do nothing
			ElseIf $d_filesys = "FAT" Then
				$var1 = DriveSpaceFree($var[$i])
				$var1 = $var1 / 1024
				$var1 = Round($var1, 1)

Join Computer to Domain

Const JOIN_DOMAIN = 1
Const ACCT_CREATE = 2
Const ACCT_DELETE = 4
Const WIN9X_UPGRADE = 16
Const DOMAIN_JOIN_IF_JOINED = 32
Const JOIN_UNSECURE = 64
Const MACHINE_PASSWORD_PASSED = 128
Const DEFERRED_SPN_SET = 256
Const INSTALL_INVOCATION = 262144
 
strDomain = "domain name here"
strPassword = "password here"
strUser = "user here"
 
Set objNetwork = CreateObject("WScript.Network")
strComputer = objNetwork.ComputerName
 
Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _
    strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _
        strComputer & "'")

Drive Icon Change for XP

;#NoTrayIcon
;Created by Aaron Moline <Aaron.Moline@kpunderground.com>
Dim $i, $var, $e
$path = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"
$iconPath = "C:\WINDOWS\Resources\"
$a_drive = "floppydrv.ico"
$c_drive = "windowsdrv.ico"
$cmn_drive = "hddrv.ico"
$cdrom_drive = "cddrv.ico"
$dvd_drive = "dvddrv.ico"
$ram_drive = "ramdrv.ico"
$rem_drive = "rmdrv.ico"
$net_drive = "netdrv.ico"
;------INSTALL ICONS
 
FileInstall("floppydrv.ico", "C:\WINDOWS\Resources\" & "floppydrv.ico")
FileInstall("windowsdrv.ico", "C:\WINDOWS\Resources\" & "windowsdrv.ico")

Active Directory - List Users in Group

#include <bk-logfile.au3>
Dim $strMember,$arrMemberOf,$objGroup,$strGroupName
 
$strGroupName = "LDAP://cn=Administrators, dc=domain, dc=loc"
 
$objGroup = ObjGet($strGroupName )
$objGroup.GetInfo()
 
$arrMemberOf = $objGroup.GetEx("member")
 
_WriteLog ("Members:")
For $strMember in $arrMemberOf
    _WriteLog ($strMember)
Next