Share and NTFS permissions for Logon Script

The FAST: Scripts running at logon that write to a network share user the user account logging in and the NTFS permissions require READ and WRITE. So I looked everywhere for this one, I thought it would be a regular problem, but it is not apparently, and if it is it is not documented well.  […]

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 […]

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 […]

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. 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 Control Panel Command Line Commands in Windows CMD Commands for Control Panel Applets Applet Command OS Version Accessibility Options control access.cpl XP […]

Show all Domain Computers that are Online

Quickie one liner; get-adcomputer -filter * | Where { Test-Connection $ -count 1 -quiet } | Select @{Name=”Computername”;Expression={$_.Name}} Reference :

Find all RDP (and Console) Sessions in the Domain

Quickie one liner $work = Get-ADComputer -filter * $work = $ foreach ($1 in $work){write-host $1 ; quser /server:$1} This also works (courtesy of jrv [technet]); Get-ADComputer -Filter *| ForEach-Object{ quser /server $_.Name} Or to get a single computer Get-ADComputer <servername> | ForEach-Object{ quser /server $_.Name}