<?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: vSphere permissions: export &amp; import &#8211; Part 2</title>
	<atom:link href="http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/</link>
	<description>Virtually everything is poshable</description>
	<lastBuildDate>Sat, 11 Feb 2012 14:14:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Matt</title>
		<link>http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/#comment-7053</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 14 Jul 2011 23:50:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=670#comment-7053</guid>
		<description>That makes sense now why LucD&#039;s suggestion didn&#039;t work for me.  The forum is dropping out the dummy variable in my line.  Here it is with underscores...
$vInventory =[xml][/xml]“__”</description>
		<content:encoded><![CDATA[<p>That makes sense now why LucD&#8217;s suggestion didn&#8217;t work for me.  The forum is dropping out the dummy variable in my line.  Here it is with underscores&#8230;<br />
$vInventory =“__”</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/#comment-7052</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 14 Jul 2011 23:47:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=670#comment-7052</guid>
		<description>Changing line 35 to &quot;$vInventory =[xml][/xml]“”&quot; worked for me.  All custom roles are added properly except for the last one.  I get the same error that Rj.Aguilera gets.  I&#039;ll just add that one manually for now.</description>
		<content:encoded><![CDATA[<p>Changing line 35 to &#8220;$vInventory =“”&#8221; worked for me.  All custom roles are added properly except for the last one.  I get the same error that Rj.Aguilera gets.  I&#8217;ll just add that one manually for now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/#comment-6969</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Wed, 06 Jul 2011 12:44:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=670#comment-6969</guid>
		<description>Hey LucD - Thanks for the Export/Import script.  This will prove very useful for me in my upgrade from vCenter 2.5 to 4.1.  I&#039;m testing it in my lab environment and I&#039;m getting an error on the import.  ( I got your fixed export script on the VMware forums.)  
I updated line 35 as mentioned above and I&#039;m getting the error below.  

Any help you can provide is appreciated!   
----------------------

Cannot convert value &quot;&quot; to type &quot;System.Xml.XmlDocument&quot;. Error: &quot;Root element is missing.&quot;

At C:\VM_permissions_import.ps1:36 char:17
+ [XML]$vInventory &lt;&lt;&lt;&lt;  = &quot;&quot;
    + CategoryInfo          : MetadataError: (:) [], ArgumentTransformationMet
   adataException
    + FullyQualifiedErrorId : RuntimeException</description>
		<content:encoded><![CDATA[<p>Hey LucD &#8211; Thanks for the Export/Import script.  This will prove very useful for me in my upgrade from vCenter 2.5 to 4.1.  I&#8217;m testing it in my lab environment and I&#8217;m getting an error on the import.  ( I got your fixed export script on the VMware forums.)<br />
I updated line 35 as mentioned above and I&#8217;m getting the error below.  </p>
<p>Any help you can provide is appreciated!<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Cannot convert value &#8220;&#8221; to type &#8220;System.Xml.XmlDocument&#8221;. Error: &#8220;Root element is missing.&#8221;</p>
<p>At C:\VM_permissions_import.ps1:36 char:17<br />
+ [XML]$vInventory &lt;&lt;&lt;&lt;  = &quot;&quot;<br />
    + CategoryInfo          : MetadataError: (:) [], ArgumentTransformationMet<br />
   adataException<br />
    + FullyQualifiedErrorId : RuntimeException</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Youd</title>
		<link>http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/#comment-3636</link>
		<dc:creator>Doug Youd</dc:creator>
		<pubDate>Thu, 09 Dec 2010 05:34:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=670#comment-3636</guid>
		<description>Nice work again Alan,

I&#039;m stealing some snippets of this to periodically re-create roles in my test environment from prod.

I did encounter the same errors as Simon... So I opted to use a different method of setting up the xml template.

function create-XMLTemplate([String]$XMLTemplateFile)
{
	$input &#124; Out-File $XMLTemplateFile -encoding UTF8
}

$vInventory = New-Object XML
$vInventoryData = @&#039;&#039;@
$vInventoryData &#124; create-XMLTemplate $rolesReportLocation
$vInventory.load($rolesReportLocation)

Thanks for saving me some time... again :)
Doug</description>
		<content:encoded><![CDATA[<p>Nice work again Alan,</p>
<p>I&#8217;m stealing some snippets of this to periodically re-create roles in my test environment from prod.</p>
<p>I did encounter the same errors as Simon&#8230; So I opted to use a different method of setting up the xml template.</p>
<p>function create-XMLTemplate([String]$XMLTemplateFile)<br />
{<br />
	$input | Out-File $XMLTemplateFile -encoding UTF8<br />
}</p>
<p>$vInventory = New-Object XML<br />
$vInventoryData = @&#8221;@<br />
$vInventoryData | create-XMLTemplate $rolesReportLocation<br />
$vInventory.load($rolesReportLocation)</p>
<p>Thanks for saving me some time&#8230; again <img src='http://www.virtu-al.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Youd</title>
		<link>http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/#comment-3635</link>
		<dc:creator>Doug Youd</dc:creator>
		<pubDate>Thu, 09 Dec 2010 01:42:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=670#comment-3635</guid>
		<description>Nice work again Alan,

I&#039;m stealing some snippets of this to periodically re-create roles in my test environment from prod.

Thanks for saving me some time... again :)
Doug</description>
		<content:encoded><![CDATA[<p>Nice work again Alan,</p>
<p>I&#8217;m stealing some snippets of this to periodically re-create roles in my test environment from prod.</p>
<p>Thanks for saving me some time&#8230; again <img src='http://www.virtu-al.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rj.Aguilera</title>
		<link>http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/#comment-2683</link>
		<dc:creator>Rj.Aguilera</dc:creator>
		<pubDate>Mon, 13 Sep 2010 09:52:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=670#comment-2683</guid>
		<description>Hi. Great job LucD!

I get this error

Exception calling &quot;SetEntityPermissions&quot; with &quot;2&quot; argument(s): &quot;entity&quot;
At C:\Users\A\AppData\Local\Temp\2\116fb4a3-242b-4d1f-814d-9b8278aeabc3.p
s1:54 char:43
+     $perms = $authMgr.SetEntityPermissions &lt;&lt;&lt;&lt; ($object.MoRef,@($permission)
)
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException</description>
		<content:encoded><![CDATA[<p>Hi. Great job LucD!</p>
<p>I get this error</p>
<p>Exception calling &#8220;SetEntityPermissions&#8221; with &#8220;2&#8243; argument(s): &#8220;entity&#8221;<br />
At C:\Users\A\AppData\Local\Temp\2\116fb4a3-242b-4d1f-814d-9b8278aeabc3.p<br />
s1:54 char:43<br />
+     $perms = $authMgr.SetEntityPermissions &lt;&lt;&lt;&lt; ($object.MoRef,@($permission)<br />
)<br />
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException<br />
    + FullyQualifiedErrorId : DotNetMethodException</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Long</title>
		<link>http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/#comment-2354</link>
		<dc:creator>Simon Long</dc:creator>
		<pubDate>Fri, 21 May 2010 07:53:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=670#comment-2354</guid>
		<description>Hi Luc, I now get this error:

Cannot convert value &quot;[/xml]&quot; to type &quot;System.Xml.XmlDocument&quot;. Error: &quot;Data at the root level is invalid. Line 1, position 1.&quot;
At :line:36 char:11
+ $vInventory &lt;&lt;&lt;&lt;  = &quot;[/xml]&quot;</description>
		<content:encoded><![CDATA[<p>Hi Luc, I now get this error:</p>
<p>Cannot convert value &#8220;[/xml]&#8221; to type &#8220;System.Xml.XmlDocument&#8221;. Error: &#8220;Data at the root level is invalid. Line 1, position 1.&#8221;<br />
At :line:36 char:11<br />
+ $vInventory &lt;&lt;&lt;&lt;  = &quot;[/xml]&quot;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LucD</title>
		<link>http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/#comment-2351</link>
		<dc:creator>LucD</dc:creator>
		<pubDate>Thu, 20 May 2010 19:36:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=670#comment-2351</guid>
		<description>Simon, in PS v2 line 35 should be
$vInventory = [xml][/xml]&quot;&quot;
Can you give that a try ?</description>
		<content:encoded><![CDATA[<p>Simon, in PS v2 line 35 should be<br />
$vInventory = &#8220;&#8221;<br />
Can you give that a try ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Long</title>
		<link>http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/#comment-2350</link>
		<dc:creator>Simon Long</dc:creator>
		<pubDate>Thu, 20 May 2010 16:47:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=670#comment-2350</guid>
		<description>Hi Alan, I&#039;m trying to run this import script and I am getting the following error:

Exception calling &quot;AddAuthorizationRole&quot; with &quot;2&quot; argument(s): &quot;A specified parameter was not correct. 
privIds&quot;
At :line:8 char:39
+ $roleId = $authMgr.AddAuthorizationRole &lt;&lt;&lt;&lt; ($name,$privIds)

Any idea?

Simon</description>
		<content:encoded><![CDATA[<p>Hi Alan, I&#8217;m trying to run this import script and I am getting the following error:</p>
<p>Exception calling &#8220;AddAuthorizationRole&#8221; with &#8220;2&#8243; argument(s): &#8220;A specified parameter was not correct.<br />
privIds&#8221;<br />
At :line:8 char:39<br />
+ $roleId = $authMgr.AddAuthorizationRole &lt;&lt;&lt;&lt; ($name,$privIds)</p>
<p>Any idea?</p>
<p>Simon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Long</title>
		<link>http://www.virtu-al.net/2009/06/14/vsphere-permissions-export-import-part-2/#comment-2349</link>
		<dc:creator>Simon Long</dc:creator>
		<pubDate>Thu, 20 May 2010 14:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=670#comment-2349</guid>
		<description>Hi Rutch, Change line 35 to this:

[XML]$vInventory = &quot;&quot;

Regards

Simon</description>
		<content:encoded><![CDATA[<p>Hi Rutch, Change line 35 to this:</p>
<p>[XML]$vInventory = &#8220;&#8221;</p>
<p>Regards</p>
<p>Simon</p>
]]></content:encoded>
	</item>
</channel>
</rss>

