|
| How to bind to AD without displaying the Distinguished Name |
 |
Thu, 17 Apr 2008 09:28:05 -070 |
Requirement:
Bind to Active Directory domain and if successful continue otherwise output
error.
Problem:
The problem here is when I bind to the domain the Distinguished Name is
displayed on the screen. In the script that I am working on I don't want the
DN to be displayed. I have tried the commands "$LDAPDN | out-null"
and
"[void]$LDAPDN" but they do not actually make the bind to the domain.
Any
help on binding to a domain without having it display the DN would be
appreciated.
Thanks,
Sample Code:
trap
{
Write-Host "Unable to bind to the domain."
Write-Debug "$_.exception.message"
Exit
}
$LDAPDN = [ADSI]("LDAP://$FQDN")
$LDAPDN
Write-Host "Bind to domain $FQDN was successful."
|
| Post Reply
|
|
|
|
|
|
|
|
|
|