Hi,
this post describes the command line to get a list of all subnets for an Active Directory Site. The ds* commands are part of the Active Directory tools on Server and of RSAT Tools on Windows 7-10.
Continue reading Active Directory: Command line to get all subnets for a site →
Hi,
there are multiple active console connections and you want to know who are currently connected?
Continue reading VMware: List Users who have a active Console Connection to a virtual machine →
Hi,
just a short post :-). A powershell script to get the NetBIOS Name of an Active Directory Domain
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | [reflection.assembly] ::LoadWithPartialName( "System.DirectoryServices.Protocols" ) |Out -Null
if ( $args .count -ne 1){
Write-Warning " Start script with fqdn as parameter"
Write-Warning ( " for example: " + $myInvocation .myCommand.name+ " yourdomain.com" )
exit 1
}
$sDomainName = $args [0]
$oRootDSE = [ADSI] "LDAP://RootDSE"
$sConfig = $oRootDSE .Get( "configurationNamingContext" )
$oADSearchRoot = New-object System.DirectoryServices.DirectoryEntry( "LDAP://CN=Partitions," + $sConfig )
$sSearchString = "(&(objectclass=Crossref)(dnsRoot=" + $sDomainName + ")(netBIOSName=*))"
$oSearch = New-Object directoryservices.DirectorySearcher( $oADSearchRoot , $sSearchString )
$sNetBIOSName =( $oSearch .FindOne()).Properties[ "netbiosname" ]
Write-Host "Domain NetBIOS Name:" $sNetBIOSName
|
Have fun :-)!
Michael
My Knowledgebase for things about Linux, Windows, VMware, Electronic and so on…