![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | retrieving domain info The following will get the Domain for the Current User: $domain = $env:UserDNSDomain What will get the domain of the computer the script is run from? |
My System Specs![]() |
| | #2 (permalink) |
| | RE: retrieving domain info Get-WmiObject -Class Win32_ComputerSystem will return the domain among other stuff (Get-WmiObject -Class Win32_ComputerSystem).Domain gives just the domain -- Richard Siddaway All scripts are supplied "as is" and with no warranty PowerShell MVP Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "KeithK" wrote: Quote: > The following will get the Domain for the Current User: > $domain = $env:UserDNSDomain > What will get the domain of the computer the script is run from? > |
My System Specs![]() |
| | #3 (permalink) |
| | RE: retrieving domain info there are more way's but an easy one using WMI would be : (gwmi Win32_ComputerSystem).domain Greetings /\/\o\/\/ http://thePowerShellGuy.com "KeithK" wrote: Quote: > The following will get the Domain for the Current User: > $domain = $env:UserDNSDomain > What will get the domain of the computer the script is run from? > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: retrieving domain info [System.DirectoryServices.ActiveDirectory.Domain]::GetComputerDomain().Name --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic K> The following will get the Domain for the Current User: K> $domain = $env:UserDNSDomain K> What will get the domain of the computer the script is run from? |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| VBScript for retrieving user account info. from a domain controller | VB Script | |||
| retrieving info | General Discussion | |||
| Retrieving Info | Vista General | |||
| Retrieving lost info | Vista file management | |||
| Join Vista Machine to Domain - Need info from local profile | Vista General | |||