<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>Admin Development Model in Action</title><link>http://blogs.msdn.com/b/powershell/archive/2007/02/23/admin-development-model-in-action.aspx</link><description>Ken Taylor has a PowerShell blog over on LiveSpaces. Today he posted a blog entry, Enabling RDP with PowerShell , that had me jumping for joy as a perfect example of the Admin Development Model in action. The whole point of the admin development model</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Admin Development Model in Action</title><link>http://blogs.msdn.com/b/powershell/archive/2007/02/23/admin-development-model-in-action.aspx#3319703</link><pubDate>Fri, 15 Jun 2007 23:34:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3319703</guid><dc:creator>Eric Greer</dc:creator><description>&lt;p&gt;Awesome Thanks!&lt;/p&gt;
&lt;p&gt;For others:&lt;/p&gt;
&lt;p&gt;Example command after running the script above...&lt;/p&gt;
&lt;p&gt;set-rdp computer 1 0&lt;/p&gt;
&lt;p&gt;(sets rdp for computer on with no security)&lt;/p&gt;
&lt;p&gt;thanks again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3319703" width="1" height="1"&gt;</description></item><item><title>re: Admin Development Model in Action</title><link>http://blogs.msdn.com/b/powershell/archive/2007/02/23/admin-development-model-in-action.aspx#1830058</link><pubDate>Wed, 07 Mar 2007 21:37:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1830058</guid><dc:creator>Anesh</dc:creator><description>&lt;p&gt;Hi Jeffery, Pete and Ken,&lt;/p&gt;
&lt;p&gt; Thanks for posting this.&lt;/p&gt;
&lt;p&gt;I am having a problem.&lt;/p&gt;
&lt;p&gt;If I try to do this connecting from a machine1 not connected to domain to a machine2 (using the -credential option) in the domain, I always get a access denied error. However, it works when I use wmic.&lt;/p&gt;
&lt;p&gt;It does work when both machines are in the domain and the logged in user has credentials.&lt;/p&gt;
&lt;p&gt;I'd appreciate it if you can shed light on this.&lt;/p&gt;
&lt;p&gt; gwmi Win32_TerminalServiceSetting -Computer computername -credential domain\administrator&lt;/p&gt;
&lt;p&gt;format-default : Exception retrieving members: &amp;quot;Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;-----------&lt;/p&gt;
&lt;p&gt;WMIC /NODE:&amp;quot;computername&amp;quot; RDTOGGLE WHERE ServerName=&amp;quot;computername&amp;quot; CALL SetAllowTSConnections 1 /user:domain\administrator&lt;/p&gt;
&lt;p&gt;Enter the password :*******&lt;/p&gt;
&lt;p&gt;Executing (\\computername\ROOT\CIMV2:Win32_TerminalServiceSetting.ServerName=&amp;quot;computername&amp;quot;)-&amp;gt;SetAllowTSConnections()&lt;/p&gt;
&lt;p&gt;Method execution successful.&lt;/p&gt;
&lt;p&gt;Out Parameters:&lt;/p&gt;
&lt;p&gt;instance of __PARAMETERS&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ReturnValue = 0;&lt;/p&gt;
&lt;p&gt;};&lt;/p&gt;
&lt;p&gt;Thanks much.&lt;/p&gt;
&lt;p&gt;Anesh.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1830058" width="1" height="1"&gt;</description></item><item><title>re: Admin Development Model in Action</title><link>http://blogs.msdn.com/b/powershell/archive/2007/02/23/admin-development-model-in-action.aspx#1759158</link><pubDate>Mon, 26 Feb 2007 01:18:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1759158</guid><dc:creator>PowerShell Team</dc:creator><description>&lt;p&gt;Pete&lt;/p&gt;
&lt;p&gt;10,000 thanks for an example of the Community Development Model in action!&lt;/p&gt;
&lt;p&gt;Jeffrey Snover [MSFT]&lt;/p&gt;
&lt;p&gt;Windows PowerShell/MMC Architect&lt;/p&gt;
&lt;p&gt;Visit the Windows PowerShell Team blog at: &amp;nbsp; &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Visit the Windows PowerShell ScriptCenter at: &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1759158" width="1" height="1"&gt;</description></item><item><title>re: Admin Development Model in Action</title><link>http://blogs.msdn.com/b/powershell/archive/2007/02/23/admin-development-model-in-action.aspx#1758814</link><pubDate>Sun, 25 Feb 2007 23:11:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1758814</guid><dc:creator>Pete Gomersall</dc:creator><description>&lt;p&gt;So Jeffery,&lt;/p&gt;
&lt;p&gt;I apologize for yesterday’s brief comment/criticism and not fully entering into the community spirit and supplying a possible improvement myself – my excuse; it was Saturday and I had to go rock climbing!&lt;/p&gt;
&lt;p&gt;Now it is Sunday morning and I have time to give some better input.&lt;/p&gt;
&lt;p&gt;First I do not think that the WMI Win32_Terminal class that you and Ken used can enable or disable RDP. Following my finding that your code didn’t work on Vista I first found the namespace issue; on Vista all aspects of TS related issues have moved to root\CIMV2\TerminalServices namespace.&lt;/p&gt;
&lt;p&gt;Having changed the namespace issue I ran your modified function and looking in either the registry or the system tool the appropriate settings were not changed in HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server – fDenyTSConnections. So what was happening? Because I am still learning PowerShell (isn't everyone) not only do I use the shell for investigation I go back to my VBScript roots and didn’t use PowerShell to move further I actually used (shame upon shame) a GUI tool WMICodeCreator to do some investigation (as an aside I will be extactic will this tool is updated to support PowerShell - are there any takes yet?). It turns out that the WMI class responsible for the settings we need is – Win32_TerminalServiceSetting and the actual method involved is – SetAllowTSConnections.&lt;/p&gt;
&lt;p&gt;So here goes at my function; if I had more time and didn’t need to go climbing on Sunday as well I would have put in some checking of the arguments provide; such as for $Server “.” for local host or “a name” for remote; what is provided for $set On/Off or 1/0 and maybe same for the RDP 6.0 security- $Secure. Anyway here it is and constructive/destructive critique most welcome:&lt;/p&gt;
&lt;p&gt;Function Set-RDP ($Server, $Set, $Secure)&lt;/p&gt;
&lt;p&gt;{ $OS = gwmi Win32_OperatingSystem -Computer $Server&lt;/p&gt;
&lt;p&gt;If ($OS.BuildNumber -ge 6000){&lt;/p&gt;
&lt;p&gt;$Terminal = gwmi -namespace &amp;quot;root\CIMV2\TerminalServices&amp;quot; Win32_TerminalServiceSetting –Computer $Server &lt;/p&gt;
&lt;p&gt;$SetSecure = gwmi -namespace &amp;quot;root\CIMV2\TerminalServices&amp;quot; Win32_TSGeneralSetting –Computer $Server&lt;/p&gt;
&lt;p&gt;$Terminal.SetAllowTSConnections($Set)&lt;/p&gt;
&lt;p&gt;$SetSecure.SetUserAuthenticationRequired($Secure)&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Else {&lt;/p&gt;
&lt;p&gt;$Terminal = gwmi Win32_TerminalServiceSetting –Computer $Server &lt;/p&gt;
&lt;p&gt;$SetSecure = Win32_TSGeneralSetting –Computer $Server&lt;/p&gt;
&lt;p&gt;$Terminal.SetAllowTSConnections($Set)&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;I did test it on Vista.&lt;/p&gt;
&lt;p&gt;Enjoy,&lt;/p&gt;
&lt;p&gt;Pete&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1758814" width="1" height="1"&gt;</description></item><item><title>re: Admin Development Model in Action</title><link>http://blogs.msdn.com/b/powershell/archive/2007/02/23/admin-development-model-in-action.aspx#1753107</link><pubDate>Sat, 24 Feb 2007 19:27:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1753107</guid><dc:creator>Pete Gomersall</dc:creator><description>&lt;P&gt;Jeffery,&lt;/P&gt;
&lt;P&gt;Have you tried this against/on Vista? Do you need to brush up on your wmi namespaces? (only joking) Can you improve so it will work against all OS's and also disable as well as enable in same function? What about Vista's capability of setting differnt levels of RDP security?&lt;/P&gt;
&lt;P&gt;Pete&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1753107" width="1" height="1"&gt;</description></item></channel></rss>