Bonjour,
J'ai un petit script qui tourne, et qui est censé me sortir tous les utilisateurs de l'AD qui possède un UID.
Ce script marchait très bien, jusqu'à l'UID 10257.
Aujourd'hui, il ne vois plus aucun de mes nouveaux utilisateurs qui ont un UID supérieur à 10257.
Et tous les autres scripts d'administration reste bloqué comme lui.
Voila le script
Je ne sais pas ce qui peut bloquer, si quelqu'un à une idée, ca m'aiderait beaucoup.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 "compte;uid" > D:\Script_Fonc_a_valid\test\compte-UID.csv [void][system.Reflection.Assembly]::LoadWithPartialName('System.windows.forms') [void][reflection.assembly]::loadwithpartialname('System.drawing') $Root1 = New-Object DirectoryServices.DirectoryEntry # Create a selector and start searching from the Root of AD $selector1 = New-Object DirectoryServices.DirectorySearcher $selector1.SearchRoot = $root1 # Filter the users with -like "CN=Person*". Note the ForEach loop $adobj1= $selector1.findall() ` | where {$_.properties.objectcategory -like "CN=Person*"} ForEach ($person1 in $adobj1) { $prop1= $($person1.properties.samaccountname) [int]$prop21= $($person1.properties.uidnumber) #if ($prop2 -ne "0") { "$prop1;$prop21" >> D:\Script_Fonc_a_valid\test\compte-UID.csv }
Merci d'avance
Partager