#169204 - 2006-10-11 02:23 PM
Exchange Server Name
|
Benny69
Moderator
   
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Does anyone have a UDF to pull the Exchange Server name from Active Directory?
|
|
Top
|
|
|
|
#169207 - 2006-10-11 03:09 PM
Re: Exchange Server Name
|
Benny69
Moderator
   
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
all exchange servers on a given site
|
|
Top
|
|
|
|
#169209 - 2006-10-11 05:57 PM
Re: Exchange Server Name
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Give this a go...
Code:
; == Return the Name of all Exchange Servers ==================== $aAttributes = "Name" ;, "AdsPath" $sADsPath = "LDAP://"+GetObject("LDAP://rootDSE").Get("configurationNamingContext") $strFilter = "(&(objectClass=msExchExchangeServer)(Name=*))" $aResults = fnLDAPQuery($aAttributes,$sADsPath,$strFilter,"Name") @ERROR " | " @SERROR ? For $c = 0 to Ubound($aResults) For $r = 0 to UBound($aResults,2) $aResults[$c,$r] ? Next Next
Get $
|
|
Top
|
|
|
|
#169210 - 2006-10-11 06:26 PM
Re: Exchange Server Name
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I'm have a nametranslate issue...
Code:
$Userldap = TranslateName(1, @domain, 3, @ldomain+'\'+@userid, 1) $UserProperties = GetObject("LDAP://"+$UserLDAP[0])
$DNMailServer = $UserProperties.Get("msExchHomeServerName") ? $DNMailServer $Mailserver = TranslateName(1, @domain, 1, $DNMailServer , 3)
? "HomeServer is" + $MailServer[0]
$dnMailServer is returned as: /O=FLA GOV/OU=Domain/cn=Configuration/cn=Servers/cn=MAILServer
So I'm having trouble specifing the correct source translate type...
|
|
Top
|
|
|
|
#169212 - 2006-10-11 07:39 PM
Re: Exchange Server Name
|
Benny69
Moderator
   
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Chris, your code as usual works flawlessly. Thank you. Is there a way to look at a specific site? Or maybe you have added that ability and I am just missing it.
|
|
Top
|
|
|
|
#169215 - 2006-10-11 07:49 PM
Re: Exchange Server Name
|
Benny69
Moderator
   
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
I have never understood the filter thing could you elaborate on how the filter should be modified?
|
|
Top
|
|
|
|
#169216 - 2006-10-11 08:12 PM
Re: Exchange Server Name
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Well, maybe you can filter it with the legacyExchangeDN property. Then you could adjust the filter like so...
Code:
; == Return the Name of all Exchange Servers ==================== $aAttributes = "Name", "legacyExchangeDN" ;, "distinguishedName" $sADsPath = "LDAP://"+GetObject("LDAP://rootDSE").Get("configurationNamingContext") $strFilter = "(&(objectClass=msExchExchangeServer)(legacyExchangeDN=*OH*))" $aResults = fnLDAPQuery($aAttributes,$sADsPath,$strFilter,"Name") @ERROR " | " @SERROR ? For $c = 0 to Ubound($aResults) For $r = 0 to UBound($aResults,2) $aResults[$c,$r] ? Next Next
|
|
Top
|
|
|
|
#169217 - 2006-10-11 08:13 PM
Re: Exchange Server Name
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
|
|
Top
|
|
|
|
#169218 - 2006-10-11 08:33 PM
Re: Exchange Server Name
|
Benny69
Moderator
   
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Sweet! thanks for the help guys.
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1219 anonymous users online.
|
|
|