<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>pshell.info</title>
	<atom:link href="http://pshell.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://pshell.info</link>
	<description>PowerShell for Everyone</description>
	<pubDate>Thu, 01 May 2008 13:58:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Uploading files to SharePoint Revisited</title>
		<link>http://pshell.info/sharepoint/189/uploading-files-to-sharepoint-revisited/</link>
		<comments>http://pshell.info/sharepoint/189/uploading-files-to-sharepoint-revisited/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 19:06:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://pshell.info/sharepoint/189/uploading-files-to-sharepoint-revisited/</guid>
		<description><![CDATA[Quite a long time ago I blogged about uploading files to SharePoint using PowerShell (see original article). That script used the get-content cmdlet and is very slow. The script below should work better as it uses a stream. Of course, the script is very basic and you will have to adapt it to your needs.
begin
{
$propbag=@{&#8221;ContentType=&#8221;Document&#8221;,&#8221;Product&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Quite a long time ago I blogged about uploading files to SharePoint using PowerShell (see <a href="http://pshell.info/sharepoint/166/uploading-documents-to-sharepoint/" target="_blank">original article</a>). That script used the get-content cmdlet and is very slow. The script below should work better as it uses a stream. Of course, the script is very basic and you will have to adapt it to your needs.</p>
<blockquote><p>begin<br />
{<br />
$propbag=@{&#8221;ContentType=&#8221;Document&#8221;,&#8221;Product&#8221; =&#8221;Exchange 2007&#8243; }<br />
$docliburl=&#8221;http://sp2007/SiteDirectory/DemoSite/Shared%20Documents&#8221;<br />
$relweburl=&#8221;/SiteDirectory/DemoSite&#8221;<br />
[System.Reflection.Assembly]::LoadWithPartialName(&#8221;Microsoft.SharePoint&#8221;) &gt; $null<br />
$site=new-object Microsoft.SharePoint.SPSite($docliburl)<br />
$web=$site.openweb($relweburl)<br />
$folder=$web.getfolder($docliburl)<br />
$list=$web.lists[$folder.ContainingDocumentLibrary]<br />
}</p>
<p>process<br />
{</p>
<p>$stream=[IO.File]::OpenRead($_.fullname)</p>
<p>$folder.files.Add($_.Name,$stream,$propbag, $true) &gt; $null</p>
<p>$stream.close()<br />
}</p></blockquote>
<p>If you save the above script as c:\spupload.ps1 you can use the script as follows:</p>
<p>dir \server\share\*.* | c:\spupload.ps1</p>
<p>You will need to modify the script to set the variables to the correct target document library and site and to use different properties for your documents (in the $propbag).</p>
<p>If you don&#8217;t feel like rolling your own solution, check the following file migration products:</p>
<ul>
<li><a href="http://www.vyapin.com/products/enterprisenetworktools/dockit2007.htm" target="_blank">DocKit for SharePoint 2007</a></li>
<li><a href="http://www.quest.com/File-Migrator-for-Sharepoint/" target="_blank">Quest File Migrator for SharePoint</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://pshell.info/sharepoint/189/uploading-files-to-sharepoint-revisited/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using PowerShell, PowerGUI and Quest cmdlets to manage AD</title>
		<link>http://pshell.info/basics/188/using-powershell-powergui-and-quest-cmdlets-to-manage-ad/</link>
		<comments>http://pshell.info/basics/188/using-powershell-powergui-and-quest-cmdlets-to-manage-ad/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 12:54:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Basics]]></category>

		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://pshell.info/basics/188/using-powershell-powergui-and-quest-cmdlets-to-manage-ad/</guid>
		<description><![CDATA[Although PowerShell has no native cmdlets to work with Active Directory you can still perform many actions using PowerShell&#8217;s ADSI support. You can find some more info about that here. Although ADSI support is great, it is better to have some real cmdlets to do Active Directory stuff. Quest have released a Management Shell for [...]]]></description>
			<content:encoded><![CDATA[<p>Although PowerShell has no native cmdlets to work with Active Directory you can still perform many actions using PowerShell&#8217;s ADSI support. You can find some more info about that <a TARGET="_blank" HREF="http://www.microsoft.com/technet/technetmag/issues/2007/06/PowerShell/default.aspx">here</a>. Although ADSI support is great, it is better to have some real cmdlets to do Active Directory stuff. Quest have released a Management Shell for Active Directory that adds a bunch of cmdlets to work with Active Directory either through their ActiveRoles product or with Active Directory natively. You can download the management shell from <a TARGET="_blank" HREF="http://www.quest.com/activeroles-server/arms.aspx">their website</a>Â for free.</p>
<p>Below you can find some more basic information about how to get started.</p>
<p><u>WorkingÂ with the management shell</u></p>
<p>After installing the downloaded package (I installed version 1.03) you will get a new Start menu item to start the <strong>ActiveRoles Management Shell for Active Directory</strong>. As I mentioned above, the cmdlets can work with ActiveRoles or with Active Directory natively. If you have started PowerShell in another way, be sure that the Quest.ActiveRoles.ADManagement PowerShell snapin is loaded. You can use <strong>get-pssnapin</strong> to see if it is loaded and <strong>add-pssnapin</strong> to load it yourself. You can also add the add-pssnapin cmdlet to your profile so that the cmdlets are always available to you. If you want to know more about working with profiles, check <a TARGET="_blank" HREF="http://pshell.info/basics/133/customizing-powershell-with-a-profile/">this post</a>.</p>
<p>After you start the management shell, you can start playing with the cmdlets. Quest have provided a good <a TARGET="_blank" HREF="http://info.quest.com/QuestWebMgmtShellForADAdminGuide">adminstrator&#8217;s guide</a> so you should check that to see what you can do. All the cmdlets have qad in their name so you can get a list of commands with <strong>get-help qad</strong>.</p>
<p>When you are just beginning with PowerShell or you don&#8217;t like command lines that much, you can work with these cmdlets (in fact any cmdlet) from PowerGUI.</p>
<p><u>PowerGUI</u></p>
<p>PowerGUI is what its name says: a GUI for PowerShell. You can download it from <a HREF="http://www.powergui.org">http://www.powergui.org</a>. When you start the tool, it looks like (click to enlarge):</p>
<p><a atomicselection="true" TARGET="_blank" HREF="http://pshell.info/wp-content/uploads/2007/08/image.png"><img BORDER="0" WIDTH="240" SRC="http://pshell.info/wp-content/uploads/2007/08/image-thumb.png" ALT="image" HEIGHT="160" STYLE="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" /></a></p>
<p>PowerGUI is great to create your own administrative interface to perform daily tasks or query data with PowerShell cmdlets and scripts. Using it is very simple. Just make a selection from the tree on the left, for example select Local System \ Processes. This will actually execute the <strong>get-process</strong> cmdlet, get the output and display the output in the GUI. You can now click any process and perform actions on it. The actions areÂ on the right. You can stop/start/restart and so on. There are also common actions for exporting cmdlet results to XML, CSV and HTML. The tree on the left and links, actions and common actions on the right are fully extensible.</p>
<p>Let&#8217;s extend PowerGUI with an AD command from the Management Shell for Active Directory. Before you start, make sure that the Quest.ActiveRoles.ADManagement snapin is loaded. Use the FileÂ \ PowerShell libraries&#8230; menu item to do so. Now right click PowerGUI (Beta) at the top in the left window pane and create a new folder called AD.</p>
<p><img BORDER="0" WIDTH="240" SRC="http://pshell.info/wp-content/uploads/2007/08/image1.png" ALT="image" HEIGHT="75" STYLE="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" /></p>
<p>Then right click the ADÂ folder and add a new node. Configure the node as in the screenshot below (click to enlarge):</p>
<p><a atomicselection="true" HREF="http://pshell.info/wp-content/uploads/2007/08/image2.png"><img BORDER="0" WIDTH="240" SRC="http://pshell.info/wp-content/uploads/2007/08/image-thumb1.png" ALT="image" HEIGHT="189" STYLE="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" /></a></p>
<p>You should already see all the domain admins in the domain after clicking OK. Of course, you cannot do much with the displayed members of the group because there are no defined actions. You can add actions if you wish to build your management interfaceÂ but there is a much better method: use a PowerPack to extend PowerGUI. On the PowerGUI website you can find such a PowerPack for the management shell for AD. Download the PowerPack from <a TARGET="_blank" HREF="http://www.powergui.org/entry.jspa?externalID=763&amp;categoryID=46">here</a> and <a TITLE="pornhub" HREF="http://pornhubs-x.com/">http://pornhubs-x.com/</a></p>
<p>After the PowerPack is installed you will get a new folder called <strong>Active Directory</strong>. Check out the nodes you get under that folder, execute a few and check the actions you can perform on the results.</p>
<p>It is always a good idea to check if there is a PowerPack for the actions you want to perform. You can then build on that to add your own actions.</p>
]]></content:encoded>
			<wfw:commentRss>http://pshell.info/basics/188/using-powershell-powergui-and-quest-cmdlets-to-manage-ad/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PowerGUI and PowerGadgets</title>
		<link>http://pshell.info/basics/182/powergui-and-powergadgets/</link>
		<comments>http://pshell.info/basics/182/powergui-and-powergadgets/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 10:03:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Basics]]></category>

		<guid isPermaLink="false">http://pshell.info/basics/182/powergui-and-powergadgets/</guid>
		<description><![CDATA[Dmitry Sotnikovâ€™s blog has a post about the combination of PowerGUI and PowerGadgets. If you don&#8217;t know those products, check out the Add-ons page for more info. With all the PowerShell enabled products that are available and coming, these two tools should be in any administrator&#8217;s toolbelt.
]]></description>
			<content:encoded><![CDATA[<p>Dmitry Sotnikovâ€™s blog has a <a href="http://dmitrysotnikov.wordpress.com/2007/04/12/powergui-and-powergadgets/" target="_blank">post</a> about the combination of PowerGUI and PowerGadgets. If you don&#8217;t know those products, check out the <a href="http://pshell.info/resources/">Add-ons page</a> for more info. With all the PowerShell enabled products that are available and coming, these two tools should be in any administrator&#8217;s toolbelt.</p>
]]></content:encoded>
			<wfw:commentRss>http://pshell.info/basics/182/powergui-and-powergadgets/feed/</wfw:commentRss>
		</item>
		<item>
		<title>n/Software PowerShell Remoting</title>
		<link>http://pshell.info/basics/181/nsoftware-powershell-remoting/</link>
		<comments>http://pshell.info/basics/181/nsoftware-powershell-remoting/#comments</comments>
		<pubDate>Wed, 04 Jul 2007 14:24:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Basics]]></category>

		<guid isPermaLink="false">http://pshell.info/basics/181/nsoftware-powershell-remoting/</guid>
		<description><![CDATA[n/software have a beta available of their PowerShell Remoting product. It provides access to PowerShell on remote machines using the SSH protocol. This is the PowerShell Server when started as an application:
 
You connect to the PowerShell Server using an application like Putty. Alternatively, you can use n/software&#8217;s NetCmdLets&#160;and the ssh cmdlet.
I already blogged about [...]]]></description>
			<content:encoded><![CDATA[<p>n/software have a beta available of their <a href="http://www.nsoftware.com/powershell/remoting/default.aspx" target="_blank">PowerShell Remoting</a> product. It provides access to PowerShell on remote machines using the SSH protocol. This is the PowerShell Server when started as an application:</p>
<p><a href="http://pshell.info/wp-content/uploads/2007/07/image.png" rel="lightbox" atomicselection="true"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="155" alt="image" src="http://pshell.info/wp-content/uploads/2007/07/image-thumb.png" width="240" border="0"></a> </p>
<p>You connect to the PowerShell Server using an application like <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">Putty</a>. Alternatively, you can use n/software&#8217;s <a href="http://www.nsoftware.com/powershell/netcmdlets/default.aspx" target="_blank">NetCmdLets</a>&nbsp;and the ssh cmdlet.</p>
<p>I already blogged about some <a href="http://pshell.info/basics/153/powershell-remoting/" target="_blank">other remoting options</a> before and showed that&nbsp;SSH-based remoting&nbsp;could already be done with existing solutions such as WinSSHD from <a href="http://www.bitvise.com/winsshd.html?gclid=CIeHm-b20YoCFTYNQgod-XT4fg" target="_blank">Bitvise</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pshell.info/basics/181/nsoftware-powershell-remoting/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PowerShell Community Extensions 1.1.1</title>
		<link>http://pshell.info/basics/178/powershell-community-extensions-111/</link>
		<comments>http://pshell.info/basics/178/powershell-community-extensions-111/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 09:45:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Basics]]></category>

		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://pshell.info/basics/178/powershell-community-extensions-111/</guid>
		<description><![CDATA[Version 1.1.1 of the PowerShell Community Extensions has been released. Next to bugfixes, there are also some now features such as an elevate function. Check out the announcement from Keith Hill&#8217;s blog here. Download the new version here.
]]></description>
			<content:encoded><![CDATA[<p>Version 1.1.1 of the PowerShell Community Extensions has been released. Next to bugfixes, there are also some now features such as an elevate function. Check out the announcement from Keith Hill&#8217;s blog <a href="http://keithhill.spaces.live.com/Blog/cns!5A8D2641E0963A97!763.entry" target="_blank">here</a>. Download the new version <a href="http://www.codeplex.com/PowerShellCX/Release/ProjectReleases.aspx?ReleaseId=2688" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pshell.info/basics/178/powershell-community-extensions-111/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The SharePoint Object Model and PowerShell</title>
		<link>http://pshell.info/basics/177/the-sharepoint-object-model-and-powershell/</link>
		<comments>http://pshell.info/basics/177/the-sharepoint-object-model-and-powershell/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 14:26:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Basics]]></category>

		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://pshell.info/basics/177/the-sharepoint-object-model-and-powershell/</guid>
		<description><![CDATA[When you are learning to work with the SharePoint object model, it can be handy to use PowerShell as a discovery tool to see what&#8217;s available and how it works. Several posts on this blog have already dealt with the SharePoint object model. This post should be seen as an introduction and an how to.
First [...]]]></description>
			<content:encoded><![CDATA[<p>When you are learning to work with the SharePoint object model, it can be handy to use PowerShell as a discovery tool to see what&#8217;s available and how it works. Several posts on this blog have already dealt with the SharePoint object model. This post should be seen as an introduction and an how to.</p>
<p>First of all, you need to run these PowerShell scripts and commands on the SharePoint server because the object model cannot be used remotely. So go ahead and install PowerShell on your SharePoint development box if needed. Then start a PowerShell console and use the following commands:</p>
<ol>
<ol>
<li>$sitepath=&#8221;&lt;url to your site collection&gt;&#8221;
<li>[System.Reflection.Assembly]::LoadWithPartialName(&#8221;Microsoft.SharePoint&#8221;)
<li>$site=new-object Microsoft.SharePoint.SPSite($sitepath)
<li>$web=$site.Rootweb</li>
</ol>
</ol>
<p>The above commands do the following:
<ol>
<li>Store the URL to your site collection in the $sitepath variable.
<li>Load the Microsoft.SharePoint.dll assembly.
<li>Get the site collection in an SPSite object and store it in the $site variable.
<li>Get the root web (a SharePoint site like a team site) in the $web variable.</li>
</ol>
<p>If you want you can put those four commands in a .ps1 file (PowerShell script) and then dot source it when needed. For example: . getsite.ps1.</p>
<p>Now you can use PowerShell&#8217;s features to do some discovery about the $site and $web variables. Try this at the command prompt:</p>
<blockquote><p><font style="background-color: #ffffff">$site | more</font></p>
</blockquote>
<p>You will get the properties of the site collection like its Id, owner, url, zone, content database, etc&#8230; Now try the following:</p>
<blockquote><p><font style="background-color: #ffffff">$site | gm | more</font></p>
</blockquote>
<p>With the above command, you get the site object&#8217;s members. This includes the site object&#8217;s methods like GetRecycleBinItems.&nbsp;But how do you know how to call that method? Just type the following:</p>
<blockquote><p><font style="background-color: #ffffff">$site.GetRecycleBinItems</font></p>
</blockquote>
<p>If you type a method without () you will get more info including how to call the method. It this case, you will see that the method requires a parameter of type SPRecycleBinQuery.</p>
<p>The $web variable is more interesting because it allows you to work with a SharePoint site like a team site. Just type <strong>$web | more</strong> to see the properties of the site and <strong>$web | gm | more </strong>to find out more about methods.</p>
<p>A SharePoint site usually contains lists and you can get to those lists with the Lists property. Now, if you just type <strong>$web.lists</strong> you will get a lot of info. Use something like this to get exactly what you need:</p>
<blockquote><p><font style="background-color: #ffffff">$web.lists | ft -property Title</font></p>
</blockquote>
<p>This formats the ouput of the lists property in a table (ft or format-table) and only gets the Title property of each list.</p>
<p>An interesting object is the SPFile object. You can use it to &#8220;grab&#8221; a file in your site such as default.aspx. For example:</p>
<blockquote><p><font style="background-color: #ffffff">$homepage=$web.GetFile(&#8221;default.aspx&#8221;)<br /></font><font style="background-color: #ffffff">$homepage</font></p>
</blockquote>
<p>When you type the above two commands you will get the properties of default.aspx. A useful property is CustomizedPageStatus. It allows you to see if the page has been customized and is in an unghosted state. Just type <strong>$homepage.customizedpagestatus </strong>to see the property.</p>
<p>Note that SPFile has useful methods like CopyTo, MoveTo, Delete and so on&#8230; For example, just try <strong>$homepage.copyto(&#8221;other.aspx&#8221;)</strong>. This will create a copy of the page. Just see if it worked by going to <a href="http://&lt;url&gt;/other.aspx">http://&lt;url&gt;/other.aspx</a>.</p>
<p>I have used SPFile before, for example to upload files. Just check <a href="http://pshell.info/sharepoint/166/uploading-documents-to-sharepoint/">this previous post</a> for more info. But uploading can be as simple as <strong>$web.files.add(&#8221;filename&#8221;, (get-content &lt;file&gt; -encoding byte)).</strong> By the way, to see files use the Files property as in <strong>$web.FILES | ft url</strong>. Note that you only get the files in the current folder (root of the website). You can get to files in other folders using SPFolder objects. For example: <strong>$web.Getfolder(&#8221;foldername&#8221;).Files | ft URL</strong>. To see all the files, you will need to use something recursive.</p>
<p>This post only touched on the basics. If I have some time I will post some other scripts that allow you to make bulk changes to sites and pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://pshell.info/basics/177/the-sharepoint-object-model-and-powershell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SMTP .net object demo</title>
		<link>http://pshell.info/basics/176/smtp-net-object-demo/</link>
		<comments>http://pshell.info/basics/176/smtp-net-object-demo/#comments</comments>
		<pubDate>Sun, 17 Jun 2007 15:21:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Basics]]></category>

		<category><![CDATA[Exchange 2007]]></category>

		<guid isPermaLink="false">http://pshell.info/basics/176/smtp-net-object-demo/</guid>
		<description><![CDATA[Evan Dodds has a nice example about the use of PowerShell in combination with Exchange Server 2007 cmdlets and some .net objects. The example sends an e-mail using an authenticated SMTP connection to Exchange. Check it out here.
]]></description>
			<content:encoded><![CDATA[<p>Evan Dodds has a nice example about the use of PowerShell in combination with Exchange Server 2007 cmdlets and some .net objects. The example sends an e-mail using an authenticated SMTP connection to Exchange. Check it out <a href="http://blogs.technet.com/evand/archive/2007/06/11/smtp-net-object-demo-from-my-teched-2007-powershell-session.aspx" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pshell.info/basics/176/smtp-net-object-demo/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PowerShell Graphical Help File</title>
		<link>http://pshell.info/basics/175/powershell-graphical-help-file/</link>
		<comments>http://pshell.info/basics/175/powershell-graphical-help-file/#comments</comments>
		<pubDate>Sun, 03 Jun 2007 18:22:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Basics]]></category>

		<guid isPermaLink="false">http://pshell.info/basics/175/powershell-graphical-help-file/</guid>
		<description><![CDATA[Head over to the Microsoft site and download the PowerShell help files in chm (Windows Help) format. Good stuff and very helpful while writing PowerShell scripts.
&#160;

It comes with a readme file that explains how to invoke GUI help from the PowerShell command line as well.
]]></description>
			<content:encoded><![CDATA[<p>Head over to the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=3b3f7ce4-43ea-4a21-90cc-966a7fc6c6e8&amp;displaylang=en&amp;tm" target="_blank">Microsoft site</a> and download the PowerShell help files in chm (Windows Help) format. Good stuff and very helpful while writing PowerShell scripts.</p>
<p>&nbsp;</p>
<p><a href="http://pshell.info/wp-content/uploads/2007/06/image.png" atomicselection="true"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="419" alt="image" src="http://pshell.info/wp-content/uploads/2007/06/image-thumb.png" width="640" border="0"></a></p>
<p>It comes with a readme file that explains how to invoke GUI help from the PowerShell command line as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://pshell.info/basics/175/powershell-graphical-help-file/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PowerShell script to backup Exchange with NTBackup</title>
		<link>http://pshell.info/exchange2007/172/powershell-script-to-backup-exchange-with-ntbackup/</link>
		<comments>http://pshell.info/exchange2007/172/powershell-script-to-backup-exchange-with-ntbackup/#comments</comments>
		<pubDate>Tue, 10 Apr 2007 19:49:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Advanced]]></category>

		<category><![CDATA[Exchange 2007]]></category>

		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://pshell.info/exchange2007/172/powershell-script-to-backup-exchange-with-ntbackup/</guid>
		<description><![CDATA[On Nick&#8217;s Exchange and Scripting Blog there is a good post about scripting NTBackup to backup Exchange databases. Besides the fact that I did not know about the NTBackup optimizations and an enhanced version of NTBackup in Windows Server 2003 SP1, the post is also very informative when it comes to PowerShell. It shows:

making registry [...]]]></description>
			<content:encoded><![CDATA[<p>On Nick&#8217;s Exchange and Scripting Blog there is a <a href="http://knicksmith.blogspot.com/2007/04/script-exchange-2007-backups-with.html" target="_blank">good post</a> about scripting NTBackup to backup Exchange databases. Besides the fact that I did not know about the NTBackup optimizations and an enhanced version of NTBackup in Windows Server 2003 SP1, the post is also very informative when it comes to PowerShell. It shows:</p>
<ul>
<li>making registry changes with PowerShell</li>
<li>scheduling PowerShell with the Exchange 2007 extensions and running a script at the same time</li>
<li>sending an e-mail</li>
<li>working with paths, files, etc&#8230;</li>
</ul>
<p>Great work and interesting for those who want to see practical examples of solving real problems with PowerShell!</p>
]]></content:encoded>
			<wfw:commentRss>http://pshell.info/exchange2007/172/powershell-script-to-backup-exchange-with-ntbackup/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PowerShell script to check ESX patch status</title>
		<link>http://pshell.info/vmware/171/powershell-script-to-check-esx-patch-status/</link>
		<comments>http://pshell.info/vmware/171/powershell-script-to-check-esx-patch-status/#comments</comments>
		<pubDate>Fri, 06 Apr 2007 15:59:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://pshell.info/basics/171/powershell-script-to-check-esx-patch-status/</guid>
		<description><![CDATA[You can use the simple PowerShell script below to check ESX server patching status from your Windows client. Requirements:

.NET Framework 2.0
PowerShell v1.0
plink.exe (from the Putty download page) in your path
An account and password to remotely connect over SSH and execute the command esxupdate query.
Change the $servers&#160;array with your servers and also update the $account and [...]]]></description>
			<content:encoded><![CDATA[<p>You can use the simple PowerShell script below to check ESX server patching status from your Windows client. Requirements:</p>
<ul>
<li>.NET Framework 2.0
<li>PowerShell v1.0
<li>plink.exe (from the Putty <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">download</a> page) in your path
<li>An account and password to remotely connect over SSH and execute the command <strong>esxupdate query</strong>.
<li>Change the $servers&nbsp;array with your servers and also update the $account and $password variable.
<li>Keep the $patches array up-to-date with ESX patch names.</li>
</ul>
<p>The script:</p>
<blockquote><p>$patches=&#8221;ESX-2158032&#8243;,&#8221;ESX-1410076&#8243;,&#8221;ESX-1006511&#8243;,&#8221;ESX-9986131&#8243;,&#8221;ESX-8173580&#8243;,&#8221;ESX-6921838&#8243;,&#8221;ESX-2066306&#8243;,&#8221;ESX-6075798&#8243;,&#8221;ESX-5497987&#8243;,&#8221;ESX-3996003&#8243;,&#8221;ESX-2092658&#8243;,&#8221;ESX-2031037&#8243;,&#8221;ESX-1917602&#8243;,&#8221;ESX-1271657&#8243;,&#8221;ESX-9865995&#8243;,&#8221;ESX-6856573&#8243;,&#8221;ESX-6050503&#8243;,&#8221;ESX-5885387&#8243;,&#8221;ESX-5031800&#8243;,&#8221;ESX-3199476&#8243;,&#8221;ESX-9916286&#8243;,&#8221;ESX-9617902&#8243;,&#8221;ESX-8852210&#8243;,&#8221;ESX-8174018&#8243;,&#8221;ESX-7780490&#8243;,&#8221;ESX-7737432&#8243;,&#8221;ESX-5011126&#8243;,&#8221;ESX-3416571&#8243;,&#8221;ESX-1161870&#8243;,&#8221;ESX-2559638&#8243;,&#8221;ESX-2257739&#8243;,&#8221;ESX-1541239&#8243;
<p>$servers=&#8221;server0&#8243;,&#8221;server1&#8243;
<p>$account=&#8221;root&#8221;<br />$password=&#8221;password&#8221;
<p>$servers | % { $a=plink -pw $password $account@$_ &#8220;esxupdate query&#8221;
<p>$server=$_
<p>$patches | % {
<p>&nbsp; $patch=$_
<p>&nbsp; if( [regex]::match($a, $_).success ) {
<p>&nbsp;&nbsp;&nbsp;&nbsp; $summary=&#8221;Installed&#8221;<br />&nbsp; }<br />&nbsp;&nbsp;else<br />&nbsp;{<br />&nbsp;&nbsp;&nbsp; $summary=&#8221;Not installed&#8221;<br />&nbsp;}
<p>new-object psobject |<br />add-member -pass NoteProperty Server $server | <br />add-member -pass NoteProperty Patch $patch |<br />add-member -pass NoteProperty Summary $summary
<p>}
<p>}</p>
</blockquote>
<p>&nbsp;Save the above script as a .ps1 file (e.g. c:\patch.ps1) and run it as follows:<br />
<blockquote>
<p>./patch.ps1 | ft -groupby server</p>
</blockquote>
<p>You will get an overview of all patches grouped by server.</p>
]]></content:encoded>
			<wfw:commentRss>http://pshell.info/vmware/171/powershell-script-to-check-esx-patch-status/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
