Get-DomainRole.ps1

by Nov 24, 2008

# Get-DomainRole.ps1 # Gets system's domain role using PowerShell # Sample 2 from http://msdn.microsoft.com/en-us/library/aa394586 # Thomas Lee – tfl@psp.co.uk # Get Computer info $Computer = Get – WmiObject – Class Win32_ComputerSystem # Print Role: " Computer `"{0}.{1}`" is a: " -f $Computer .Name, $computer .domain switch ( $computer .DomainRole) { 0 { " Standalone Workstation " } 1 { " Member Workstation… Read the full text.