Comment exécuter le script Set-DistributionGroupOwners.ps1 sans Active Directory Web Services (ADWS) ?
Bonjour à tous,
Le script fourni dans https://blogs.technet.com/b/exchange/archive/2011/05/04/how-to-manage-groups-with-groups-in-exchange-2010.aspx ne fonctionne que dans une forêt Active Directory disposant de Active Directory Web Services (ADWS). Cette fonctionnalité est activée par défaut sur les DC Windows Server 2008 R2 mais n’existe pas sur le DC Windows Server 2003/2008.
En l’absence d’ADWS, l’exécution du script va générer l’erreur suivante :
PS] C:\install>.\Set-DistributionGroupOwners.ps1 -DistributionGroup DL-Marketing -GroupOwner GS-MarketingDLOwners
WARNING: Error initializing default drive: 'Unable to find a default server with Active Directory Web Services running .'.
Setting GS-MarketingDLOwners as the owner of DL-Marketing
Get-ADGroup : Unable to find a default server with Active Directory Web Services running.
At line:1 char:77
+ Set-Distributiongroup -identity DL-Marketing -CustomAttribute5 (get-adgroup <<<< GS-MarketingDLOwners).distinguishedname
+ CategoryInfo : ResourceUnavailable: (GS-MarketingDLOwners:ADGroup) [Get-ADGroup], ADServerDownException
+ FullyQualifiedErrorId : Unable to find a default server with Active Directory Web Services running.,Microsoft.ActiveDirectory.Management.Commands.GetADGroup
Solutions:
- Méthode 1 : Déployer Active Directory Management Gateway Service (Active Directory Web Service for Windows Server 2003 and Windows Server 2008) https://www.microsoft.com/download/en/details.aspx?displaylang=en&id=2852
- Méthode 2 : Déployer un DC/GC Windows Server 2008 R2 en ayant pris en compte les prérequis et impacts sur votre système d’information. Voir https://technet.microsoft.com/en-us/library/upgrade-domain-controllers-to-windows-server-2008-r2(WS.10).aspx
- Méthode 3 : Le script ci-joint (à renommer en .ps1) ne nécessite pas la présence d’ADWS car il n’utilise pas la cmdlet Get-ADGroup. Pour son fonctionnement, se référer au blog de l’Equipe Exchange.
Bien entendu, à valider sur votre plateforme de test et pré-production avant mise en production :-)
------- English version -------
How to run the script Set-DistributionGroupOwners.ps1 without Active Directory Web Services (ADWS) ?
Hello All,
The script published on https://blogs.technet.com/b/exchange/archive/2011/05/04/how-to-manage-groups-with-groups-in-exchange-2010.aspx works only in an Active Directory forest that provide Active Directory Web Services (ADWS). This feature is enabled by default on the Windows Server 2008 R2 Domain Controller but doesn't existe natively on Windows Server 2003/2008 Domain Controllers.
Without ADWS, the script execute generate this kind of errors :
PS] C:\install>.\Set-DistributionGroupOwners.ps1 -DistributionGroup DL-Marketing -GroupOwner GS-MarketingDLOwners
WARNING: Error initializing default drive: 'Unable to find a default server with Active Directory Web Services running .'.
Setting GS-MarketingDLOwners as the owner of DL-Marketing
Get-ADGroup : Unable to find a default server with Active Directory Web Services running.
At line:1 char:77
+ Set-Distributiongroup -identity DL-Marketing -CustomAttribute5 (get-adgroup <<<< GS-MarketingDLOwners).distinguishedname
+ CategoryInfo : ResourceUnavailable: (GS-MarketingDLOwners:ADGroup) [Get-ADGroup], ADServerDownException
+ FullyQualifiedErrorId : Unable to find a default server with Active Directory Web Services running.,Microsoft.ActiveDirectory.Management.Commands.GetADGroup
Workaround:
- Method 1 : Deploy Active Directory Management Gateway Service (Active Directory Web Service for Windows Server 2003 and Windows Server 2008) https://www.microsoft.com/download/en/details.aspx?displaylang=en&id=2852
- Method 2 : Deploy a Windows Server 2008 R2 DC/GC after taken into account the prerequisites and impacts on your IT system. For more details, refer to https://technet.microsoft.com/en-us/library/upgrade-domain-controllers-to-windows-server-2008-r2(WS.10).aspx
- Method 3 : The attached script joined to this post (replace the extension with .ps1) doesn't need the ADWS feature to work because it doens't use Get-ADGroup cmdlet. For the script usage, refer to Exchange Team blog.
As a best practice, you must validate the scirpt in your lab and prepreoduction platform before deploying in your production environment :-)
Enjoy!
Didier Akakpo