Skip to content

Instantly share code, notes, and snippets.

View Mike-Crowley's full-sized avatar

Mike Crowley Mike-Crowley

View GitHub Profile
@thedavecarroll
thedavecarroll / SearchADDnsRecord.psm1
Last active January 8, 2024 16:09
This simple PowerShell script module uses a custom class and Get-ADObject to search an Active Directory-integrated DNS Zone by name or partial name.
#Requires -Version 5.1
#Requires -Module ActiveDirectory
$script:ADRootDSE = Get-ADRootDSE
class ADDnsNode {
# AD Object Properties
[String]$Name
[String]$CanonicalName
<#
.SYNOPSIS
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager
.DESCRIPTION
Adapted from: http://stackoverflow.com/questions/7162604/get-cached-credentials-in-powershell-from-windows-7-credential-manager
.PARAMETER TargetName
The name of the target login informations in the Windows Credential Manager