Whoami
hostname
Echo %username%
Net users
Net user USERNAME
set
whoami /all
Get-ADTrust
Domain information:
[System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
Domain Trusts:
([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).GetAllTrustRelationships()
Current forest info:
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
Trust relationship:
([System.DirectoryServices.ActiveDirectory.Forest]::GetForest((New-Object System.DirectoryServices.ActiveDirectory.DirectoryContext('Forest', 'forest-of-interest.local')))).GetAllTrustRelationships()