Skip to content

Instantly share code, notes, and snippets.

View dotps1's full-sized avatar

Thomas Malkewitz dotps1

View GitHub Profile
<#
.SYNOPSIS
Test a Domain Targeted PSCredential Object for valid Username and Password.
.DESCRIPTION
Simulates an Authentication Request in a Domain envrionment using a PSCredential Object.
Returns $true if both Username and Password pair are valid.
.EXAMPLE
Test-Credential
.NOTES
Expansion from Stack Overflow Artical: http://stackoverflow.com/questions/10802850/validating-powershell-pscredential
@dotps1
dotps1 / New-Username.ps1
Last active August 29, 2015 14:04
Creates a unique AD DS Username.
<#
.SYNOPSIS
Creates a new username with AD DS Validation.
.DESCRIPTION
Create a new username with the following order until a unique Username is found.
1. First Initial Last Name.
2. First Initial First Middle Intial Last Name.
3. Itterates First Name adding Char until a unique Username is found.
.EXAMPLE
New-Username -FirstName John -LastName Doe
@dotps1
dotps1 / .New-SccmJavaApplication.ps1
Last active June 16, 2021 17:56
Creates a new Sccm Java Application and Deployment Type. All three functions are required. (See comments for details.)
Param (
[Parameter(
Mandatory = $true
)]
[String]
$SourcePackageCreationPath,
[Parameter(
Mandatory = $true
)]
@dotps1
dotps1 / Get-DNSConfiguration.ps1
Last active January 5, 2024 08:03
Retrieves the DNS Servers from all IPEnabled Network Adapters.
<#
.SYNOPSIS
Retrives DNS Servers from a computer.
.DESCRIPTION
Retrives primary, secondary, tertiery DNS Servers from on online system with Windows Management Instrimentation.
.INPUTS
System.String.
.OUPUTS
System.Management.Automation.PSObject.
.PARAMETER ComputerName
<#
.SYNOPSIS
Displays matching PowerBall numbers from a Csv file.
.DESCRIPTION
Imports a csv file, with each number in it own column, then compares it to the PowerBall Numbers.
Outputs highlighted matching numbers in each row.
.INPUTS
System.String
.OUTPUTS
None.
@dotps1
dotps1 / ProtectedAttributeCleanup.ps1
Last active June 20, 2016 18:57
Find users in a domain that have the protected attribute that should not, remove that attribute and re enable inheritance.
#requires -Modules ActiveDirectory
# Gets all currently protected groups and users.
$protectedGroups = Get-ADGroup -LDAPFilter '(adminCount=1)'
$protectedUsers = Get-ADUser -LDAPFilter '(adminCount=1)'
# Gets all the users that are actually members of the current protected groups.
$usersFromProtectedGroups = $protectedGroups | ForEach-Object {
Get-ADGroupMember -Identity $_ | Where-Object {
$_.ObjectClass -eq 'User'
@dotps1
dotps1 / Register-SophosWebIntelligenceService.ps1
Last active March 16, 2016 14:40
Fix for missing Sophos Web Intelligence Service
# Fix for missing Sophos Web Intelligence Service.
# https://www.sophos.com/en-us/support/knowledgebase/121905.aspx
<# WQL Query for SCCM collection to target computers with Sophos Anti-Virus but missing the Sophos Web Intelligence Service.
SELECT SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
<#
.SYNOPSIS
Gets the current status of BitLocker.
.DESCRIPTION
Tests the current status of BitLocker Drive Encryption on an Encryptable Volume. Only returns true if the volume is fully encrypted and the protection status is on.
.INPUTS
System.String.
.OUTPUTS
System.Management.Automation.PSObject
.PARAMETER ComputerName
@dotps1
dotps1 / README.md
Created May 16, 2016 14:51
Read me file for PSGist.

PSGist

A PowerShell module to interact with GitHub Gists.

Build status

This is a PowerShell module that uses the GitHub API to interact and manipulate Gist.

PS GitHub:\> Get-Command -Module PSGist | Sort-object -Property Name
<#
.SYNOPSIS
Ensures proper configuration of targeted Registry Key Property Values to prevent the LogMeIn Patch Management feature from interfering with the Windows Update subsystem.
.DESCRIPTION
There is a limitation on the WUAUSERV application that makes it a single user application. During the Patch Cycle of LabTech, if another application (LogMeIn) tries to invoke a call to it,
It will cause the LabTech Patch Cycle to fail. This registry configuration will prevent the LogMeIn service from using the Windows Update subsystem.
.INPUTS
None.
.OUTPUTS
None.