<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Quick-Hits Friday: Run VBScript from the PowerShell Console, and Search for Multiple Extensions</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2010/09/17/add-runas-capability-to-vbscript-and-use-powershell-to-run-vbscript.aspx</link><description>Summary : The Microsoft Scripting Guys discuss adding Run As capability to VBScript and using Windows PowerShell to run VBScript. Also discussed: Searching for multiple extensions, and creating a local account and adding it to the local administrators</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Quick-Hits Friday: Run VBScript from the PowerShell Console, and Search for Multiple Extensions</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2010/09/17/add-runas-capability-to-vbscript-and-use-powershell-to-run-vbscript.aspx#3485185</link><pubDate>Wed, 07 Mar 2012 13:51:47 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3485185</guid><dc:creator>Chris Russo</dc:creator><description>&lt;p&gt;Hm, I figured it out. &amp;nbsp;You have a bug in your script... I changed it:&lt;/p&gt;
&lt;p&gt;$comp = [adsi] &amp;quot;WinNT://$computer&amp;quot;&lt;/p&gt;
&lt;p&gt;$newuser = $comp.Create(&amp;quot;User&amp;quot;, $user)&lt;/p&gt;
&lt;p&gt;$newuser.SetPassword($password)&lt;/p&gt;
&lt;p&gt;$newuser.SetInfo()&lt;/p&gt;
&lt;p&gt;You were setting $user = $comp.Create(&amp;quot;user&amp;quot;,$user). &amp;nbsp;I changed the target to $newuser.&lt;/p&gt;
&lt;p&gt;The second part of your script I&amp;#39;m still trying to figure out... not sure what it does, exactly, and it is still throwing an error.&lt;/p&gt;
&lt;p&gt;$objUser = [ADSI](&amp;quot;WinNT://$computer/$user,user&amp;quot;)&lt;/p&gt;
&lt;p&gt;$objGroup = [ADSI](&amp;quot;WinNT://$computer/Administrators,group&amp;quot;)&lt;/p&gt;
&lt;p&gt;$objGroup.PSBase.Invoke(&amp;quot;Add&amp;quot;,$User.PSBase.Path)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3485185" width="1" height="1"&gt;</description></item><item><title>re: Quick-Hits Friday: Run VBScript from the PowerShell Console, and Search for Multiple Extensions</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2010/09/17/add-runas-capability-to-vbscript-and-use-powershell-to-run-vbscript.aspx#3485180</link><pubDate>Wed, 07 Mar 2012 13:38:44 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3485180</guid><dc:creator>Chris Russo</dc:creator><description>&lt;p&gt;Hey, Scripting guy... no matter how many times I try your examples or ones like it (for creating users), I always get the same error. &amp;nbsp;It&amp;#39;s the same exception calling with 2 arguments problem, and copying and pasting your code verbatim simply never works. &amp;nbsp;Am I missing some key bit?&lt;/p&gt;
&lt;p&gt;If it matters, I&amp;#39;m on W7.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3485180" width="1" height="1"&gt;</description></item></channel></rss>