Question Message erreur Setinfo()

Plus d'informations
il y a 13 ans 5 mois #7961 par ARRIVE
Message erreur Setinfo() a été créé par ARRIVE
Bonsoir à tous

J'ai besoin de faire quelque chose de simple, créer une OU.
[code:1]$objDomain = [ADSI]'LDAP://ou=COMPTES,dc=domaine,dc=priv'
$objOU = $objDomain.Create('organizationalUnit','ADMINNISTRATEURS')
$objOU.put('description','OU de test')
$objOU.SetInfo()[/code:1]

Théoriquement rien ,amis je ne comprends pas pourquoi est-ce que j'ai un message d'erreur :

Exception lors de l'appel de « SetInfo » avec « 0 » argument(s) : « Violation de nom. (Exception de HRESULT : 0x80072037) »
à : ligne:5 caractère:14
+ $objOU.SetInfo <<<< ()


Si quelqu'un peut m'expliquer car n'étant pas à l'aise avec le code, moi pas comprendre :(

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 13 ans 5 mois #7962 par Richard Lazaro
Réponse de Richard Lazaro sur le sujet Re:Message erreur Setinfo()
Voici un exemple (c'était pour un cookbook) :

[code:1]
$objDom = [ADSI]\"LDAP://server-ad.msit-france.com/dc=msit-france,dc=com\"
$objOu = $objDom.Create(\"organizationalUnit\",\"ou=Interns\"«»)
$objOu.SetInfo()
[/code:1]

donc à première vu, je dirais que tu as une faute dans ton code, essaye avec cela :

[code:1]
$objDomain = [ADSI]'LDAP://ou=COMPTES,dc=domaine,dc=priv'
$objOU = $objDomain.Create('organizationalUnit','ou=ADMINNISTRATEURS')
$objOU.put('description','OU de test')
$objOU.SetInfo()
[/code:1]

Bien Cordialement,
Richard Lazaro.

Think-MS : (Get-Life).Days | %{ Learn-More }

\\"Problems cannot be solved by the same level of thinking that created them.\\" - Albert Einstein

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 13 ans 5 mois #7963 par Richard Lazaro
Réponse de Richard Lazaro sur le sujet Re:Message erreur Setinfo()
Je cherche une explication claire à te fournir ... mais je trouve pas le 'man' de la méthode Create de la classe DirectoryEntry sur le msdn Oo

Think-MS : (Get-Life).Days | %{ Learn-More }

\\"Problems cannot be solved by the same level of thinking that created them.\\" - Albert Einstein

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 13 ans 5 mois #7964 par Laurent Dardenne
Salut,
Richard Lazaro écrit:

mais je trouve pas le 'man' de la méthode Create de la classe DirectoryEntry sur le msdn Oo

Peut être ici (Active Directory Service Interfaces (ADSI) is a set of COM interfaces used to access the features of directory services from different network providers. )

Tutoriels PowerShell

Connexion ou Créer un compte pour participer à la conversation.

Temps de génération de la page : 0.070 secondes
Propulsé par Kunena