Wednesday, December 23, 2020

Get-ADComputer Powershell Custom Expression Pipeline

You may have to periodically run reports on where the computer is in AD but can't sort by the OU with the DistinguishedName containing the computer name.

$list = Get-content "C:\list\final.txt"

Foreach ($PC in $list){Get-ADComputer $PC | select Name, @{Name = 'AD OU'; Expression = {$_.DistinguishedName -replace "CN=$PC," } } }


Here's the same but for Windows 7 machines replacing it real time.

get-adcomputer -filter {Operatingsystem -like "Windows 7*"} -Properties * | select Name, OperatingSystem, @{Name = 'AD OU'; Expression = {$_.DistinguishedName -replace "CN=" + $_.Name + ","} }

Wednesday, May 20, 2020

Applications Doesn't Work on Windows 10 1809 builds

If you come across applications that communicate to a server or service that stopped working in newer Windows 10 1809 or newer and have that's not a firewall or proxy issue then check for the TLS setting.

If the app needs TLS 1.0 enabled, change the settings and test the app.  A reboot is not required.  

Apps like Cofense and FS Pro 2020 runs on TLS 1.0.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client

Set these keys to the value below.

DisabledByDefault to 0
Enabled to 1


Friday, May 15, 2020

Windows 10 and Dell 1600 MFP Printer

If you have an old Dell printer that has no Windows 10 drivers available but has a network interface, try installing the printer via TCP/IP and using the Windows 7 x64 drivers.  If you don't have a network switch, you should be able to use a crossover cable from PC to printer.

I had given up on making it work from all the posts on the internet.  I didn't really care if I used it via USB or not, just wanted something to print from that was reliable.  I had spent $80 on ink for a free HP inkjet printer which ended up drying out and was ready to toss that thing.

I only came across this because I used a Macbook for my kid's remote school learning and surprised it found the printer.   After that, I tried installing the Bonjour service to no avail and then installed it via TCP/IP and was able to get it to print.  

This was a printer from a company I use to work for 12+ years ago that went out of business and still has 21% toner left. Rather than throwing something that still has plenty of life, it is usable again!  The inkjet however will be given away or disposed of... 

Friday, April 10, 2020

LDAP Query for Active Windows Client Workstations

If you are using ADUC or a security scan engine tool, this is how you can limit to searches for active machines.

Copy and paste the text into a custom search in ADUC or whatever you need it for.

(&(&(&(objectCategory=computer)(objectClass=computer)(|(operatingSystem=Windows\2010*)(operatingSystem=Windows\207*))(!userAccountControl:1.2.840.113556.1.4.803:=2))))

The "\20" is a placeholder for a space.  If you need to add other operating systems, add another "(operatingSystem=Windows\207*)" after it. 

XP: 
(operatingSystem=Windows\20XP*)

Wednesday, November 6, 2019

SCCM - AutoPilot Hardware (HW) IDs Report Query

We're trialing Intune to either replace or co-manage with SCCM and testing out Autopilot.

The generic canned report doesn't give you the computer name and only serial information, it is located under Hardware  - General -> Windows AutoPilot Device Information

Here's a query to pull more information modifying the same query to include computer name so you can enroll specific computers.  

SELECT        v_R_System.Name0 AS [PC Name], v_GS_PC_BIOS.SerialNumber0 AS [Serial Number], v_GS_MDM_DEVDETAIL_EXT01.DeviceHardwareData0 AS [Device HW ID], v_GS_OPERATING_SYSTEM.SerialNumber0 as [OS Serial], v_GS_OPERATING_SYSTEM.Caption0 as [Operating System] 
                         
FROM            v_R_System INNER JOIN
                         v_GS_MDM_DEVDETAIL_EXT01 ON v_R_System.ResourceID = v_GS_MDM_DEVDETAIL_EXT01.ResourceID INNER JOIN
                         v_GS_COMPUTER_SYSTEM_PRODUCT ON v_R_System.ResourceID = v_GS_COMPUTER_SYSTEM_PRODUCT.ResourceID INNER JOIN
                         v_GS_OPERATING_SYSTEM ON v_R_System.ResourceID = v_GS_OPERATING_SYSTEM.ResourceID INNER JOIN
                         v_GS_PC_BIOS ON v_R_System.ResourceID = v_GS_PC_BIOS.ResourceID
ORDER BY v_GS_COMPUTER_SYSTEM_PRODUCT.Version0

Friday, November 30, 2018

Old Adobe Software Downloads

If you have the keys but lost the install media, here's the Adobe site to download the older CS suites.

https://helpx.adobe.com/download-install/kb/cs6-product-downloads.html


Wednesday, October 24, 2018

SCCM - Windows Update Agent Compliance Item

This is a script I created to pro-actively detect systems that failed to add the WSUS server settings.

I set the threshold high due to the initial client install will have errors until the client applies the settings.

Most of the time, the fix was to delete the c:\windows\system32\GroupPolicy\Machine\Registry.pol and re-run the actions.

Const ForReading = 1
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Pattern = "Failed to Add Update Source for WUAgent"

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile("C:\Windows\CCM\Logs\WUAHandler.log", ForReading)

i =0 

Do Until objFile.AtEndOfStream
    strSearchString = objFile.ReadLine
    Set colMatches = objRegEx.Execute(strSearchString)
    If colMatches.Count > 0 Then
        For Each strMatch in colMatches

i = i + 1
        Next
    End If
Loop

'Wscript.Echo "Number of failures: " & i

If i > 20 then 
Wscript.quit(1)
End If

objFile.Close