12-28-2008
Downloads: 433
File size: 1.1kB
Views: 1,681
Embed
 |
gets basic domain information for currently logged on workstation |
- <
- .SYNOPSIS
- Shows use of GetCurrentDomain to return information about the domain
- .DESCRIPTION
- Uses system.directoryservices.activedirectory.domain and GetCurrentDomain
- to return domain information
- .NOTES
- File Name : get-domain.ps1
- Author : Thomas Lee - tfl@psp.co.uk
- Requires : PowerShell V2 CTP3
- .LINK
- http://www.pshscripts.blogspot.com
- .EXAMPLE
- PS c:\foo> .\get-domain.ps1
- You are connected to the cookham.net domain
- Role Holders in this domain:
- PDC Role Holder : Cookham1.cookham.net
- RID Role Holder : Cookham1.cookham.net
- InfraM Role Holder : Cookham1.cookham.net
-
-
-
-
-
-
-
- $domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
-
-
- "You are connected to the {0} domain" -f $domain.name
- "Role Holders in this domain:"
- " PDC Role Holder : {0}" -f $domain.PdcRoleOwner
- " RID Role Holder : {0}" -f $domain.RIDRoleOwner
- " InfraM Role Holder : {0}" -f $domain.InfrastructureRoleOwner
-
Gets domain name, plus domain FSMO role holders