Displaying the Next Available Number in a sequence
Clash Royale CLAN TAG #URR8PPP Displaying the Next Available Number in a sequence Our organisation renames all new computers before they join our domain and I am trying to create a script to display the next available number. So, our naming convention is as follows Example: GBYOR-DT1 GB - YOR - DT - 1 [Country] [City] [Desktop] [Number] However my predecessor thought to number these in no logical order and that just isn't happening on my watch. (Did someone say OCD?) Currently I run Get-ADComputer -Filter * | where{$_.Name -Like "GBYOR-DT*" | FL Name | Export-CSV -Path "X Location" I then go into Excel, split the cells and the sort numerically. What I would like is to create a script that just shows me the next available number. For example, as it currently stands, we have X number of machines, one is GBYOR-DT4, another is GBYOR-DT245 but there is no GBYOR-DT15. I would like to script this so that when I run it, it will look at all...