<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>I Love Powershell</title>
	<atom:link href="http://www.ilovepowershell.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ilovepowershell.com</link>
	<description>Foreach ($day in $life) {Get-Knowledge &#124; Export-AsSkill -Destination Brain}</description>
	<lastBuildDate>Fri, 12 Apr 2013 22:08:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>How to Find Enum Values in PowerShell</title>
		<link>http://www.ilovepowershell.com/find-enum-values-in-powershell/</link>
		<comments>http://www.ilovepowershell.com/find-enum-values-in-powershell/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 21:39:06 +0000</pubDate>
		<dc:creator>Flash Denning</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/?p=183</guid>
		<description><![CDATA[&#160; There are a couple of very easy ways to get a find enum values in PowerShell.  Enums are often used when choosing an option as a parameter in a PowerShell command.  This article shows you exactly how to get those values for any enumerated list type (called “enum”). The easiest way to find enum values in PowerShell is to use Get-Help, but that doesn’t always work The easiest way is by using the Get-Help command on a PowerShell cmdlet or function.  All of the built in PowerShell cmdlets have great help that is painstakingly created and maintained. Some of the functions that are included with PowerShell modules or a PSSnapin will also have documented parameters. So the number one most simple way to check out the possible accepted values for an enum is to check with the get-help documentation. It looks like this: Get-Help Set-ExecutionPolicy –full In the results, you can see in the values displayed inline with the parameter that accepts the type &#160; Start by using Get-Help to try finding enum values. It is very fast, and the enum values are often in the help documentation. That’s pretty good.  Unfortunately, the help for a function that was [...]]]></description>
				<content:encoded><![CDATA[<div id="attachment_187" class="wp-caption alignleft" style="width: 132px"><a href="http://www.amazon.com/gp/product/1449320686/ref=as_li_ss_il?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1449320686&amp;linkCode=as2&amp;tag=gs_powershell-20"><img class="size-full wp-image-187 " title="Windows PowerShell Cookbook" alt="WindowsPowerShellCookbook" src="http://www.ilovepowershell.com/wp-content/uploads/2013/03/WindowsPowerShellCookbook.jpg" width="122" height="160" /></a><p class="wp-caption-text">Windows PowerShell Cookbook Volume 3 by Lee Holmes</p></div>
<p>&nbsp;</p>
<p>There are a couple of very easy ways to get a find enum values in PowerShell.  Enums are often used when choosing an option as a parameter in a PowerShell command.  This article shows you exactly how to get those values for any enumerated list type (called “enum”).</p>
<h2>The easiest way to find enum values in PowerShell is to use Get-Help, but that doesn’t always work</h2>
<p>The easiest way is by using the Get-Help command on a PowerShell cmdlet or function.  All of the built in PowerShell cmdlets have great help that is painstakingly created and maintained. Some of the functions that are included with PowerShell modules or a PSSnapin will also have documented parameters.</p>
<p>So the number one most simple way to check out the possible accepted values for an enum is to check with the get-help documentation.</p>
<p>It looks like this:</p>
<p><code language="powershell"><br />
Get-Help Set-ExecutionPolicy –full<br />
</code></p>
<p><a href="http://www.ilovepowershell.com/wp-content/uploads/2013/03/usingGetHelp_thumb.png"><img class="size-medium wp-image-185 alignleft" alt="usingGetHelp_thumb" src="http://www.ilovepowershell.com/wp-content/uploads/2013/03/usingGetHelp_thumb-300x136.png" width="300" height="136" /></a></p>
<p>In the results, you can see in the values displayed inline with the parameter that accepts the type</p>
<p>&nbsp;</p>
<p>Start by using Get-Help to try finding enum values. It is very fast, and the enum values are often in the help documentation.</p>
<p>That’s pretty good.  Unfortunately, the help for a function that was developed in house does not usually include such great documentation.</p>
<h2>The best way to find enum values with PowerShell is to use a static method.</h2>
<p>I’ll continue to use the Set-ExecutionPolicy cmdlet as my example, but these will work for any class that is an enum.</p>
<p>There are two approaches to this, and each one does the same thing.</p>
<p>First, you can use a static method from the base enum class, [system.enum].  Secondly, you can use a static method of the class (the enum) that you’re trying to identify the values for.</p>
<p>And before you can do either one, you need to identify the type that the enum represents.</p>
<h3>How to find out the type of an enum</h3>
<p>Consider the “Set-ExecutionPolicy” cmdlet, which uses a parameter “ExecutionPolicyScope” to specify at what level you want to apply the execution policy that you’re setting.</p>
<p>So if you want to know what options can go in</p>
<p>Set-ExecutionPolicy –ExecutionPolicy RemoteSigned –Scope  ???</p>
<p>You can find out what class the “Scope” parameter accepts by using Get-Help to interrogate the parameter.</p>
<p>Get-Help Set-ExecutionPolicy –Parameter Scope</p>
<p>Which returns just the information about the “Scope” parameter.</p>
<p><a href="http://www.ilovepowershell.com/wp-content/uploads/2013/03/usingGetHelp-FindParameterType_thumb.png"><img alt="usingGetHelp-FindParameterType_thumb" src="http://www.ilovepowershell.com/wp-content/uploads/2013/03/usingGetHelp-FindParameterType_thumb-300x52.png" width="300" height="52" /></a></p>
<p>&nbsp;</p>
<p>This shows that what you put into the Scope parameter is an object of type ExecutionPolicyScope.</p>
<p>That’s half the battle.  Actually, it’s way more than half the battle:  you’re almost done.</p>
<h3>Finding out the names in an enumerated list (enum) when you know the type.</h3>
<p>So now that we know the type, we need to be able to reference it.</p>
<p>To do this, I’m going to use a static method from the Enumeration class, SYSTEM.ENUM, called GetNames().  Use it like this:</p>
<p>[Enum]::GetNames(“Microsoft.PowerShell.ExecutionPolicyScope”)</p>
<p><a href="http://www.ilovepowershell.com/wp-content/uploads/2013/03/ListEnum_thumb.png"><img class="alignnone size-medium wp-image-184" alt="ListEnum_thumb" src="http://www.ilovepowershell.com/wp-content/uploads/2013/03/ListEnum_thumb-300x61.png" width="300" height="61" /></a></p>
<p>And you will get all of the possible options for your enumerated list.  It might look like I took some liberties with the class name, because when it was listed in the Get-Help –Parameter output from above it was listed as “ExecutionPolicyScope” but when I entered it into the GetNames static method I used “Microsoft.PowerShell.ExecutionPolicy”.  When I first tried it with just “ExecutionPolicyScope” it returned an error.  So I made a guess that it was part of the standard PowerShell namespace, and it turned out to be correct.</p>
<p>By the way, the default PowerShell namespace is Microsoft.PowerShell and many PowerShell objects that are listed as only a class name actually belong to it, so it can be worth a try.</p>
<p>Many other enums listed as types in parameters for a command will list out the full namespace with the object.</p>
<p>Ok – so you’ve read the article.  I hope that you’ve gotten something great out of it.  I love helping people get more out of PowerShell, because I know PowerShell can help people do more work, faster, and with fewer mistakes than ever.</p>
<p>I’m committed to sharing great PowerShell advice and tips, so how’s about <a href="http://feeds.feedburner.com/ilovepowershell">subscribing</a> or spreading the word by sharing this article with a fellow that would benefit from it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/find-enum-values-in-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Overview of the SMBShare Module for PowerShell 3</title>
		<link>http://www.ilovepowershell.com/overview-smbshare-module-powershell-3/</link>
		<comments>http://www.ilovepowershell.com/overview-smbshare-module-powershell-3/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 21:07:59 +0000</pubDate>
		<dc:creator>Flash Denning</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/?p=180</guid>
		<description><![CDATA[The SMBShare Module that comes with PowerShell 3 lets you administer network shares directly from within PowerShell. The cmdlets are easy to use, and it is my new favorite way to work with network shares. It’s the Quickest Way to Create a Network Share with PowerShell It’s very easy to create network shares with PowerShell by using the SMBShare module that comes in PowerShell version 3. How to Install the SMBShare Module for PowerShell 3 If you’ve already got PowerShell v.3, then you’re already all set.  You don’t even have to add a pssnapin or import a module.  One of my favorite PowerShell 3 features is the ability to load modules on demand when one of the commands in the module is called. So if you want to load the SMBShare module, just run one of the commands I’m getting ready to tell you about! The SMBShare “Get-” Commands The SMBShare module includes 11 different Get commands, for finding out the current state of affairs with your SMB shares and your SMB client configuration. Get-SmbClientConfiguration:  This will tell you how a computer, either locally or remote through WMI connection, is configured.  It returns items such as how long to stay [...]]]></description>
				<content:encoded><![CDATA[<p>The SMBShare Module that comes with PowerShell 3 lets you administer network shares directly from within PowerShell. The cmdlets are easy to use, and it is my new favorite way to work with network shares.</p>
<h2>It’s the Quickest Way to Create a Network Share with PowerShell</h2>
<p>It’s very easy to <a href="http://www.ilovepowershell.com/create-network-share-with-powershell-3/">create network shares with PowerShell</a> by using the SMBShare module that comes in PowerShell version 3.</p>
<h3>How to Install the SMBShare Module for PowerShell 3</h3>
<p>If you’ve already got PowerShell v.3, then you’re already all set.  You don’t even have to add a pssnapin or import a module.  One of my favorite PowerShell 3 features is the ability to load modules on demand when one of the commands in the module is called.</p>
<p>So if you want to load the SMBShare module, just run one of the commands I’m getting ready to tell you about!</p>
<h4>The SMBShare “Get-” Commands</h4>
<p>The SMBShare module includes 11 different Get commands, for finding out the current state of affairs with your SMB shares and your SMB client configuration.</p>
<p><strong>Get-SmbClientConfiguration:  </strong>This will tell you how a computer, either locally or remote through WMI connection, is configured.  It returns items such as how long to stay connected (KeepConn) and how soon to consider a dropped session a timeout (SessionTimeout).</p>
<p><strong>Get-SmbClientNetworkInterface:</strong> All of the Network Interfaces, including wired, wireless, and logical, are all displayed.  this makes:<br />
[code language="powershell"]<br />
#Get all of the IP addresses for all network interfaces<br />
$AllIPs  = Get-SMBClientNetworkInterfaces | Select-Object -ExpandProperty  IPAddresses<br />
[/code]<br />
<strong>Get-SmbConnection:</strong>  This lists active SMB connections and even includes Bytes Sent and Received.  Administrative PowerShell session  required.</p>
<p>Hey, have you seen the cool trick I use to color my administrative shells with a red background?  It’s really easy.</p>
<p>Read: <a href="http://www.ilovepowershell.com/profile-trick-how-to-set-administrator-mode-background-color/">How to Change Background Color on Administrative PowerShell Session</a></p>
<p><strong>Get-SmbMapping </strong> gives you a list of mapped drives, and returns properties such as LocalDrive (the drive letter the mapped drive is assigned) and the RemotePath, which is the mapped network share.  It also displays the status.</p>
<p>Here’s hoping that I can finally and easily remove old sessions to servers to I can connect to an administrative share without getting the stupid “Cannot connect with more than one user name to a server” error.  BTW, in case you didn’t know about it, there’s a <a href="http://www.geekserious.com/make-connection-second-credential-network-share">sneaky trick to get a second set of credentials mapped to a server share</a></p>
<p><strong>Get-SmbMultichannelConnection  </strong>If you’re using SMB Multichannel, then this is your tool of choice for getting that connection information.  I’m not using it, so I’ll leave it open.  If you’ve got some information about this, please send a note in the comments and I’ll update with your facts and give you credit.</p>
<p><strong>Get-SmbOpenFile</strong> I love this one!  Gets all of the files that are currently open.  This was available in the Server properties through the GUI, but this is an administrative function that was a hassle to script in WMI and it’s so much easier now.</p>
<p><strong>Get-SmbServerConfiguration</strong> Similar to the first command we mentioned, but this is the server settings instead of the client settings</p>
<p><strong>Get-SmbShare</strong> All shares, including administrative and hidden shares, are included with this simple command.    You can quickly see at a glance which of your shares are temporary, permanent, using shadow copy, and its status.  Another one that makes an admins job much easier.</p>
<p><strong>Get-SmbShareAccess</strong>  You were probably already asking the question:  ”Does Get-SMBShare tell you who has access?”   But no, it doesn’t.  Instead, you use the Get-SMBShare command, then pipe it into Get-SMBShareAccess<br />
[code language="powershell"]<br />
#Get a list of any users that write to any shares that are not online</p>
<p>$Shares = Get-SMBShare</p>
<p>$Offline = $Shares | Where-Object {$_.ShareState -eq “Offline”}</p>
<p>$Users = $Offline  | Get-SMBShareAccess | Where-Object {$_.AccessRight -le “Change”}<br />
[/code]<br />
That’s just the Get Commands, but I think you can tell a lot from the Get commands, because that’s what’s going to feed into the Set commands.</p>
<p>Still, I bet you’d like to know which of the nouns you’ll be able to modify using the SMBShare module.</p>
<h2>Set, New, and Remove – the rest of the SMBShare module cmdlets.</h2>
<p>By the nouns, that is, the objects that you’re able to administer, here is what you can do to the different SMBShare objects.</p>
<p><strong>SMBClientConfiguration:</strong> In addition to Get-, you can also use Set-SMBClientConfiguration.</p>
<p><strong>SMBShare</strong>: You can also use New-SMBShare, Remove-SMBShare, and Set-SMBShare.</p>
<p><strong>SMBMultichannelConnection</strong>: Update-SMBMultichannelConnection is the only additional cmdlet for working with the Multi-channel SMB connections.</p>
<p><strong>SMBServerConfiguration</strong>: Like client configuration, you also get Set-SMBServerConfiguration.</p>
<p><strong>SMBOpenFile</strong>: If you were excited to see the Get-SMBOpenFile, you were probably eagerly hoping that this command was included.  Yes, you also get Close-SMBOpenFile.</p>
<p><strong>SMBShareAccess</strong>: Also available for administering share permissions is Block-SMBShareAccess, Grant-SMBShareAccess, Revoke-SMBShareAccess, and Unblock-SMShareAccess.</p>
<p><strong>SMBMapping</strong>: New-SMBMapping and Remove-SMBMapping are also available, so you can now actually map real drives from within PowerShell, not just PSDrives that exist only in the PowerShell session.</p>
<p><strong>SMBSession</strong>: When you’re ready to end a session, you can do it with style using the Close-SMBSession cmdlet.</p>
<h2>In Ending</h2>
<p>Well, it’s been a great journey, and this exercise was as good for me to learn as it was for you to learn.  While I had already been using some of the SMBShare commands, actually taking the time to try the different cmdlets and seeing which ones are available is really beneficial.</p>
<p>My favorite two that I’ll use the most:</p>
<p><strong>Grant-SMBShareAccess</strong></p>
<p><strong>New-SMBMapping</strong></p>
<p>What about you?  What&#8217;s your favorite from this module?  Let me know if you liked this article by connecting in the comments below, and please <a href="http://www.ilovepowershell.com/subscribe">subscribe</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/overview-smbshare-module-powershell-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Create a Network Share With PowerShell</title>
		<link>http://www.ilovepowershell.com/create-network-share-with-powershell-3/</link>
		<comments>http://www.ilovepowershell.com/create-network-share-with-powershell-3/#comments</comments>
		<pubDate>Thu, 20 Sep 2012 03:45:08 +0000</pubDate>
		<dc:creator>Flash Denning</dc:creator>
				<category><![CDATA[Administrator]]></category>
		<category><![CDATA[Network Share]]></category>
		<category><![CDATA[SMB]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/?p=166</guid>
		<description><![CDATA[PowerShell 3 makes it very easy to create a network share in Windows 8 and Windows Server 2012.&#160; PowerShell 3 brings with it a whole plethora of new commands.&#160; Most of the new cmdlets in PowerShell 3 are grouped together into modules that are easy to browse and load. Creating a new network share is done with the SMBShare module.&#160; You do not need to load the module as you would have in previous versions of PowerShell.&#160; Cmdlets in unloaded modules are listed in the get-command results, and the module is loaded the first time one of the cmdlets is run. How to Create a Network Share with PowerShell 3 To begin, you’ll need a folder to share.&#160; This is created with the New-Item cmdlet, instead of a cmdlet in the SMBShare module. New-Item “C:\Shared&#34; –type directory If you are creating multiple levels at once (like “C:\NewRootFolder\NewChildFolder\NewShared” you can add the –force switch to make it create all necessary parent folders in the heirarchy) Now that you have a folder that you want to share, you can turn it into a shared folder using the New-SMBShare cmdlet. New-SMBShare –Name “Shared” –Path “C:\Shared” –ContinuouslyAvailable –FullAccess domain\admingroup&#160; -ChangeAccess domain\deptusers&#160; -ReadAccess “domain\authenticated users” [...]]]></description>
				<content:encoded><![CDATA[<p>PowerShell 3 makes it very easy to create a network share in Windows 8 and Windows Server 2012.&#160; PowerShell 3 brings with it a whole plethora of new commands.&#160; Most of the new cmdlets in PowerShell 3 are grouped together into <a title="iLovePowerShell.com - New Modules in PowerShell 3" href="http://www.ilovepowershell.com/new-modules-powershell-3">modules</a> that are easy to browse and load.</p>
<p>Creating a new network share is done with the <a title="iLovePowerShell.com - Overview of the SMBShare Module in PowerShell 3" href="http://www.ilovepowershell.com/overview-smbshare-module-powershell-3">SMBShare module</a>.&#160; You do not need to load the module as you would have in previous versions of PowerShell.&#160; Cmdlets in unloaded modules are listed in the get-command results, and the module is loaded the first time one of the cmdlets is run.</p>
<h1>How to Create a Network Share with PowerShell 3</h1>
<p>To begin, you’ll need a folder to share.&#160; This is created with the New-Item cmdlet, instead of a cmdlet in the SMBShare module.</p>
<blockquote><p>New-Item “C:\Shared&quot; –type directory</p>
</blockquote>
<p>If you are creating multiple levels at once (like “C:\NewRootFolder\NewChildFolder\NewShared” you can add the –force switch to make it create all necessary parent folders in the heirarchy)</p>
<p>Now that you have a folder that you want to share, you can turn it into a shared folder using the New-SMBShare cmdlet.</p>
<blockquote><p>New-SMBShare –Name “Shared” –Path “C:\Shared” –ContinuouslyAvailable –FullAccess domain\admingroup&#160; -ChangeAccess domain\deptusers&#160; -ReadAccess “domain\authenticated users”</p>
</blockquote>
<h2>Create a Network Share with PowerShell – The Parameters</h2>
<p>Here are the parameters that you may need to get just the right experience for your network shares.</p>
<table cellspacing="0" cellpadding="2" width="600" border="1">
<tbody>
<tr>
<td valign="top" width="150">Parameter Name</td>
<td valign="top" width="150">Input Type</td>
<td valign="top" width="150">Required</td>
<td valign="top" width="150">Description</td>
</tr>
<tr>
<td valign="top" width="150">CATimeout</td>
<td valign="top" width="150">Integer</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">How many seconds to wait before failing.</td>
</tr>
<tr>
<td valign="top" width="150">CachingMode</td>
<td valign="top" width="150">Choice:         <br />None, Manual, Documents, Programs, BranchCache, Unknown</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">The caching policy for the share.</td>
</tr>
<tr>
<td valign="top" width="150">ChangeAccess</td>
<td valign="top" width="150">String or String Array</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Users to grant Read/Write access to.</td>
</tr>
<tr>
<td valign="top" width="150">Concurrent User Limit</td>
<td valign="top" width="150">Integer</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">How many users can access the share at a time.</td>
</tr>
<tr>
<td valign="top" width="150">ContinuouslyAvailable</td>
<td valign="top" width="150">Boolean (switch)</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Whether to keep the share after the next reboot.</td>
</tr>
<tr>
<td valign="top" width="150">Description</td>
<td valign="top" width="150">String</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Friendly description of the share.</td>
</tr>
<tr>
<td valign="top" width="150">EncryptData</td>
<td valign="top" width="150">Boolean (switch)</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Use to turn on file encryption.</td>
</tr>
<tr>
<td valign="top" width="150">FolderEnumerationMode</td>
<td valign="top" width="150">Choice:         <br />AccessBased, Unrestricted</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Choose when folders are enumerated (listed) in the share.</td>
</tr>
<tr>
<td valign="top" width="150">FullAccess</td>
<td valign="top" width="150">String or String Array</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Users to grant Full control to.</td>
</tr>
<tr>
<td valign="top" width="150">Name</td>
<td valign="top" width="150">String</td>
<td valign="top" width="150">Yes</td>
<td valign="top" width="150">Name of the share.</td>
</tr>
<tr>
<td valign="top" width="150">NoAccess</td>
<td valign="top" width="150">String or String Array</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Users to deny access to.</td>
</tr>
<tr>
<td valign="top" width="150">Path</td>
<td valign="top" width="150">String</td>
<td valign="top" width="150">Yes</td>
<td valign="top" width="150">The file path to the shared folder.</td>
</tr>
<tr>
<td valign="top" width="150">ReadAccess</td>
<td valign="top" width="150">String or String Array</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Users to grant Read Only access to.</td>
</tr>
<tr>
<td valign="top" width="150">ScopeName</td>
<td valign="top" width="150">String</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Name of the endpoint that the share is scoped to.</td>
</tr>
<tr>
<td valign="top" width="150">Temporary</td>
<td valign="top" width="150">Boolean (switch)</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Share removed after reboot.</td>
</tr>
<tr>
<td valign="top" width="150">ThrottleLimit</td>
<td valign="top" width="150">Integer</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Limit the resources of the share.</td>
</tr>
<tr>
<td valign="top" width="150">AsJob</td>
<td valign="top" width="150">Boolean (switch)</td>
<td valign="top" width="150">No</td>
<td valign="top" width="150">Create a Job to background process this command</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<h2>How To Change or Remove Network Shares with PowerShell</h2>
<p>Here are the other cmdlets in the SMBShare module:</p>
<ul>
<li>Block-SmbShareAccess</li>
<li>Close-SmbOpenFile</li>
<li>Close-SmbSession</li>
<li>Get-SmbClientConfiguration</li>
<li>Get-SmbClientNetworkInterface</li>
<li>Get-SmbConnection</li>
<li>Get-SmbMapping</li>
<li>Get-SmbMultichannelConnection</li>
<li>Get-SmbOpenFile</li>
<li>Get-SmbServerConfiguration</li>
<li>Get-SmbServerNetworkInterface</li>
<li>Get-SmbSession</li>
<li>Get-SmbShare</li>
<li>Get-SmbShareAccess</li>
<li>Grant-SmbShareAccess</li>
<li>New-SmbMapping</li>
<li>New-SmbShare</li>
<li>Remove-SmbMapping</li>
<li>Remove-SmbShare</li>
<li>Revoke-SmbShareAccess</li>
<li>Set-SmbClientConfiguration</li>
<li>Set-SmbServerConfiguration</li>
<li>Set-SmbShare</li>
<li>Unblock-SmbShareAccess</li>
<li>Update-SmbMultichannelConnection</li>
</ul>
<p>I hope this has helped you in your day!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/create-network-share-with-powershell-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Time to update the iLovePowerShell template</title>
		<link>http://www.ilovepowershell.com/time-to-update-the-ilovepowershell-template/</link>
		<comments>http://www.ilovepowershell.com/time-to-update-the-ilovepowershell-template/#comments</comments>
		<pubDate>Tue, 03 Jul 2012 15:01:55 +0000</pubDate>
		<dc:creator>Flash Denning</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/?p=146</guid>
		<description><![CDATA[I&#8217;m going to work on this template today at lunch.]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m going to work on this template today at lunch.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/time-to-update-the-ilovepowershell-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moved to America, New Job Started</title>
		<link>http://www.ilovepowershell.com/moved-to-america-new-job-started/</link>
		<comments>http://www.ilovepowershell.com/moved-to-america-new-job-started/#comments</comments>
		<pubDate>Wed, 09 May 2012 01:31:33 +0000</pubDate>
		<dc:creator>Flash Denning</dc:creator>
				<category><![CDATA[WorkLifeBalance]]></category>
		<category><![CDATA[Alaska]]></category>
		<category><![CDATA[California]]></category>
		<category><![CDATA[Fairbanks]]></category>
		<category><![CDATA[New Job]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Santa Barbara]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/?p=135</guid>
		<description><![CDATA[Okay, technically speaking Alaska is in America, so I was already “in America” – but there was no Jack in the Box or Arby’s in Fairbanks – so does it really count? My PowerShell skills helped me get my new job, and I’m happy to say that it’s in a place that’s much easier to live in than Fairbanks.&#160; My new job is with UC Santa Barbara.&#160; It’s warm and sunny here a lot. I’m also happy that in my new role as Senior System Engineer, I’ll be focusing on some Microsoft Implementations.&#160; First up, I’ll be getting Forefront Identity Manager 2010 moved from development to production (by way of test) and then getting SharePoint off the ground.&#160; Both of which will include plenty of scripting with PowerShell. I wonder what they’ll have me do in the second week? Seriously, it’s a great job in a great location.&#160; I couldn’t be happier – and I owe it all to God and to PowerShell (but I did a little to help, too.)]]></description>
				<content:encoded><![CDATA[<p>Okay, technically speaking Alaska <strong>is </strong>in America, so I was already <em>“in America” </em>– but there was no Jack in the Box or Arby’s in Fairbanks – so does it <em>really</em> count?</p>
<p>My PowerShell skills helped me get my new job, and I’m happy to say that it’s in a place that’s much easier to live in than Fairbanks.&#160; My new job is with UC Santa Barbara.&#160; It’s warm <a title="BestPlaces - Climate in Santa Barbara, California" href="http://www.bestplaces.net/climate/city/california/santa_barbara">and sunny here a lot</a>.</p>
<p>I’m also happy that in my new role as Senior System Engineer, I’ll be focusing on some Microsoft Implementations.&#160; First up, I’ll be getting Forefront Identity Manager 2010 moved from development to production (by way of test) and then getting SharePoint off the ground.&#160; Both of which will include plenty of scripting with PowerShell.</p>
<p><em>I wonder what they’ll have me do in the <strong>second week</strong>?</em></p>
<p>Seriously, it’s a great job in a great location.&#160; I couldn’t be happier – and I owe it all to God and to PowerShell (but I did a little to help, too.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/moved-to-america-new-job-started/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Run Scripts With PowerShell</title>
		<link>http://www.ilovepowershell.com/how-to-run-scripts-with-powershell/</link>
		<comments>http://www.ilovepowershell.com/how-to-run-scripts-with-powershell/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 19:22:02 +0000</pubDate>
		<dc:creator>Flash Denning</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Comment]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[profile]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/how-to-run-scripts-with-powershell/</guid>
		<description><![CDATA[If you’re new to PowerShell, some of the first things you’ll want to do are find your way around, find the commands, aliases.  Some of the concepts, like figuring out the pipe, and how to use it, can be a struggle. Before long, though, you’re going to start getting used to it, and then you’ll want to start saving your work so you can reuse it.  You can do that by saving a text file with a .ps1 extension.  A ps1 is just a PowerShell script.  You don’t have to have anything else in it other than the same commands you use when you’re typing in to the PowerShell console.  In fact, anything that you can type into the console can be typed into a .ps1 file exactly the same way, and then run. So this is for my PowerShell people that are just getting to know their way around, and need to start either working with PowerShell profiles or start running PS1 files.  Once you’ve gotten the script doing what you want, you can also run a PowerShell script as a scheduled task. Here are some things you can (and should) do to work with ps1 files, including your [...]]]></description>
				<content:encoded><![CDATA[<p>If you’re new to PowerShell, some of the first things you’ll want to do are find your way around, find the commands, aliases.  Some of the concepts, like figuring out the pipe, and how to use it, can be a struggle.</p>
<p>Before long, though, you’re going to start getting used to it, and then you’ll want to start saving your work so you can reuse it.  You can do that by saving a text file with a .ps1 extension.  A ps1 is just a PowerShell script.  You don’t have to have anything else in it other than the same commands you use when you’re typing in to the PowerShell console.  In fact, anything that you can type into the console can be typed into a .ps1 file exactly the same way, and then run.</p>
<p>So this is for my PowerShell people that are just getting to know their way around, and need to start either working with PowerShell profiles or start running PS1 files.  Once you’ve gotten the script doing what you want, you can also <a title="iLovePowerShell - How To Run a PowerShell Script as a Scheduled Task" href="http://www.ilovepowershell.com/how-to-run-powershell-script-as-scheduled-task/">run a PowerShell script as a scheduled task</a>.</p>
<p>Here are some things you can (and should) do to work with ps1 files, including your profile:</p>
<div style="border-style:dashed;margin-left:auto;margin-right:auto;width:85%;"><strong>Advertisement</strong><br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-1277998175939297";
/* PoSh - In Article Text Box */
google_ad_slot = "8100217210";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<h3>Tip 1:  Set the Execution Policy on One Machine (Use Group Policy for a Domain)</h3>
<p>PowerShell takes security seriously.  By default, you cannot run scripts at all, not even your profile.  The execution policy defines what scripts you can run.</p>
<p>There are four settings for the execution policy.  You can set this to whatever you like, but it may have already been set for you in your environment via group policy.  Here are the different settings you can set the execution policy to, from most restrictive to least</p>
<p>An execution policy is applied to a scope.  There are three scopes you can apply the policy setting to:  LocalMachine (the computer), CurrentUser (the user), or Process (the currently running PowerShell session and the policy goes away once the window is closed.)  If you don’t specify a scope, you’re setting the LocalMachine policy.  Also, there is a preference in applying scopes:  Process overrides CurrentUser, which in turn overrides LocalMachine.</p>
<ul>
<li>Undefined – If all scopes are undefined then it is set to the default, which is restricted.</li>
<li>Restricted – No scripts may run at all.</li>
<li>AllSigned – All scripts that have a digital signature may run.</li>
<li>RemoteSigned – Local scripts may run.  Scripts executed from the network must be digitally signed.</li>
<li>Unrestricted – All scripts may run.</li>
<li>Bypass – All scripts may run, and all warnings and prompts are disabled.</li>
</ul>
<p>Which execution policy you set is up to you.  Usually a prudent choice is RemoteSigned.  Here’s how you set it</p>
<blockquote><p>Set-ExecutionPolicy  RemoteSigned</p></blockquote>
<p>Easy, right?  Well without setting the execution policy, all of your scripts, even your own profile, won’t run at all.</p>
<h3>Tip 2: Save Work You Will Use Again in a Script</h3>
<p>If you’re not already using the Integrated Scripting Environment (ISE), you should really get to know it.</p>
<p>When you go to start PowerShell, instead look for the option to start PowerShell ISE.  Using the ISE gives you an opportunity to save the work that you’ve been doing often, and you can run bits and pieces of your script as you’re writing it to make sure it’s working as you intend.</p>
<h3>Tip 3: Use a PowerShell Profile</h3>
<p>If you are starting to get into writing down the things you do, you should look at creating a profile.  The profiles (there are multiples actually) are very useful for defining functions, mapping PSDrives, and importing modules.  If you haven’t setup your profile yet, I’ve written a post outlining <a title="iLovePowerShell.com - How To Create a PowerShell Profile" href="http://www.ilovepowershell.com/how-to-create-a-powershell-profile/">how to setup your PowerShell profile</a></p>
<h3>Tip 4: Use Comments, Even For Scripts Only You Will Use</h3>
<p>When typing out your scripts into a ps1 file, it’s a great idea to use comments liberally.  Even if you think you will not be sharing this script with others, you will likely be sharing it with yourself 6 months after you wrote it.  The things that you thought would always be obvious suddenly are not.  You can save yourself a lot of frustration and time decoding your own scripts if you just add some comments throughout the script describing what you’re attempting to do with it.</p>
<p>The comment character for PowerShell is the Number Sign (Pound Sign, or #).  Anything written after a # in a PowerShell script file (ps1), or even in the console, are not processed but instead passed over.</p>
<p>You can easily comment out a single line of your script by placing a “#” at the beginning of it, like this:</p>
<blockquote><p># Write-Host “This Line is a comment.  It won’t write anything”<br />
# This is a comment too.</p>
<p># Comments can be used at the end of a single line to describe what is happening</p>
<p>$myVariable = 2 + 4    # This should set $myVariable to 6.</p></blockquote>
<p>You can also comment with a comment block.  Anything written (even on multiple lines) is commented out.  A comment block starts with &lt;#, and then anything after that is a comment until the comment block ends with a #&gt;</p>
<blockquote><p>&lt;# This is a comment block</p>
<p>Still a comment</p>
<p>This is the last comment line #&gt;</p>
<p>Write-host “Uncommented now”</p></blockquote>
<p>I hope this is a help to those of you just starting out with PowerShell, and that it helps move you from just starting out, to taking the next steps towards automating with Windows PowerShell.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/how-to-run-scripts-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
