Skip to content

Instantly share code, notes, and snippets.

View MikeSel's full-sized avatar

Mike Hudson MikeSel

View GitHub Profile
@MikeSel
MikeSel / Proxy
Created May 15, 2014 10:48
Set IE Proxy Settings
On Error Resume next
Const HKCU=&H80000001 'HKEY_CURRENT_USER
Const HKLM=&H80000002 'HKEY_LOCAL_MACHINE
Const REG_SZ=1
Const REG_EXPAND_SZ=2
Const REG_BINARY=3
Const REG_DWORD=4
Const REG_MULTI_SZ=7
On Error Resume next
Const HKCU=&H80000001 'HKEY_CURRENT_USER
Const HKLM=&H80000002 'HKEY_LOCAL_MACHINE
Const REG_SZ=1
Const REG_EXPAND_SZ=2
Const REG_BINARY=3
Const REG_DWORD=4
Const REG_MULTI_SZ=7
defaults write com.apple.Finder AppleShowAllFiles YES
Dim WithEvents olkFolder As Outlook.MAPIFolder
Sub InitMonitoring()
Set olkFolder = OpenOutlookFolder("Path to the folder to monitor")
End Sub
Function IsNothing(obj)
If TypeName(obj) = "Nothing" Then
IsNothing = True
Else
IsNothing = False
Private Function GetMonthName(ByVal monthNum As Integer) As String
Try
Dim strDate As New DateTime(1, monthNum, 1)
Return strDate.ToString("MMM")
Catch ex As Exception
End Try
End Function
On Error Resume Next
Set objGroup = GetObject _
("LDAP://cn=<group>,ou=<nested OU>,ou=<OU Name>,dc=<domain>,dc=com")
objGroup.GetInfo
arrMemberOf = objGroup.GetEx("member")
WScript.Echo "Members:"
For Each strMember in arrMemberOf
Option Explicit
Dim pGenNum, newpass, passList, inFlag, pgLength, x, fso, ts, passLen
Const ForWriting = 2
passLen = 6
'Give inFlag (input Flag) an initial value to ensure we run once
inFlag = "Seed"
Do While inFlag &lt;&gt; pGenNum
pGenNum = InputBox("How many passwords would you like to create?" &amp; vbCrLf &amp; _
"Enter a Numeric Value" &amp; vbCrLf &amp; _
"Blank Entry Will Cancel Script","Enter Number of Passwords to Create")
Private Sub Application_Reminder(ByVal Item As Object) 'Grab the outlook reminder fire event and force reminder window to front
If Not (Application.ActiveWindow Is Nothing) Then 'If the ActiveWindow exists
Dim myOutlook As Object 'Outlook application object declaration
Set myOutlook = GetObject(, "Outlook.Application") 'Get the outlook application object
If myOutlook.ActiveWindow.WindowState = olMinimized Then 'If outlook application minimized then
Application.ActiveExplorer.Activate 'Activate Outlook application window
Else 'If Outlook application not minimized then
Application.ActiveExplorer.Activate 'Activate Outlook application window
End If
-- Apple Script to copy and rename a folder structure and its subfolders
-- Author Mike Hudson (aka MikeSel - https://www.mikesel.info)
tell application "Finder"
set JobName to text returned of (display dialog "Please enter five digit code:" default answer "ST1234")
set templateFolder to choose folder with prompt "Please Choose Template Folder"
set fldName to name of templateFolder
@MikeSel
MikeSel / gist:6138617
Last active December 20, 2015 13:28
Set Microsoft Lync status using AppleScript
--
tell application "Microsoft Lync"
activate
end tell
tell application "System Events"
tell process "Microsoft Lync"
tell menu bar 1
tell menu bar item "Status"
tell menu "Status"