Let's say that the Root Domain name is contoso.com
When I run this script it gives me an output along the lines of:
xxxxxx : contoso.com
The "xxxxx" represents some characters, including the file name.
What do those characters mean, and how can I make it so that I only get "contoso.com" as the output, without the characters in front of it?
Information
I am using the following powershell script to obtain information:
Get-ADDomain >> ./log.txt
From all of the information that Get-ADDomain gives me, I want to extract the Root Domain name, so I use Select-String to get it out of the text file, as follows:
$domain = Select-String -Path ./log.txt -Pattern "RootDomain"