Wednesday, October 21, 2020

Powershell popup


Article on how to produce pop-ups in powershell.

 https://powershell.org/2013.04/powershell-popup


$wshell = New-Object -ComObject Wscript.Shell -ErrorAction Stop
$wshell.Popup("Are you looking at me?",0,"Hey!",48+4)

Tuesday, March 10, 2020

Test-Connection has a TCPPort option in Powershell v6+


Powershell versions 6 and above provide the test-connection cmdlet with a port specification option

-TCPPort <portnumber>

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/test-connection/?view=powershell-7


Note that ISE is not used for versions of powershell above 5.1.
https://docs.microsoft.com/en-us/powershell/scripting/components/ise/introducing-the-windows-powershell-ise?view=powershell-7


Visual Studio Code is recommended as the replacement for Powershell ISE
https://code.visualstudio.com/



Wednesday, January 22, 2020

Using Primary Group IDs



Primary Group IDs are the RIDs for the Domain groups. The full list is here: Interesting Windows Computer & Active Directory Well-Known Security Identifiers (SIDs).

515 – Domain Computers
516 – Domain Controllers (writable)
521 – Domain Controllers (Read-Only)
This information helps filter computer objects to return only the desired computer type.
https://adsecurity.org/?p=873


example

Get-ADComputer -Filter {PrimaryGroupID -eq 515} | where {$_.name -like "?????xw*" -or $_.name -like "DESKTOP*"} | select name | sort name | out-file $outputFile