Skip to content

Instantly share code, notes, and snippets.

View jdhitsolutions's full-sized avatar

Jeff Hicks jdhitsolutions

View GitHub Profile
@jdhitsolutions
jdhitsolutions / my-conference-future.md
Last active March 5, 2024 21:08
My public speaking status and requirements

Public Presentations Terms and Conditions

I have been an IT professional for over 30 years. I have been speaking publicly and presenting at conferences for probably 25 years. I have presented to all types of groups, from small user groups to large conferences, literally around the world. As I enter the last part of my IT career, I am re-assessing what role conferences will play, and where I want to devote my energy and financial resources. The truth is, that as much as I enjoy presenting and meeting people, there is always a trade-off between the time and money spent on conferences and the value I get from them.

Beginning in 2024, I have decided to make some hard decisions. If you are involved in a conference or event where I have spoken in the past, this may be of interest to you. The bottom line is that I am now very selective about what events and conferences I will present at. Let's dive into some details, and of course there will be exceptions, which I'll cover in a bit.

Requirements

First, **I

@jdhitsolutions
jdhitsolutions / ADChangeReport.ps1
Created January 27, 2021 18:23
A PowerShell script to create an HTML report on recent changes in Active Directory.
#requires -version 5.1
#requires -module ActiveDirectory,DNSClient
# https://jdhitsolutions.com/blog/powershell/8087/an-active-directory-change-report-from-powershell/
#Reporting on deleted items requires the Active Directory Recycle Bin feature
[cmdletbinding()]
Param(
[Parameter(Position = 0,HelpMessage = "Enter a last modified datetime for AD objects. The default is the last 4 hours.")]
[ValidateNotNullOrEmpty()]
@jdhitsolutions
jdhitsolutions / Get-ADChange.ps1
Last active February 18, 2024 05:25
A PowerShell function and custom format file for displaying changed objects in Active Directory.
#requires -version 5.1
#requires -module ActiveDirectory
# Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/
Function Get-ADChange {
[cmdletbinding()]
[outputtype("ADChange")]
[alias("gadc")]
@jdhitsolutions
jdhitsolutions / Get-ADUserAudit.ps1
Last active February 18, 2024 05:18
A PowerShell function and format file for getting Active Directory user management events from the security event logs on domain controllers.
#requires -version 5.1
#requires -module ActiveDirectory
#you might need to increase the size of the Security eventlog
# limit-eventlog -LogName security -ComputerName dom2,dom1 -MaximumSize 1024MB
Function Get-ADUserAudit {
[cmdletbinding()]
Param(
[Parameter(Position=0,HelpMessage = "Specify one or more domain controllers to query.")]
@jdhitsolutions
jdhitsolutions / Get-AVStatus.ps1
Last active February 17, 2024 23:33
This PowerShell function uses WMI via the Get-CimInstance command to query the state of installed anti-virus products.
#requires -version 5.1
Function Get-AVStatus {
<#
.Synopsis
Get anti-virus product information.
.Description
This command uses WMI via the Get-CimInstance command to query the state of installed anti-virus products. The default behavior is to only display enabled products, unless you use -All. You can query by computername or existing CIMSessions.
.Example
@jdhitsolutions
jdhitsolutions / Get-WindowsVersion.ps1
Last active February 17, 2024 17:37
A set of PowerShell functions to remotely query the registry and get operating system version information.
Function Get-WindowsVersion {
<#
.SYNOPSIS
Get Windows version information
.DESCRIPTION
This is a PowerShell version of the winver.exe utility. This commands uses PowerShell remoting to query the registry on a remote machine to retrieve Windows version information.The parameters are the same as in Invoke-Command.
.PARAMETER Computername
Specifies the computers on which the command runs. The default is the local computer.
@jdhitsolutions
jdhitsolutions / Invoke-SqlQuery.ps1
Created July 21, 2017 20:08
A PowerShell script to invoke any T-SQL query against any SQL supported database. This does not use any of the SQL modules.
#requires -version 5.0
<#
.SYNOPSIS
Invoke any T-SQL query against any SQL supported database.
.DESCRIPTION
This command uses the .NET SqlClient classes to connect to a SQL database and execute any type of query. The default behavior is to use integrated Windows authentication, but you can pass a credential object for a username and password. This works well when run on Linux.
When you run a SELECT query the command will write a custom object for each row to the pipeline.
.PARAMETER Query
@jdhitsolutions
jdhitsolutions / Test-IsPrime.ps1
Last active December 20, 2023 03:57
A PowerShell function to test if a number is prime.
Function Test-IsPrime {
<#
.Synopsis
Test if a number is prime
.Description
This command will test if a given number is prime based.
.Example
@jdhitsolutions
jdhitsolutions / PowerShellLab_Setup.md
Last active December 4, 2023 05:43
Detailed instructions for setting up the PowerShellLab for my Pluralsight courses.

PowerShell Lab Detailed Setup Instructions

For my Pluralsight PowerShell courses, you are welcome to use any lab environment you wish. It should include an Active Directory domain with at least a domain controller, a Windows 10 client, and a Windows Server 2016 or 2019 member server. You will need to modify the course files to fit your environment. At this point in time, Windows Server 2022 remains untested for my labs.

However, I am going to recommend that you use a free PowerShell module called PSAutoLab. I encourag you to look at the README document on the project's Github repository before proceeding. If you need help with the module or its commands, you will use the repository's Issue section.

PSAutolab

Please refer to this document to assist in installing and setting up the PSAutolab module on your computer. Run all commands from an elevated Windows PowerShell

@jdhitsolutions
jdhitsolutions / Get-CimNamespace.ps1
Created May 5, 2017 12:28
A PowerShell function to enumerate WMI namespaces using the CIM cmdlets
#requires -version 4.0
Function Get-CimNamespace {
[cmdletbinding(DefaultParameterSetName = 'computer')]
Param(
[Parameter(Position=0)]
[ValidateNotNullorEmpty()]
[string]$Namespace = "Root",
[Parameter(ParameterSetName = 'computer')]
[ValidateNotNullorEmpty()]