If a PowerShell script requires the input of a domain name after a parameter, is there a way to just generically specify the domain name of the local machine that you're on?
New-ADGroup -Server localhost:60000 -Path "OU=AccountDeptOU,DC=AppNC" -Name AccountLeads -GroupScope DomainLocal -GroupCategory Distribution
In this example script the "path" parameter requires the value of DC (Domain Controller) to be AppNC. If I was going to take this script to other domain environments then it obviously won't work because the domain names would be different.
Is there some kind of value I can put instead to just say,"This local machine's current domain name." If that makes any sense.
I'd appreciate any insight. Thanks :)