Powershell Engine


Find the RDS Licensing servers in your domain 2

During good old Windows 2003 times, the Terminal Licensing Servers were published in the Active Directory using the Sites object and the entry TS-Enterprise-License-Server as explained here. Under WIndows 2008R2, the RDS Licensing role service registers a service connection point; however few documents tells you where to find this SCP […]


Simple netcat-like TCP Server or client

Need to have a process listening on some port to test your firewall rules? Instead of using a netcat or ncat, here’s a very simple Powershell implementation of this ncat/netcat feature:

If you need a TCP Client, the code is very straightforward:

 


Powershell Function Header

The Powershell ISE may not be your favorite editor because of its limitations (long to start, has issues with high-consuming parallel workflows). However its snippets you can insert with the CTRL+J shortcut may be worthwhile to have a look at. One is particularly interesting: the powershell function header template. The […]


Efficient Use of Powershell across Domain Controllers: LastLogon Part 3

After our simplistic approach in the 1st part and our discoveries about optimization in part 2, it is time to gather our learnings to lower the total time our script will run: We know that hashtables can be initialized with the number of elements they will approximately contain to avoid […]


Efficient Use of Powershell across Domain Controllers: LastLogon Part 2

Our previous script was simple but not quick. Our second attempt will try to reduce the time it takes to gather all the pieces. First of all we may imagine that our use of the hashtable in Powershell may be inefficient as we start from 0 object and are continuously […]


Efficient Use of Powershell across Domain Controllers: LastLogon Part 1

One of the frequent reports you’re asked to do when you’re administering an Active DIrectory is to know when a user has connected for the last time or how long has a computer account been inactive. In the infancy of the Active Directory, Microsoft faced these requirements too. In Windows […]


Jobs in Powershell

This post serves more as a reference that an introduction to Powershell Jobs. Cmdlets are: Get-Job, Receive-Job, Remove-Job, Resume-Job, Start-Job, Stop-Job , Suspend-Job and Wait-Job but other commands have -AsJob parameters (Get-WMIObject, Invoke-Command, CDXML snippets) Help can be found in the following topics: about_Jobs about_Job_Details about_Remote_Jobs about_Scheduled_Jobs about_Scheduled_Jobs_Advanced about_Scheduled_Jobs_Basics about_Scheduled_Jobs_Troubleshooting Suspend-Job and Resume-Job […]