fazlook
9 years agoFrequent Contributor
How do I get the domain type using TC ?
Let's say my domain is TC.com or TC.ca, how do I get the ca or com part ?
SYS.domainname gives me only the name.
Thank you
- 9 years ago
cunderw wrote:
It sounds like you want the the domain name of your computer? SYS.domainname is for the currently loggen in user which isn't always the name of the domain. You wnat the system domain name.
Try this:
dotNET.System_DirectoryServices_ActiveDirectory.Domain.GetComputerDomain().ToString();
You will have to add the System.DirectoryServices component to your CLR bridge to access this.
Here's another way, without using .NET:
' VBScript CreateObject("ADSystemInfo").DomainDNSName // JScript (new ActiveXObject("ADSystemInfo")).DomainDNSName