Wednesday, September 8, 2021

Get A List of Domain Controllers

 Here is an easy way to pull a list of all the domain controllers in your environment using powershell.

Get-ADDomainController -filter * | Select-Object name | format-table

Wednesday, April 7, 2021

Find the RDS Licensing Server

 If for some reason you find yourself in an environment you don't know and need to find where a service such as the RDS licensing server is running you can run the following command.  The Format-List is optional, but I like to use it to make the output easier to read.

Get-ADObject -LDAPFilter "(&(CN=TermServLicensing)(objectClass=serviceConnectionPoint))" | Format-List

Friday, March 12, 2021

Use Powershell to Create A File

Sometimes you need to create a file in a directory for testing.  Here is a simple way to create an empty file in the current directory using powerhell.

New-Item newfile.txt -ItemType file

If you want to create the file in a different directory you can specify the path.

New-Item c:\directory\newfile.txt -ItemType file