Skip to content

Instantly share code, notes, and snippets.

'* Script name: List All Atributes.vbs
'* Created on: 01/28/2009
'* Author: Andrew J Healey
'* Purpose: Exports all attributes from the user object type within
'* the Active Directory schema.
'* Schema: cscript /nologo "list all attribtues.vbs" > Attributes.csv
'* History: Andrew J Healey 01/28/2009
'* - Created script
'
Option Explicit
@robertchong
robertchong / Get-LoggedOnUsers.ps1
Created December 13, 2014 06:02
This script will use the Sysinternals PsLoggedon.exe tool to get the list of users logged onto a workstation or server.The script has a check built in to validate that the computer name belongs to your domain. It will also get the full name of the logged on user back in the result. See https://gallery.technet.microsoft.com/scriptcenter/Get-Logge…
<#
.Synopsis
This script will use the Sysinternals PsLoggedon.exe tool to get the list of users logged onto a workstation or computer
.Description
The script has a check built in to validate that the computer name belongs to your domain. It will also get the full name of the logged on user back in the results.
There is a built in check to ask the operator if they would like to rerun the script.
The script can be used with the parameter PathToPSLoggedon to specify the location of PsLoggedon.exe. Or this can be set to always default to this location.
@robertchong
robertchong / ReadWriteCsv.cs
Created June 4, 2014 12:27
Reading and Writing CSV Files in C#
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace ReadWriteCsv
{
/// <summary>
/// Class to store one CSV row
/// Source: http://www.codeproject.com/Articles/415732/Reading-and-Writing-CSV-Files-in-Csharp
@robertchong
robertchong / Get-PKICertificates.ps1
Created June 1, 2014 03:10
Get-PKICertificates
Function Get-PKICertificates {
<#
.SYNOPSIS
Gets all X.509 Certificates on a local or remote computers
Source: http://gallery.technet.microsoft.com/scriptcenter/a2a500e5-1dd2-4898-9721-ed677399679c
.DESCRIPTION
Gets all X.509 Certificates on a local or remote computers that are from Trusted Root CAs, revoked certificates, person, etc...
This also allows you to look at certificates for the LocalMachine or CurrentUser stores.
The CurrentUser store can only be accessed on the local machine from where this script is being run.
@robertchong
robertchong / LocateExpiredCACerts.ps1
Last active August 26, 2016 12:17
Locate Expired CA Certificates on Your Windows Machine
#
# LocateExpiredCACerts
# Source: http://blogs.technet.com/b/heyscriptingguy/archive/2012/05/17/3386232.aspx
#
$store=new-object System.Security.Cryptography.X509Certificates.X509Store("\\<COMPUTER_NAME>\CA","LocalMachine")
$store.open("ReadOnly")
$store.certificates | % {
@robertchong
robertchong / CallForwarding.java
Last active April 7, 2024 09:00
Android programming - Call forwarding
package com.danielthat.callforwarding;
import android.net.Uri;
import android.os.Bundle;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.view.View;
import android.widget.Button;
import android.app.Activity;
import android.content.Context;
#!/bin/bash
# Henrik Austad ,2009
# UNINETT Sigma A/S
#
# make_cmc.sh
#
# Shell-wrapper for making CMC's to send to a dogtag system
# This script uses CMCEnroll to create CMCs, and it creates simple CMCs,
# i.e. no bundling of several CSRs together.
#
@robertchong
robertchong / awk_groupby_count_total_avg.sh
Created April 19, 2014 13:24
GROUP BY clause functionality in awk - bash
#!/bin/bash
#
# This shell script demonstrates how to implement group by & aggregate functions in awk
# See http://www.unixcl.com/2008/09/group-by-clause-functionality-in-awk.html
#
# Input: A colon (:) delimited file tabulating Continents and numbers
# Output: Continents and values returned by aggregate functions Count(*), Total, Average
#
if [ $# -ne 1 ]; then
@robertchong
robertchong / CSVUtils.java
Created April 19, 2014 02:59
Convert Excel to CSV
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.Row;
@robertchong
robertchong / DataConvertionUtil.java
Created April 19, 2014 02:25
Excel <-> CSV Conversion using Apache POI
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;