Skip to content

Instantly share code, notes, and snippets.

View danjpadgett's full-sized avatar

Dan Padgett danjpadgett

View GitHub Profile
Unlock
$SecureString = ConvertTo-SecureString "xxxxxx" -AsPlainText -Force
Unlock-BitLocker -MountPoint "D:" -Password $SecureString
EncryptD
.\manage-bde.exe -protectors -enable d:
$secure = ConvertTo-SecureString "xxxxxx" -AsPlainText -Force
@danjpadgett
danjpadgett / getTPMVersionStatus.sql
Created April 12, 2018 10:00
getTPMVersionStatus.sql
SELECT distinct CS.Manufacturer0 as 'Manufacturer',
CS.Model0 AS 'Model', CS.Name0 as 'Name', TPM.SpecVersion0 as 'SpecVersion',
TPM.IsActivated_InitialValue0 as 'IsActivated_InitialValue',
TPM.IsEnabled_InitialValue0 as 'IsEnabled_InitialValue',
TPM.IsOwned_InitialValue0 as 'IsOwned_InitialValue',
TPM.ResourceID,
OPSYS.Caption0 as 'OS',
OPSYS.CSDVersion0 as 'ServicePack',
GSBIOS.SMBIOSBIOSVersion0 as 'BIOS',
GSBIOS.SerialNumber0 as 'Serial No.'
<#
.SYNOPSIS
Checks WSUS App Pool
.DESCRIPTION
Script will check status of WSUS APP Pool and if 'stopped' will email. Setup script as scheduled task on WSUS instance.
.NOTES
Version: 1.0
Author: dpadgett
Creation Date: 07/02/17
Purpose/Change: Production
@danjpadgett
danjpadgett / Customise-Win10.ps1
Last active March 28, 2018 16:16
Customise-Win10.ps1
<#
.SYNOPSIS
Sets W10 1709 Options
.DESCRIPTION
Sets W10 1709 Options
.PARAMETER <Parameter_Name>
None
.INPUTS
None
#Set the Following Parameters
#To be run locally on ConfigMgr Source Server
$Source = 'E:\Source'
$ShareName = 'source$'
$NetworkAccount = 'contoso\SCCMAdmins'
#Create Source Directory
New-Item -ItemType Directory -Path "$Source"
@danjpadgett
danjpadgett / CheckClientPushQueue.sql
Last active February 21, 2018 14:19
SCCM Client Push Request Queue
SELECT
m.[Name] AS [Computer Name]
,m.[LatestProcessingAttempt]
,m.[LastErrorCode]
,m.[Description]
, AD.AD_Site_Name0 AS [AD Site Name]
,m.[NumProcessAttempts]
FROM v_R_System AD
JOIN [CM_XXX].[dbo].[v_CP_Machine] m
@danjpadgett
danjpadgett / LoopIE
Last active February 16, 2018 16:29
LoopIE
<#
.NOTES
===========================================================================
Created by: Dan Padgett (C)
Organization: www.execmgr.net
Filename: LoopIE
Version: 3.0
===========================================================================
.SYNOPSIS
@danjpadgett
danjpadgett / Get-CmSiteCode.PS1
Created February 15, 2018 17:20
Get-CmSiteCode
$result = @()
$time = 1
$searchbase = 'OU=WORKSTATIONS,DC=COMPANY,DC=com'
$list = (Get-ADComputer -SearchBase $searchbase -Filter 'Enabled -eq $true').name
function Get-ComputerSite($i)
{
$site = nltest /server:$i /dsgetsite 2>$null
if($LASTEXITCODE -eq 0){ $site[0] }
}
$collectionname = Read-Host -Prompt "Enter collection name" 
$result = @()
$Data = Get-CMDeployment | ?{$_.collectionname -like "$collectionname"} | select collectionname, NumberErrors,NumberInProgress,NumberOther,NumberSuccess,NumberTargeted,NumberUnknown
foreach($entry in $Data){
$resData = New-Object System.Object
$resData | Add-Member -type NoteProperty -name Errors -value ($entry.numbererrors)
$resData | Add-Member -type NoteProperty -name InProgress -value ($entry.numberinprogress)
@danjpadgett
danjpadgett / Get-RemoteLoggedUser.ps1
Last active January 11, 2018 12:33
Get-RemoteLoggedUser.ps1
$result = @()
$time = 1
$list = (Get-Content C:\Script\List.txt)
function get-LoggedInusers($i)
{
$Username = $null
$explorerprocesses = @(Get-WmiObject -ComputerName $i -Query "Select * FROM Win32_Process WHERE Name='explorer.exe'" -ErrorAction SilentlyContinue)
if ($explorerprocesses.Count -eq 0)
{