<p>Je dois ajouter environ 500 utilisateurs à une OU dans AD.</p>
<p>J’ai scripté tout ce dont j’ai besoin, cependant, j’obtiens l’erreur :<br>
<code>the name provided is not a properly formed</code></p>
<p>Voici le script</p>
<pre><code class="lang-auto">New-ADUser -Name C080CAB1-9756-409F-914D-AE3971F67DE7 -Path "OU=Staging,DC=domain,DC=local" -accountPassword (convertto-securestring "zagreb+scotch8355" -asplaintext -force) -PasswordNeverExpires $True -CannotChangePassword $false -Enabled $true
</code></pre>
<p>J’ai effectué quelques tests pour confirmer le problème :</p>
<pre><code class="lang-auto">New-ADUser -Name "C080CAB1-9756-409F-914D-AE3971F67DE7" -Path "OU=Staging,DC=domain,DC=local" -accountPassword (convertto-securestring "zagreb+scotch8355" -asplaintext -force) -PasswordNeverExpires $True -CannotChangePassword $false -Enabled $true
New-ADUser -Name 'C080CAB1-9756-409F-914D-AE3971F67DE7' -Path "OU=Staging,DC=domain,DC=local" -accountPassword (convertto-securestring "zagreb+scotch8355" -asplaintext -force) -PasswordNeverExpires $True -CannotChangePassword $false -Enabled $true
New-ADUser -Name C080CAB1-9756-409F-914D-AE3971F67DE7 -Path "OU=Staging,DC=domain,DC=local" -accountPassword (convertto-securestring "zagreb+scotch8355" -asplaintext -force) -PasswordNeverExpires $True -CannotChangePassword $false -Enabled $true
</code></pre>
<p>Ainsi que quelques autres variantes.</p>
<p>Ce qui a fonctionné :</p>
<pre><code class="lang-auto">New-ADUser -Name C080CAB1-9756-409F -Path "OU=Staging,DC=domain,DC=local" -accountPassword (convertto-securestring "zagreb+scotch8355" -asplaintext -force) -PasswordNeverExpires $True -CannotChangePassword $false -Enabled $true
</code></pre>
<p>Je pense donc que c’est peut-être un problème de longueur mais je ne suis pas sûr de comment faire fonctionner le script.</p>