PowerShell List all Enabled Accounts that have an Expired Password

Took longer then expected to work this out, here it is Get-ADUser -filter * -properties * | Where-Object {$_.Enabled -eq $true} |where-object {$_.Passw ordExpired -eq $true} |select name,passwordexpired,mail You can see where there are 2 properties being checked, and I think is should be easy to add a third.  wonder if there is a cleaner […]

Cisco Port Security

It is becoming more common that the switch has port security turned on.  This means only one MAC can plug into any single port.  It is not a big deal to reset it, but for some reason I could not find a direct answer.  Here is mine; Reset sticky bit Examples; show port-security sh interface […]

Force Delete a File

WARNING!!! THIS WILL FORCE DELETE FILES, USE AT YOUR OWN RISK!!!     This one has hounded me many times, and I thought I already did a KB for this, but apparently not, so here goes; First make sure everyone is off, I use the MS file sharing MSC, “Share and Storage Management”.  On the […]

SharePoint Online Time Out

Just a quick on this.  a great link is here; https://techcommunity.microsoft.com/t5/Microsoft-SharePoint-Blog/Idle-Session-Timeout-Policy-in-SharePoint-Online-amp-OneDrive-is/ba-p/211274 PS C:\Windows\system32> Connect-SPOService -Url https://<tenent>-admin.sharepoint.com PS C:\Windows\system32> get-SPOBrowserIdleSignOut Enabled WarnAfter SignOutAfter ——- ——— ———— True 00:05:00 00:30:00 PS C:\Windows\system32> Set-SPOBrowserIdleSignOut -Enabled $true -WarnAfter (New-TimeSpan -Seconds 2700) -SignOutAfter ( New-TimeSpan -Seconds 3600)

Add Images to Word from Command (Powershell)

Really all the credit has to go to u/Pandapokeman on reddit.  All I did was add a single line that added the file name to the bottom of the picture. https://www.reddit.com/user/Pandapokeman/ Here is his script (be sure to use the full file path in the command) Function Add-OSCPicture { <# .SYNOPSIS Add-OSCPicture is an advanced […]

Control Panel Command Line CMD.exe

A quick look at commands to get things done faster; Network Adapters ncpa.cpl Firewall firewall.cpl Updates wuaucpl.cpl System Info msinfo.exe Computer Manager Compmgmt.msc Startup and control tabs msconfig   My references https://www.maketecheasier.com/20-run-commands-windows/ https://www.lifewire.com/command-line-commands-for-control-panel-applets-2626060 Control Panel Command Line Commands in Windows CMD Commands for Control Panel Applets Applet Command OS Version Accessibility Options control access.cpl XP […]

Windows PDC Time

I cannot begin to tell you how this has hounded me through my career, but I am happy to make this post, that I think has 99% of the answers. #1 thing that has caused me issues, not my trouble shooting order or the GPO settings. The GPO on the PDC MUST be removed, all […]

New Powershell command Get-PerimeterMessageTrace

  So I want to put this out there, because I googled the crap out to this hand got zero information. When doing an exchange message trace, it was used to see incoming email.  going to have to explore this more, and find out what it really can do.   PS C:\Windows\system32> PS C:\Windows\system32> Get-PerimeterMessageTrace […]