<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/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>Search results for 'sectionid:230' matching tags 'Remote PowerShell', 'Powershell', and 'Active Directory'</title><link>http://powershell.com/cs/search/SearchResults.aspx?q=sectionid%3A230&amp;tag=Remote+PowerShell%2CPowershell%2CActive+Directory&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'sectionid:230' matching tags 'Remote PowerShell', 'Powershell', and 'Active Directory'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Re: Call Exchange shell/cmdlets from Quest Shell - Proper method?</title><link>http://powershell.com/cs/forums/thread/17398.aspx</link><pubDate>Tue, 03 Jul 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:17398</guid><dc:creator>virtuallynothere</dc:creator><description>&lt;p&gt;Thanks, so the tools are installed on the system I need to run this script from, and I got this to work, so is this not recommended either?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;c:\program files\Microsoft\Exchange\V14\bin\RemoteExchange.ps1 ; connect-ExchangeServer - Auto&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is that OK or do I need to do the Remote session noted in your reply above?&lt;/p&gt;</description></item><item><title>Re: Call Exchange shell/cmdlets from Quest Shell - Proper method?</title><link>http://powershell.com/cs/forums/thread/17350.aspx</link><pubDate>Fri, 29 Jun 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:17350</guid><dc:creator>virtuallynothere</dc:creator><description>&lt;p&gt;I tried to do that, but when I run the get-pssnapin - registered the exchange tools don&amp;#39;t come back as registered.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Then I&amp;#39;ve read it&amp;#39;s not &amp;quot;supported&amp;quot; to add the snapin for the exchange tools in another shell aside from the exchange shell, so you should use a remote connection, and then I found another thread about using a command like the one below, but that fails as well as connect-exchangeserver is &amp;quot;unknown&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;#39;C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1&amp;#39;; Connect-ExchangeServer&amp;nbsp;&lt;/span&gt;&amp;lt;target server&amp;gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Call Exchange shell/cmdlets from Quest Shell - Proper method?</title><link>http://powershell.com/cs/forums/thread/17312.aspx</link><pubDate>Thu, 28 Jun 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:17312</guid><dc:creator>virtuallynothere</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;I now know the best methods of remoting thanks to Don &amp;amp; the folks here.&lt;/p&gt;
&lt;p&gt;But I have to use the Quest shell as we utilize their Active Role solution and I need to write a script that runs when something is done to users accounts through that system. &amp;nbsp;&lt;br /&gt;&lt;br /&gt;I know how to set it up and what commands I need to run, I am not sure of how to call the Exchange shell which installed locally or connect to Exchange in order to run the commands I need.&lt;br /&gt;&lt;br /&gt;Can anyone help me out?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Script to delete home folders for list of users</title><link>http://powershell.com/cs/forums/thread/16002.aspx</link><pubDate>Tue, 17 Apr 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:16002</guid><dc:creator>virtuallynothere</dc:creator><description>&lt;p&gt;I am trying to find a way to modify the script below or if anyone has a script that will delete home folders for a list of users if the user names are specified in a text or csv file, can anyone help?&lt;/p&gt;
&lt;p&gt;I would like to delete the user accounts as well, but the home folders is fine for now. &amp;nbsp;I want to do this for users in a specific ou and they have a stamped attribute on them from the Quest ActiveRole server, if i could query for users that have the attribute which is a date value, then return the list of users and delete the home folders if the date is within a specific time frame, IE: 7 days, then that would be ideal.&lt;/p&gt;
&lt;p&gt;The starting script I have will delete a folder for a single user:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;$psSession = New-PSSession -ComputerName HyperV -Credential nwtraders\administrator&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Invoke-Command -Session $PSSession -ScriptBlock {&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;$HD=$PD=$null&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;$Filter = &amp;quot;(&amp;amp;(ObjectCategory=user)(Name=helpme testuser))&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;$Searcher = [adsiSearcher]($Filter)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;$Searcher.Findall() |&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;ForEach-Object {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;$HD = $_.properties.homedirectory&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;$PD = $_.properties.profilepath&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;$PD = &amp;quot;$PD.V2&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;} #end foreach-object&lt;/span&gt;&lt;br /&gt;&lt;span&gt;} #end scriptblock&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&amp;quot;Taking ownership of $hd&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Invoke-Command -Session $PSSession -ScriptBlock `&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;{ Invoke-Expression &amp;quot;takeown /f $HD /r /d y&amp;quot; }&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;quot;Taking ownership of $pd&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Invoke-Command -Session $PSSession -ScriptBlock `&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;{ Invoke-Expression &amp;quot;takeown /f $PD /r /d y&amp;quot; }&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;quot;Adding Administrator Rights to $hd&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Invoke-Command -Session $PSSession -ScriptBlock `&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;{ Invoke-Expression &amp;quot;icacls $HD /grant administrators:F /t&amp;quot; }&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;quot;Adding Administrator Rights to $PD&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Invoke-Command -Session $PSSession -ScriptBlock `&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;{ Invoke-Expression &amp;quot;icacls $PD /grant administrators:F /t&amp;quot; }&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;quot;Removing folder $hd&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Invoke-Command -Session $PSSession -ScriptBlock `&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;{ Invoke-Expression &amp;quot;Remove-Item -Path $HD -Recurse -Force&amp;quot; }&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;quot;Removing Folder $PD&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Invoke-Command -Session $PSSession -ScriptBlock `&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;{ Invoke-Expression &amp;quot;RD $PD -Recurse -Force&amp;quot; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Remove-PSSession -Session $psSession&lt;/span&gt;
&lt;/p&gt;</description></item></channel></rss>