<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Adding Ou Structure using Powershell</title>
	<atom:link href="http://www.powershell.nu/2009/04/13/part-11-adding-ou-structure-using-powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.powershell.nu/2009/04/13/part-11-adding-ou-structure-using-powershell/</link>
	<description>Windows PowerShell</description>
	<lastBuildDate>Fri, 03 Feb 2012 09:00:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: M P</title>
		<link>http://www.powershell.nu/2009/04/13/part-11-adding-ou-structure-using-powershell/comment-page-1/#comment-9739</link>
		<dc:creator>M P</dc:creator>
		<pubDate>Fri, 13 Jan 2012 04:09:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=626#comment-9739</guid>
		<description>This isto pretty stalrr, but if youthat are still trying to figure it out. You added an extra $ in front of ou=Department while setting it initially.  Here is the corrected line.

$Department = $NewOU2.Create(“OrganizationalUnit”, “ou=Department”)</description>
		<content:encoded><![CDATA[<p>This isto pretty stalrr, but if youthat are still trying to figure it out. You added an extra $ in front of ou=Department while setting it initially.  Here is the corrected line.</p>
<p>$Department = $NewOU2.Create(“OrganizationalUnit”, “ou=Department”)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Illichevsky</title>
		<link>http://www.powershell.nu/2009/04/13/part-11-adding-ou-structure-using-powershell/comment-page-1/#comment-6846</link>
		<dc:creator>Steve Illichevsky</dc:creator>
		<pubDate>Tue, 14 Jun 2011 12:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=626#comment-6846</guid>
		<description>Hi! I try to do it. But i want create another struture. Office-Users-Department.
I try to do this with this script:

# Another connection
		$NewConnection2 = &quot;LDAP://OU=Users,OU=&quot; + $Series + ($Domain.Replace(&quot;.&quot;,&quot;,DC=&quot;)).Insert(0,&quot;,DC=&quot;)
		write-host $NewConnection2
		$NewOU2 = [adsi]$NewConnection2
		write-host [adsi]$NewConnection2
		$Department = $NewOU2.Create(&quot;OrganizationalUnit&quot;, &quot;ou=$Department&quot;)
		write-host $Department
		$Department.SetInfo()

		$Department.put(&quot;l&quot;, $Location)
		$Department.put(&quot;Description&quot;, $Department)
		$Department.setinfo()
 But it fail...

 LDAP://OU=Users,OU=Moscow Office,DC=office,DC=mega-lex,DC=local
[adsi]LDAP://OU=Users,OU=Moscow Office,DC=office,DC=mega-lex,DC=local
System.DirectoryServices.DirectoryEntry
Method invocation failed because [System.String] doesn&#039;t contain a method named &#039;SetInfo&#039;.
At C:\Users\still\Documents\Add-STOU.ps1:132 char:22
+         $Department.SetInfo &lt;&lt;&lt;&lt; ()
    + CategoryInfo          : InvalidOperation: (SetInfo:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

Where is my error? I can&#039;t find it...</description>
		<content:encoded><![CDATA[<p>Hi! I try to do it. But i want create another struture. Office-Users-Department.<br />
I try to do this with this script:</p>
<p># Another connection<br />
		$NewConnection2 = &#8220;LDAP://OU=Users,OU=&#8221; + $Series + ($Domain.Replace(&#8220;.&#8221;,&#8221;,DC=&#8221;)).Insert(0,&#8221;,DC=&#8221;)<br />
		write-host $NewConnection2<br />
		$NewOU2 = [adsi]$NewConnection2<br />
		write-host [adsi]$NewConnection2<br />
		$Department = $NewOU2.Create(&#8220;OrganizationalUnit&#8221;, &#8220;ou=$Department&#8221;)<br />
		write-host $Department<br />
		$Department.SetInfo()</p>
<p>		$Department.put(&#8220;l&#8221;, $Location)<br />
		$Department.put(&#8220;Description&#8221;, $Department)<br />
		$Department.setinfo()<br />
 But it fail&#8230;</p>
<p> LDAP://OU=Users,OU=Moscow Office,DC=office,DC=mega-lex,DC=local<br />
[adsi]LDAP://OU=Users,OU=Moscow Office,DC=office,DC=mega-lex,DC=local<br />
System.DirectoryServices.DirectoryEntry<br />
Method invocation failed because [System.String] doesn&#8217;t contain a method named &#8216;SetInfo&#8217;.<br />
At C:\Users\still\Documents\Add-STOU.ps1:132 char:22<br />
+         $Department.SetInfo &lt;&lt;&lt;&lt; ()<br />
    + CategoryInfo          : InvalidOperation: (SetInfo:String) [], RuntimeException<br />
    + FullyQualifiedErrorId : MethodNotFound</p>
<p>Where is my error? I can&#039;t find it&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

